VoIP.ms & Twilio incoming calls work, but outgoing I get "all circuits are busy"

VoIP.ms & Twilio incoming calls work great. However I have outbound routes set to VoIP.ms ip then Twilio.No matter what I try I can’t seem to get an outgoing call to go through. The dump below is only for the Voip trunks I had disabled the Twilio

root@RasPBX:~# asterisk -rvvv

Asterisk 22.7.0, Copyright (C) 1999 - 2025, Sangoma Technologies Corporation and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 22.7.0 currently running on RasPBX (pid = 1092)
– Remote UNIX connection
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio TOS bits 184 in TCLASS field.
== Using SIP RTP Audio CoS mark 5
– Executing [260747XXXX@from-internal:1] Gosub(“PJSIP/201-00000038”, “macro-user-callerid,s,1(LIMIT,EXTERNAL)”) in new stack
– Executing [s@macro-user-callerid:1] Set(“PJSIP/201-00000038”, “TOUCH_MONITOR=1770134424.56”) in new stack
– Executing [s@macro-user-callerid:2] Set(“PJSIP/201-00000038”, “CHANCONTEXT=”) in new stack
– Executing [s@macro-user-callerid:3] Set(“PJSIP/201-00000038”, “CHANCONTEXT=”) in new stack
– Executing [s@macro-user-callerid:4] Set(“PJSIP/201-00000038”, “CHANEXTENCONTEXT=201-00000038”) in new stack
– Executing [s@macro-user-callerid:5] Set(“PJSIP/201-00000038”, “CHANEXTEN=201-00000038”) in new stack
– Executing [s@macro-user-callerid:6] Set(“PJSIP/201-00000038”, “CALLERID(number)=201”) in new stack
– Executing [s@macro-user-callerid:7] Set(“PJSIP/201-00000038”, “AMPUSER=201”) in new stack
– Executing [s@macro-user-callerid:8] Set(“PJSIP/201-00000038”, “HOTDESCKCHAN=201-00000038”) in new stack
– Executing [s@macro-user-callerid:9] Set(“PJSIP/201-00000038”, “HOTDESKEXTEN=201”) in new stack
– Executing [s@macro-user-callerid:10] Set(“PJSIP/201-00000038”, “HOTDESKCALL=0”) in new stack
– Executing [s@macro-user-callerid:11] ExecIf(“PJSIP/201-00000038”, “0?Set(HOTDESKCALL=1)”) in new stack
– Executing [s@macro-user-callerid:12] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(name)=)”) in new stack
– Executing [s@macro-user-callerid:13] GotoIf(“PJSIP/201-00000038”, “0?report”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“PJSIP/201-00000038”, “1?Set(REALCALLERIDNUM=201)”) in new stack
– Executing [s@macro-user-callerid:15] Set(“PJSIP/201-00000038”, “AMPUSER=201”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“PJSIP/201-00000038”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:17] Set(“PJSIP/201-00000038”, “AMPUSERCIDNAME=FXO1”) in new stack
– Executing [s@macro-user-callerid:18] ExecIf(“PJSIP/201-00000038”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
– Executing [s@macro-user-callerid:19] GotoIf(“PJSIP/201-00000038”, “0?report”) in new stack
– Executing [s@macro-user-callerid:20] Set(“PJSIP/201-00000038”, “AMPUSERCID=201”) in new stack
– Executing [s@macro-user-callerid:21] Set(“PJSIP/201-00000038”, “__DIAL_OPTIONS=”) in new stack
– Executing [s@macro-user-callerid:22] Set(“PJSIP/201-00000038”, “CALLERID(all)=“FXO1” <201>”) in new stack
– Executing [s@macro-user-callerid:23] ExecIf(“PJSIP/201-00000038”, “0?Set(CUSDIAL=)”) in new stack
– Executing [s@macro-user-callerid:24] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(all)=“FXO1” <201>)”) in new stack
– Executing [s@macro-user-callerid:25] GotoIf(“PJSIP/201-00000038”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:26] ExecIf(“PJSIP/201-00000038”, “1?Set(GROUP(concurrency_limit)=201)”) in new stack
– Executing [s@macro-user-callerid:27] NoOp(“PJSIP/201-00000038”, “Macro depricated!! To keep the same line numbers”) in new stack
– Executing [s@macro-user-callerid:28] NoOp(“PJSIP/201-00000038”, “Macro depricated !! To keep the same line numbers”) in new stack
– Executing [s@macro-user-callerid:29] GotoIf(“PJSIP/201-00000038”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,47)
– Executing [s@macro-user-callerid:47] Set(“PJSIP/201-00000038”, “CALLERID(number)=201”) in new stack
– Executing [s@macro-user-callerid:48] Set(“PJSIP/201-00000038”, “CALLERID(name)=FXO1”) in new stack
– Executing [s@macro-user-callerid:49] GotoIf(“PJSIP/201-00000038”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:50] Set(“PJSIP/201-00000038”, “CDR(cnam)=FXO1”) in new stack
– Executing [s@macro-user-callerid:51] Set(“PJSIP/201-00000038”, “CDR(cnum)=201”) in new stack
– Executing [s@macro-user-callerid:52] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [260747XXXX@from-internal:2] Gosub(“PJSIP/201-00000038”, “sub-record-check,s,1(out,260747XXXX,dontcare)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“PJSIP/201-00000038”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“PJSIP/201-00000038”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“PJSIP/201-00000038”, “NOW=1770134424”) in new stack
– Executing [s@sub-record-check:4] Set(“PJSIP/201-00000038”, “__DAY=03”) in new stack
– Executing [s@sub-record-check:5] Set(“PJSIP/201-00000038”, “__MONTH=02”) in new stack
– Executing [s@sub-record-check:6] Set(“PJSIP/201-00000038”, “__YEAR=2026”) in new stack
– Executing [s@sub-record-check:7] Set(“PJSIP/201-00000038”, “__TIMESTR=20260203-110024”) in new stack
– Executing [s@sub-record-check:8] Set(“PJSIP/201-00000038”, “__FROMEXTEN=201”) in new stack
– Executing [s@sub-record-check:9] Set(“PJSIP/201-00000038”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“PJSIP/201-00000038”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“PJSIP/201-00000038”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“PJSIP/201-00000038”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“PJSIP/201-00000038”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“PJSIP/201-00000038”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“PJSIP/201-00000038”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“PJSIP/201-00000038”, “Outbound Recording Check from 201 to 260747XXXX”) in new stack
– Executing [out@sub-record-check:2] Set(“PJSIP/201-00000038”, “RECMODE=dontcare”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“PJSIP/201-00000038”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“PJSIP/201-00000038”, “recordcheck,1(dontcare,out,260747XXXX)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“PJSIP/201-00000038”, “Starting recording check against dontcare”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“PJSIP/201-00000038”, “dontcare”) in new stack
– Goto (sub-record-check,recordcheck,3)
– Executing [recordcheck@sub-record-check:3] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [260747XXXX@from-internal:3] Set(“PJSIP/201-00000038”, “_ROUTEID=4”) in new stack
– Executing [260747XXXX@from-internal:4] Set(“PJSIP/201-00000038”, “_ROUTENAME=VOoIP.ms_Outbound”) in new stack
– Executing [260747XXXX@from-internal:5] Set(“PJSIP/201-00000038”, “MOHCLASS=default”) in new stack
– Executing [260747XXXX@from-internal:6] ExecIf(“PJSIP/201-00000038”, “0?Set(TRUNKCIDOVERRIDE=“MY NAME”<260387XXXX>)”) in new stack
– Executing [260747XXXX@from-internal:7] Set(“PJSIP/201-00000038”, “_CALLERIDNAMEINTERNAL=FXO1”) in new stack
– Executing [260747XXXX@from-internal:8] Set(“PJSIP/201-00000038”, “_CALLERIDNUMINTERNAL=201”) in new stack
– Executing [260747XXXX@from-internal:9] Set(“PJSIP/201-00000038”, “_EMAILNOTIFICATION=FALSE”) in new stack
– Executing [260747XXXX@from-internal:10] Set(“PJSIP/201-00000038”, “_NODEST=”) in new stack
– Executing [260747XXXX@from-internal:11] Gosub(“PJSIP/201-00000038”, “macro-dialout-trunk,s,1(2,260747XXXX,off)”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“PJSIP/201-00000038”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:3] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:4] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:5] GosubIf(“PJSIP/201-00000038”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:6] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(num)=201)”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“PJSIP/201-00000038”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:8] Set(“PJSIP/201-00000038”, “DIAL_NUMBER=260747XXXX”) in new stack
– Executing [s@macro-dialout-trunk:9] Set(“PJSIP/201-00000038”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“PJSIP/201-00000038”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:11] Set(“PJSIP/201-00000038”, “DIAL_TRUNK_OPTIONS=R”) in new stack
– Executing [s@macro-dialout-trunk:12] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_TRUNK_OPTIONS=R)”) in new stack
– Executing [s@macro-dialout-trunk:13] GotoIf(“PJSIP/201-00000038”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:14] GotoIf(“PJSIP/201-00000038”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:15] GotoIf(“PJSIP/201-00000038”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:16] Gosub(“PJSIP/201-00000038”, “macro-outbound-callerid,s,1(2)”) in new stack
– Executing [s@macro-outbound-callerid:1] NoOp(“PJSIP/201-00000038”, “201”) in new stack
– Executing [s@macro-outbound-callerid:2] NoOp(“PJSIP/201-00000038”, “”) in new stack
– Executing [s@macro-outbound-callerid:3] NoOp(“PJSIP/201-00000038”, “off”) in new stack
– Executing [s@macro-outbound-callerid:4] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:5] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:6] Set(“PJSIP/201-00000038”, “HOTDESCKCHAN=201-00000038”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“PJSIP/201-00000038”, “HOTDESKEXTEN=201”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“PJSIP/201-00000038”, “HOTDESKCALL=0”) in new stack
– Executing [s@macro-outbound-callerid:9] ExecIf(“PJSIP/201-00000038”, “0?Set(HOTDESKCALL=1)”) in new stack
– Executing [s@macro-outbound-callerid:10] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(name)=)”) in new stack
– Executing [s@macro-outbound-callerid:11] Set(“PJSIP/201-00000038”, “ALLOWTHISROUTE=NO”) in new stack
– Executing [s@macro-outbound-callerid:12] ExecIf(“PJSIP/201-00000038”, “0?Set(ALLOWTHISROUTE=YES)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“PJSIP/201-00000038”, “0?Hangup()”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“PJSIP/201-00000038”, “0?Set(REALCALLERIDNUM=201)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“PJSIP/201-00000038”, “0?Set(AMPUSER=201)”) in new stack
– Executing [s@macro-outbound-callerid:16] GotoIf(“PJSIP/201-00000038”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,20)
– Executing [s@macro-outbound-callerid:20] Set(“PJSIP/201-00000038”, “USEROUTCID=FXO1”) in new stack
– Executing [s@macro-outbound-callerid:21] Set(“PJSIP/201-00000038”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:22] ExecIf(“PJSIP/201-00000038”, “0?Set(EMERGENCYCID=)”) in new stack
– Executing [s@macro-outbound-callerid:23] Set(“PJSIP/201-00000038”, “TRUNKOUTCID=“MY NAME” <260387XXXX>”) in new stack
– Executing [s@macro-outbound-callerid:24] GotoIf(“PJSIP/201-00000038”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,30)
– Executing [s@macro-outbound-callerid:30] ExecIf(“PJSIP/201-00000038”, “1?Set(CALLERID(all)=“MY NAME” <260387XXXX>)”) in new stack
– Executing [s@macro-outbound-callerid:31] ExecIf(“PJSIP/201-00000038”, “1?Set(CALLERID(all)=FXO1)”) in new stack
– Executing [s@macro-outbound-callerid:32] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:33] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(all)=201)”) in new stack
– Executing [s@macro-outbound-callerid:34] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(all)=201)”) in new stack
– Executing [s@macro-outbound-callerid:35] Set(“PJSIP/201-00000038”, “TIOHIDE=no”) in new stack
– Executing [s@macro-outbound-callerid:36] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:37] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:38] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(name-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:39] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(num-pres)=prohib_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:40] Set(“PJSIP/201-00000038”, “CDR(outbound_cnum)=”) in new stack
– Executing [s@macro-outbound-callerid:41] Set(“PJSIP/201-00000038”, “CDR(outbound_cnam)=FXO1”) in new stack
– Executing [s@macro-outbound-callerid:42] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [s@macro-dialout-trunk:17] GosubIf(“PJSIP/201-00000038”, “0?sub-flp-2,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:18] Set(“PJSIP/201-00000038”, “OUTNUM=260747XXXX”) in new stack
– Executing [s@macro-dialout-trunk:19] Set(“PJSIP/201-00000038”, “custom=PJSIP”) in new stack
– Executing [s@macro-dialout-trunk:20] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_TRUNK_MOH=default)”) in new stack
– Executing [s@macro-dialout-trunk:21] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_TRUNK_OPTIONS=RU(macro-confirm))”) in new stack
– Executing [s@macro-dialout-trunk:22] Gosub(“PJSIP/201-00000038”, “macro-dialout-trunk-predial-hook,s,1()”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [s@macro-dialout-trunk:23] GotoIf(“PJSIP/201-00000038”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:24] ExecIf(“PJSIP/201-00000038”, “1?Set(CONNECTEDLINE(num,i)=260747XXXX)”) in new stack
– Executing [s@macro-dialout-trunk:25] ExecIf(“PJSIP/201-00000038”, “1?Set(CONNECTEDLINE(name,i)=CID:)”) in new stack
– Executing [s@macro-dialout-trunk:26] ExecIf(“PJSIP/201-00000038”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden))”) in new stack
– Executing [s@macro-dialout-trunk:27] GotoIf(“PJSIP/201-00000038”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:28] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_TRUNK_OPTIONS=R)”) in new stack
– Executing [s@macro-dialout-trunk:29] Set(“PJSIP/201-00000038”, “HASH(__SIPHEADERS,Alert-Info)=unset”) in new stack
– Executing [s@macro-dialout-trunk:30] Gosub(“PJSIP/201-00000038”, “trunk-dial-with-exten,260747XXXX,1()”) in new stack
– Executing [260747XXXX@trunk-dial-with-exten:1] Dial(“PJSIP/201-00000038”, “PJSIP/[email protected],300,Rb(func-apply-sipheaders^s^1,(2))U(sub-send-obroute-email^260747XXXX^^2^1770134424^FXO1^,^)”) in new stack
– PJSIP/VoIP.ms-00000039 Internal Gosub(func-apply-sipheaders,s,1(2)) start
– Executing [s@func-apply-sipheaders:1] NoOp(“PJSIP/VoIP.ms-00000039”, “Applying SIP Headers to channel PJSIP/VoIP.ms-00000039”) in new stack
– Executing [s@func-apply-sipheaders:2] Set(“PJSIP/VoIP.ms-00000039”, “Dchan=VoIP.ms-00000039”) in new stack
– Executing [s@func-apply-sipheaders:3] Set(“PJSIP/VoIP.ms-00000039”, “TECH=PJSIP”) in new stack
– Executing [s@func-apply-sipheaders:4] Set(“PJSIP/VoIP.ms-00000039”, “SIPHEADERKEYS=Alert-Info”) in new stack
– Executing [s@func-apply-sipheaders:5] While(“PJSIP/VoIP.ms-00000039”, “1”) in new stack
– Executing [s@func-apply-sipheaders:6] Set(“PJSIP/VoIP.ms-00000039”, “sipheader=unset”) in new stack
– Executing [s@func-apply-sipheaders:7] ExecIf(“PJSIP/VoIP.ms-00000039”, “1?Set(PJSIP_HEADER(remove,Alert-Info)=)”) in new stack
[Feb 3 11:00:24] ERROR[1787]: res_pjsip_header_funcs.c:739 remove_header: No headers had been previously added to this session.
– Executing [s@func-apply-sipheaders:8] ExecIf(“PJSIP/VoIP.ms-00000039”, “0?Set(sipheader=http://127.0.0.1;info=unset)”) in new stack
– Executing [s@func-apply-sipheaders:9] ExecIf(“PJSIP/VoIP.ms-00000039”, “0?Set(sipheader=http://127.0.0.1unset)”) in new stack
– Executing [s@func-apply-sipheaders:10] ExecIf(“PJSIP/VoIP.ms-00000039”, “0?Set(PJSIP_HEADER(add,Alert-Info)=unset)”) in new stack
– Executing [s@func-apply-sipheaders:11] EndWhile(“PJSIP/VoIP.ms-00000039”, “”) in new stack
– Executing [s@func-apply-sipheaders:5] While(“PJSIP/VoIP.ms-00000039”, “0”) in new stack
– Executing [s@func-apply-sipheaders:12] Return(“PJSIP/VoIP.ms-00000039”, “”) in new stack
== Spawn extension (from-pstn, 260747XXXX, 1) exited non-zero on ‘PJSIP/VoIP.ms-00000039’
– PJSIP/VoIP.ms-00000039 Internal Gosub(func-apply-sipheaders,s,1(2)) complete GOSUB_RETVAL=
– Called PJSIP/[email protected]
== Everyone is busy/congested at this time (1:0/1/0)
– Executing [260747XXXX@trunk-dial-with-exten:2] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [s@macro-dialout-trunk:31] NoOp(“PJSIP/201-00000038”, “Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 34”) in new stack
– Executing [s@macro-dialout-trunk:32] GotoIf(“PJSIP/201-00000038”, “0?continue,1:s-CONGESTION,1”) in new stack
– Goto (macro-dialout-trunk,s-CONGESTION,1)
– Executing [s-CONGESTION@macro-dialout-trunk:1] Set(“PJSIP/201-00000038”, “RC=34”) in new stack
– Executing [s-CONGESTION@macro-dialout-trunk:2] Goto(“PJSIP/201-00000038”, “34,1”) in new stack
– Goto (macro-dialout-trunk,34,1)
– Executing [34@macro-dialout-trunk:1] Goto(“PJSIP/201-00000038”, “continue,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“PJSIP/201-00000038”, “TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 34 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] ExecIf(“PJSIP/201-00000038”, “1?Set(CALLERID(number)=201)”) in new stack
– Executing [continue@macro-dialout-trunk:3] Return(“PJSIP/201-00000038”, “”) in new stack
– Executing [260747XXXX@from-internal:12] Gosub(“PJSIP/201-00000038”, “macro-dialout-trunk,s,1(1,260747XXXX,off)”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“PJSIP/201-00000038”, “DIAL_TRUNK=1”) in new stack
– Executing [s@macro-dialout-trunk:2] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:3] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:4] ExecIf(“PJSIP/201-00000038”, “0?Set(DIAL_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:5] GosubIf(“PJSIP/201-00000038”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:6] ExecIf(“PJSIP/201-00000038”, “0?Set(CALLERID(num)=201)”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“PJSIP/201-00000038”, “1?disabletrunk,1”) in new stack
– Goto (macro-dialout-trunk,disabletrunk,1)
– Executing [disabletrunk@macro-dialout-trunk:1] NoOp(“PJSIP/201-00000038”, “TRUNK: PJSIP DISABLED - falling through to next trunk”) in new stack
– Auto fallthrough, channel ‘PJSIP/201-00000038’ status is ‘CONGESTION’
– Executing [h@macro-dialout-trunk:1] Gosub(“PJSIP/201-00000038”, “macro-hangupcall,s,1()”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“PJSIP/201-00000038”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [s@macro-hangupcall:3] ExecIf(“PJSIP/201-00000038”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [s@macro-hangupcall:4] Hangup(“PJSIP/201-00000038”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘PJSIP/201-00000038’
RasPBX*CLI>

So did you get Twilio working ? We just set up several clients with it. The very first one took me 20 hours of tinkering because it seems like the guide was missing some info (or made assumptions of what you need to do). Now that I know what to do I can set up a trunk and get it running on a FreePBX in about 10 minutes. I can walk you through it if you need.

For Outbound calling, an “all circuits are busy” …. In twilio, there is a really good “logs” section. If you did not know, you can go into the trunk and then switch to the “monitor” tab at the top left menu, go to logs, then errors, as well as the call logs. Depending on what your problem is, the error logs have a lot of details that are helpful.

Just FYI :

  1. any outbound call through twilio has to be in the format ‘+1xxxxxxxxxx’ (assuming you are in the USA) That can be added in the “Dial Patterns” in the outbound route, or “Dial Number Manipulation Rules” in trunks. If you miss the +1, you get the all circuits are busy.

  2. Any caller ID number you are pushing out, has to be part of your active numbers, or you have to have used the “verified caller ID” tool (menu option) to add that caller ID to your account.

Twilio’s logs are not showing any outgoing calls at all. I see my bad login information (I was originally missing the Originating URI) but no out going in the logs.

  1. Dial patterns are the suggested ones from the wizard. I’ve tried many combinations of + or +1 nothing seems to work.
  2. Caller ID matches the active numbers on the trunk.

for simplicity sake, I have disabled the VoIP.ms trunk. Now I get “we’re sorry you call can’t be completed as dialed” when I dial xxx-xxx-xxxx if I dial 1-xxx-xxx-xxxx it gives me a fast busy signal.

I am going to put in a ticket with Twilio to see if they have any suggestions since their setup guide is what I used.

Are you in the USA, dialing USA numbers ? that + sign out front is not optional if you are. Several other things too (from-pstn-e164-us, RFC 4733)

This is our setup for Twilio :

Trunk :

  • General Tab :
    • Trunk Name : OurTrunkName
    • Outbound CallerID : +1nnnnnnnnnn (actual account phone number)
  • PJSIP Settings GENERAL Tab :
    • username : (username)
    • Secret : (stupid long secret password)
    • Authentication : Outbound
    • Registration : None
    • Sip Server : billyblahblay.pstn.region.twilio.com
    • Port : 5060
    • Context : from-pstn-e164-us
  • PJSIP Settings ADVANCED Tab :
    • DTMF Mode : RFC 4733

Outbound Route :

  • Route Settings Tab :
    • Route Name : Silly giggle route
    • Trunk Sequence for Matched Routes : OurTrunkName
  • Dial Patterns Tab :
    • Prepend | Prefix "

      Prepend Prefix Match Pattern
      +1NXXNXXXXXX
      + 1NXXNXXXXXX
      +1 NXXNXXXXXX
      +1808 NXXXXXX

With this setup all calls are working. Each extension can also show their own caller ID if you want, but each of those also needs to include the +1 and be registered with twilio

review what you have and let me know, I can give more info or help troubleshoot if necessary

I am in the USA, Those dial patterns are what I need. I have changed all settings as you suggested. No change. I changed the trunk sequence to include the two twilio trunks first, then voip.ms.
if I dial xxx-xxxx. xxx-xxx-xxxx or 1-xxx-xxx-xxxx
Still all circuits are busy now.

I was so frustrated when I could not connect to twilio I have a bunch of redundant entries that I need to clear out first before diving deeper. I am going to put in a help ticket with them to get all the excess settings cleared out, hopefully that will make a difference.

Please turn on pjsip logger, make a test call to 1 800 437 7950 and post the sip trace here. The Asterisk log is not needed.

If you want, I can take a look at your setup. even a single incorrect entry will give you that same problem. we struggled with it on another provider for almost 2 years. In setting up Twilio, it isa now working perfectly.

Assuming you know that “billyblahblah” is a fake name I put in and you need to change the whole thing to your trunk, and as well the 808 is the Hawaii area code and you need to put in your own area code.

Whenever we can set something up that’d be great. Teams is what I have available, I’d let you poke around as you please.

I’m done. I deleted Twilio since they are unable to help me.

I appreciate the offer, but I’m moving on to another provider at this point.

HI.

Sorry ! I thought I responded !

I can make time do set you up tonight, tomorrow. let me know when. Seriously this should only take like 20 minutes. We use their service on 12 sites at this point. I will message you my contact info.

Twilio is a done deal, the account is closed and the refund has been processed. I really appreciate your offer! I ended up wiping my Pi and doing a fresh install (takes forever but went well)

I’m working with VoIP.ms today I managed to get incoming and outgoing calls working (turns out their outgoing caller ID is VERY specific).

My next task is to figure out how to setup FXO ports as trunk backups (or primary since I have a location with POTS only) I have a bunch of reading to do before I can even start on that part.

Again thank you for your offer. I may bug you again.

Little FYI, there’s 808-988-xxxx so that conflicts with 988 dialing. You’re supposed to send 988 to the hotline which means per the FCC you shouldn’t be accepting 7 digits.

Sorry, can you elaborate ? So there is a 988 like 911 ? (I just looked it up, never knew that existed) So, you are saying that we need to accept 3 digit dialing as well, and not just for 911 ? is there a list of all mandated dialing patterns someplace you can point me to ?

Sure, in 2020 the FCC created 988 for a nationwide suicide hotline to replace the toll free number that was in use. Because of that and the fact there were still numerous NPA’s that had no overlays which still facilitated 7 digit dialing there would be a conflict. So the FCC rules that 7 digit dialing needed to be gone in those areas. Everyone was given until July 2022 to make these changes happen.

Yes, 988 is now like 911. As for the other N11’s, they are non-emergency, not required and are overlays for existing local numbers as such they would need to be routed based on their region/areas which is why a lot of VoIP providers do not support them.

  • 211 - Community services
  • 311 - Municipal Government
  • 411 - Directory assistance
  • 511 - Traffic Info
  • 611 - Telecom repair
  • 711 - TDD
  • 811 - Underground Utility

The whole 988 compliance was during the same time frame of 911 compliance. You’ve done that 911 compliance at least right?

Sorry, what is that ? Too many abbreviations used in these industries.

So, no one is permitted to use 7 digits to dial ? or instead we need to accommodate for 3 digit dialing as well ?

Yes -I assume. AS of now all systems can dial 911 in various forms. SipStation/Sangoma auto generated the routes when we recently installed, and it is the first items in the outbound routes.

Do you have a link to that so I can verify its requirements

If this was is an FCC requirement of outbound calling, then Why is it that SipStation / Sangoma creates a 911 emergency route with variations, but then does not create 988 routes with its variations ?

I am sure I am not alone when I say I had no idea that 988 even existed. I know about a number of the other n11 series as we work with some of them locally

Numbering Plan Area aka Area Code

In most areas there are overlays which requires 10 digit dialing already. When 988 was introduced there were still around a hundred NPA’s that didn’t have overlays so they were still allowed to us 7 digit dialing. The majority of those NPA’s had the 988 exchange which would be in conflict with 988 alone. As I said the other N11 numbers are optional.

There should be no prefix requirements to dial 911. As well, you need to send alerts when 911 is dialled along with proper dispatch locations. So in those facilities where you have a 100 residents, each with a phone in their rooms, you need 100 registered locations that have the exact location of the phone being used (i.e. APT 201 FL 2) when sending the call to 911.

You have alerts and dispatchable locations registered?