Inconsistent outbound calls through PJSIP trunk

Hi guys,

I have discovered by accident that I no longer can use PJSIP trunk as an outbound! This trunk is at Telnyx.

I have another trunk set as a SIP and it works OK.

The system is v15 with latest patches as of today. Went back to a week in VM snapshots - same issue, rebooted network, temporally modified firewall to allow SIP connections from all external IP’s, no luck.

Here is the asterisk -rvvv output when live call placed:
ERROR[3933]: res_pjsip_header_funcs.c:410 remove_header: No headers had been previously added to this session.

Connected to Asterisk 13.38.3 currently running on freepbx (pid = 3878)
== Setting global variable ‘SIPDOMAIN’ to '10.100.20.2 my ’
== Using SIP RTP Audio TOS bits 184
== Using SIP RTP Audio CoS mark 5
– Executing [external CID@from-internal:1] Macro(“PJSIP/100-0000000d”, “user-callerid,LIMIT,EXTERNAL,”) in n ew stack
– Executing [s@macro-user-callerid:1] Set(“PJSIP/100-0000000d”, “TOUCH_MONITOR=1650830075.18”) in new stac k
– Executing [s@macro-user-callerid:2] Set(“PJSIP/100-0000000d”, “CHANCONTEXT=”) in new stack
– Executing [s@macro-user-callerid:3] Set(“PJSIP/100-0000000d”, “CHANCONTEXT=”) in new stack
– Executing [s@macro-user-callerid:4] Set(“PJSIP/100-0000000d”, “CHANEXTENCONTEXT=100-0000000d”) in new st ack
– Executing [s@macro-user-callerid:5] Set(“PJSIP/100-0000000d”, “CHANEXTEN=100-0000000d”) in new stack
– Executing [s@macro-user-callerid:6] Set(“PJSIP/100-0000000d”, “CALLERID(number)=100”) in new stack
– Executing [s@macro-user-callerid:7] Set(“PJSIP/100-0000000d”, “AMPUSER=100”) in new stack
– Executing [s@macro-user-callerid:8] Set(“PJSIP/100-0000000d”, “HOTDESCKCHAN=100-0000000d”) in new stack
– Executing [s@macro-user-callerid:9] Set(“PJSIP/100-0000000d”, “HOTDESKEXTEN=100”) in new stack
– Executing [s@macro-user-callerid:10] Set(“PJSIP/100-0000000d”, “HOTDESKCALL=0”) in new stack
– Executing [s@macro-user-callerid:11] ExecIf(“PJSIP/100-0000000d”, “0?Set(HOTDESKCALL=1)”) in new stack
– Executing [s@macro-user-callerid:12] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(name)=)”) in new stack
– Executing [s@macro-user-callerid:13] GotoIf(“PJSIP/100-0000000d”, “0?report”) in new stack
– Executing [s@macro-user-callerid:14] ExecIf(“PJSIP/100-0000000d”, “1?Set(REALCALLERIDNUM=100)”) in new s tack
– Executing [s@macro-user-callerid:15] Set(“PJSIP/100-0000000d”, “AMPUSER=100”) in new stack
– Executing [s@macro-user-callerid:16] GotoIf(“PJSIP/100-0000000d”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:17] Set(“PJSIP/100-0000000d”, “AMPUSERCIDNAME=Name”) in new stack
– Executing [s@macro-user-callerid:18] ExecIf(“PJSIP/100-0000000d”, “0?Set(__CIDMASQUERADING=TRUE)”) in ne w stack
– Executing [s@macro-user-callerid:19] GotoIf(“PJSIP/100-0000000d”, “0?report”) in new stack
– Executing [s@macro-user-callerid:20] Set(“PJSIP/100-0000000d”, “AMPUSERCID=100”) in new stack
– Executing [s@macro-user-callerid:21] Set(“PJSIP/100-0000000d”, “__DIAL_OPTIONS=HhTtr”) in new stack
– Executing [s@macro-user-callerid:22] Set(“PJSIP/100-0000000d”, “CALLERID(all)=“Name” <100>”) in new stack
– Executing [s@macro-user-callerid:23] ExecIf(“PJSIP/100-0000000d”, “0?Set(CUSDIAL=)”) in new stack
– Executing [s@macro-user-callerid:24] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(all)=“Name” <100>)”) in new stack
– Executing [s@macro-user-callerid:25] GotoIf(“PJSIP/100-0000000d”, “0?limit”) in new stack
– Executing [s@macro-user-callerid:26] ExecIf(“PJSIP/100-0000000d”, “1?Set(GROUP(concurrency_limit)=100)”) in new stack
– Executing [s@macro-user-callerid:27] ExecIf(“PJSIP/100-0000000d”, “0?Set(CHANNEL(language)=)”) in new st ack
– Executing [s@macro-user-callerid:28] NoOp(“PJSIP/100-0000000d”, “Macro Depth is 1”) in new stack
– Executing [s@macro-user-callerid:29] GotoIf(“PJSIP/100-0000000d”, “1?report2:macroerror”) in new stack
– Goto (macro-user-callerid,s,30)
– Executing [s@macro-user-callerid:30] GotoIf(“PJSIP/100-0000000d”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,49)
– Executing [s@macro-user-callerid:49] Set(“PJSIP/100-0000000d”, “CALLERID(number)=100”) in new stack
– Executing [s@macro-user-callerid:50] Set(“PJSIP/100-0000000d”, “CALLERID(name)=Name”) in new stack
– Executing [s@macro-user-callerid:51] GotoIf(“PJSIP/100-0000000d”, “0?cnum”) in new stack
– Executing [s@macro-user-callerid:52] Set(“PJSIP/100-0000000d”, “CDR(cnam)=Name”) in new stack
– Executing [s@macro-user-callerid:53] Set(“PJSIP/100-0000000d”, “CDR(cnum)=100”) in new stack
– Executing [s@macro-user-callerid:54] Set(“PJSIP/100-0000000d”, “CHANNEL(language)=en”) in new stack
– Executing [external CID@from-internal:2] Gosub(“PJSIP/100-0000000d”, “sub-record-check,s,1(out,external CID, never)”) in new stack
– Executing [s@sub-record-check:1] GotoIf(“PJSIP/100-0000000d”, “0?initialized”) in new stack
– Executing [s@sub-record-check:2] Set(“PJSIP/100-0000000d”, “__REC_STATUS=INITIALIZED”) in new stack
– Executing [s@sub-record-check:3] Set(“PJSIP/100-0000000d”, “NOW=1650830075”) in new stack
– Executing [s@sub-record-check:4] Set(“PJSIP/100-0000000d”, “__DAY=24”) in new stack
– Executing [s@sub-record-check:5] Set(“PJSIP/100-0000000d”, “__MONTH=04”) in new stack
– Executing [s@sub-record-check:6] Set(“PJSIP/100-0000000d”, “__YEAR=2022”) in new stack
– Executing [s@sub-record-check:7] Set(“PJSIP/100-0000000d”, “__TIMESTR=20220424-125435”) in new stack
– Executing [s@sub-record-check:8] Set(“PJSIP/100-0000000d”, “__FROMEXTEN=100”) in new stack
– Executing [s@sub-record-check:9] Set(“PJSIP/100-0000000d”, “__MON_FMT=wav”) in new stack
– Executing [s@sub-record-check:10] NoOp(“PJSIP/100-0000000d”, “Recordings initialized”) in new stack
– Executing [s@sub-record-check:11] ExecIf(“PJSIP/100-0000000d”, “0?Set(ARG3=dontcare)”) in new stack
– Executing [s@sub-record-check:12] Set(“PJSIP/100-0000000d”, “REC_POLICY_MODE_SAVE=”) in new stack
– Executing [s@sub-record-check:13] ExecIf(“PJSIP/100-0000000d”, “0?Set(REC_STATUS=NO)”) in new stack
– Executing [s@sub-record-check:14] GotoIf(“PJSIP/100-0000000d”, “3?checkaction”) in new stack
– Goto (sub-record-check,s,17)
– Executing [s@sub-record-check:17] GotoIf(“PJSIP/100-0000000d”, “1?sub-record-check,out,1”) in new stack
– Goto (sub-record-check,out,1)
– Executing [out@sub-record-check:1] NoOp(“PJSIP/100-0000000d”, “Outbound Recording Check from 100 to 4088 914536”) in new stack
– Executing [out@sub-record-check:2] Set(“PJSIP/100-0000000d”, “RECMODE=never”) in new stack
– Executing [out@sub-record-check:3] ExecIf(“PJSIP/100-0000000d”, “0?Goto(routewins)”) in new stack
– Executing [out@sub-record-check:4] ExecIf(“PJSIP/100-0000000d”, “1?Goto(routewins)”) in new stack
– Goto (sub-record-check,out,7)
– Executing [out@sub-record-check:7] Gosub(“PJSIP/100-0000000d”, “recordcheck,1(never,out,external CID)”) in new stack
– Executing [recordcheck@sub-record-check:1] NoOp(“PJSIP/100-0000000d”, “Starting recording check against never”) in new stack
– Executing [recordcheck@sub-record-check:2] Goto(“PJSIP/100-0000000d”, “never”) in new stack
– Goto (sub-record-check,recordcheck,14)
– Executing [recordcheck@sub-record-check:14] Set(“PJSIP/100-0000000d”, “__REC_POLICY_MODE=NEVER”) in new stack
– Executing [recordcheck@sub-record-check:15] Goto(“PJSIP/100-0000000d”, “stoprec”) in new stack
– Goto (sub-record-check,recordcheck,24)
– Executing [recordcheck@sub-record-check:24] NoOp(“PJSIP/100-0000000d”, “Stopping recording: out, 4088914 536”) in new stack
– Executing [recordcheck@sub-record-check:25] Set(“PJSIP/100-0000000d”, “__REC_STATUS=STOPPED”) in new sta ck
– Executing [recordcheck@sub-record-check:26] System(“PJSIP/100-0000000d”, “/var/lib/asterisk/bin/stopreco rding.php “PJSIP/100-0000000d””) in new stack
– Executing [recordcheck@sub-record-check:27] Return(“PJSIP/100-0000000d”, “”) in new stack
– Executing [out@sub-record-check:8] Return(“PJSIP/100-0000000d”, “”) in new stack
– Executing [external CID@from-internal:3] ExecIf(“PJSIP/100-0000000d”, “0 ?Set(CDR(accountcode)=)”) in new stack
– Executing [external CID@from-internal:4] Set(“PJSIP/100-0000000d”, “_ROUTEID=5”) in new stack
– Executing [external CID@from-internal:5] Set(“PJSIP/100-0000000d”, “_ROUTENAME=Telnyx”) in new stack
– Executing [external CID@from-internal:6] Set(“PJSIP/100-0000000d”, “EMERGENCYROUTE=YES”) in new stack
– Executing [external CID@from-internal:7] Set(“PJSIP/100-0000000d”, “MOHCLASS=default”) in new stack
– Executing [external CID@from-internal:8] ExecIf(“PJSIP/100-0000000d”, “1?Set(TRUNKCIDOVERRIDE=my trunk CID)” ) in new stack
– Executing [external CID@from-internal:9] Set(“PJSIP/100-0000000d”, “_CALLERIDNAMEINTERNAL=Name”) in new sta ck
– Executing [external CID@from-internal:10] Set(“PJSIP/100-0000000d”, “_CALLERIDNUMINTERNAL=100”) in new sta ck
– Executing [external CID@from-internal:11] Set(“PJSIP/100-0000000d”, “_EMAILNOTIFICATION=FALSE”) in new sta ck
– Executing [external CID@from-internal:12] Set(“PJSIP/100-0000000d”, “_NODEST=”) in new stack
– Executing [external CID@from-internal:13] Macro(“PJSIP/100-0000000d”, “dialout-trunk,3,external CID,off”) i n new stack
– Executing [s@macro-dialout-trunk:1] Set(“PJSIP/100-0000000d”, “DIAL_TRUNK=3”) in new stack
– Executing [s@macro-dialout-trunk:2] ExecIf(“PJSIP/100-0000000d”, “0?Set(DIAL_OPTIONS=Hhtr)”) in new stac k
– Executing [s@macro-dialout-trunk:3] GosubIf(“PJSIP/100-0000000d”, “0?sub-pincheck,s,1()”) in new stack
– Executing [s@macro-dialout-trunk:4] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(num)=100)”) in new stac k
– Executing [s@macro-dialout-trunk:5] GotoIf(“PJSIP/100-0000000d”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“PJSIP/100-0000000d”, “DIAL_NUMBER=external CID”) in new stack
– Executing [s@macro-dialout-trunk:7] Set(“PJSIP/100-0000000d”, “DIAL_TRUNK_OPTIONS=HhTtr”) in new stack
– Executing [s@macro-dialout-trunk:8] Set(“PJSIP/100-0000000d”, “OUTBOUND_GROUP=OUT_3”) in new stack
– Executing [s@macro-dialout-trunk:9] Set(“PJSIP/100-0000000d”, “DIAL_TRUNK_OPTIONS=T”) in new stack
– Executing [s@macro-dialout-trunk:10] GotoIf(“PJSIP/100-0000000d”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:11] GotoIf(“PJSIP/100-0000000d”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:12] GotoIf(“PJSIP/100-0000000d”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:13] Macro(“PJSIP/100-0000000d”, “outbound-callerid,3”) in new stack
– Executing [s@macro-outbound-callerid:1] NoOp(“PJSIP/100-0000000d”, “100”) in new stack
– Executing [s@macro-outbound-callerid:2] NoOp(“PJSIP/100-0000000d”, “”) in new stack
– Executing [s@macro-outbound-callerid:3] NoOp(“PJSIP/100-0000000d”, “on”) in new stack
– Executing [s@macro-outbound-callerid:4] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERPRES(name-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:5] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERPRES(num-pres)=)”) in new stack
– Executing [s@macro-outbound-callerid:6] Set(“PJSIP/100-0000000d”, “HOTDESCKCHAN=100-0000000d”) in new st ack
– Executing [s@macro-outbound-callerid:7] Set(“PJSIP/100-0000000d”, “HOTDESKEXTEN=100”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“PJSIP/100-0000000d”, “HOTDESKCALL=0”) in new stack
– Executing [s@macro-outbound-callerid:9] ExecIf(“PJSIP/100-0000000d”, “0?Set(HOTDESKCALL=1)”) in new stac k
– Executing [s@macro-outbound-callerid:10] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(name)=)”) in new s tack
– Executing [s@macro-outbound-callerid:11] Set(“PJSIP/100-0000000d”, “ALLOWTHISROUTE=NO”) in new stack
– Executing [s@macro-outbound-callerid:12] ExecIf(“PJSIP/100-0000000d”, “1?Set(ALLOWTHISROUTE=YES)”) in ne w stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“PJSIP/100-0000000d”, “0?Hangup()”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“PJSIP/100-0000000d”, “0?Set(REALCALLERIDNUM=100)”) in n ew stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“PJSIP/100-0000000d”, “0?Set(AMPUSER=100)”) in new stack
– Executing [s@macro-outbound-callerid:16] GotoIf(“PJSIP/100-0000000d”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,20)
– Executing [s@macro-outbound-callerid:20] Set(“PJSIP/100-0000000d”, “USEROUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:21] Set(“PJSIP/100-0000000d”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:22] ExecIf(“PJSIP/100-0000000d”, “0?Set(EMERGENCYCID=)”) in new sta ck
– Executing [s@macro-outbound-callerid:23] Set(“PJSIP/100-0000000d”, “TRUNKOUTCID=my trunk CID”) in new stac k
– Executing [s@macro-outbound-callerid:24] GotoIf(“PJSIP/100-0000000d”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,30)
– Executing [s@macro-outbound-callerid:30] ExecIf(“PJSIP/100-0000000d”, “1?Set(CALLERID(all)=my trunk CID)”) in new stack
– Executing [s@macro-outbound-callerid:31] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(all)=)”) in new st ack
– Executing [s@macro-outbound-callerid:32] ExecIf(“PJSIP/100-0000000d”, “1?Set(CALLERID(all)=my trunk CID)”) in new stack
– Executing [s@macro-outbound-callerid:33] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(all)=100)”) in new stack
– Executing [s@macro-outbound-callerid:34] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERID(all)=100)”) in new stack
– Executing [s@macro-outbound-callerid:35] Set(“PJSIP/100-0000000d”, “TIOHIDE=no”) in new stack
– Executing [s@macro-outbound-callerid:36] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERPRES(name-pres)=prohi b_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:37] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERPRES(num-pres)=prohib _passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:38] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERPRES(name-pres)=prohi b_passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:39] ExecIf(“PJSIP/100-0000000d”, “0?Set(CALLERPRES(num-pres)=prohib _passed_screen)”) in new stack
– Executing [s@macro-outbound-callerid:40] Set(“PJSIP/100-0000000d”, “CDR(outbound_cnum)=my trunk CID”) in n ew stack
– Executing [s@macro-outbound-callerid:41] Set(“PJSIP/100-0000000d”, “CDR(outbound_cnam)=”) in new stack
– Executing [s@macro-dialout-trunk:14] GosubIf(“PJSIP/100-0000000d”, “1?sub-flp-3,s,1()”) in new stack
– Executing [s@sub-flp-3:1] ExecIf(“PJSIP/100-0000000d”, “0?Return()”) in new stack
– Executing [s@sub-flp-3:2] ExecIf(“PJSIP/100-0000000d”, “1?Return()”) in new stack
– Executing [s@macro-dialout-trunk:15] Set(“PJSIP/100-0000000d”, “OUTNUM=external CID”) in new stack
– Executing [s@macro-dialout-trunk:16] Set(“PJSIP/100-0000000d”, “custom=PJSIP”) in new stack
– Executing [s@macro-dialout-trunk:17] ExecIf(“PJSIP/100-0000000d”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^d efault)T)”) in new stack
– Executing [s@macro-dialout-trunk:18] ExecIf(“PJSIP/100-0000000d”, "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm)) ") in new stack
– Executing [s@macro-dialout-trunk:19] Macro(“PJSIP/100-0000000d”, “dialout-trunk-predial-hook,”) in new s tack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“PJSIP/100-0000000d”, “”) in new stack
– Executing [s@macro-dialout-trunk:20] GotoIf(“PJSIP/100-0000000d”, “0?skipcrm”) in new stack
– Executing [s@macro-dialout-trunk:21] Set(“PJSIP/100-0000000d”, “__CRM_DIRECTION=OUTBOUND”) in new stack
– Executing [s@macro-dialout-trunk:22] Set(“PJSIP/100-0000000d”, “__CRM_DESTINATION=external CID”) in new st ack
– Executing [s@macro-dialout-trunk:23] Set(“PJSIP/100-0000000d”, “__CRM_SOURCE=100”) in new stack
– Executing [s@macro-dialout-trunk:24] AGI(“PJSIP/100-0000000d”, “sangomacrm.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/sangomacrm.agi
– <PJSIP/100-0000000d>AGI Script sangomacrm.agi completed, returning 0
– Executing [s@macro-dialout-trunk:25] Set(“PJSIP/100-0000000d”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
– Executing [s@macro-dialout-trunk:26] NoOp(“PJSIP/100-0000000d”, “CRM Finished”) in new stack
– Executing [s@macro-dialout-trunk:27] GotoIf(“PJSIP/100-0000000d”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:28] ExecIf(“PJSIP/100-0000000d”, “1?Set(CONNECTEDLINE(num,i)=external CID)”) in new stack
– Executing [s@macro-dialout-trunk:29] ExecIf(“PJSIP/100-0000000d”, “1?Set(CONNECTEDLINE(name,i)=CID:my trunk CID)”) in new stack
– Executing [s@macro-dialout-trunk:30] ExecIf(“PJSIP/100-0000000d”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)my trunk CID)”) in new stack
– Executing [s@macro-dialout-trunk:31] GotoIf(“PJSIP/100-0000000d”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:32] ExecIf(“PJSIP/100-0000000d”, “0?Set(DIAL_TRUNK_OPTIONS=)”) in new stack
– Executing [s@macro-dialout-trunk:33] Set(“PJSIP/100-0000000d”, “HASH(__SIPHEADERS,Alert-Info)=unset”) in new stack
– Executing [s@macro-dialout-trunk:34] Dial(“PJSIP/100-0000000d”, “PJSIP/external CID@telnyx,300,Tb(func-apply-sipheaders^s^1,(3))U(sub-send-obroute-email^external CID^external CID^3^1650830075^^my trunk CID)”) in new stack
– PJSIP/telnyx-0000000e Internal Gosub(func-apply-sipheaders,s,1(3)) start
– Executing [s@func-apply-sipheaders:1] ExecIf(“PJSIP/telnyx-0000000e”, “0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)”) in new stack
– Executing [s@func-apply-sipheaders:2] NoOp(“PJSIP/telnyx-0000000e”, “Applying SIP Headers to channel PJSIP/telnyx-0000000e”) in new stack
– Executing [s@func-apply-sipheaders:3] Set(“PJSIP/telnyx-0000000e”, “TECH=PJSIP”) in new stack
– Executing [s@func-apply-sipheaders:4] Set(“PJSIP/telnyx-0000000e”, “SIPHEADERKEYS=Alert-Info”) in new stack
– Executing [s@func-apply-sipheaders:5] While(“PJSIP/telnyx-0000000e”, “1”) in new stack
– Executing [s@func-apply-sipheaders:6] Set(“PJSIP/telnyx-0000000e”, “sipheader=unset”) in new stack
– Executing [s@func-apply-sipheaders:7] ExecIf(“PJSIP/telnyx-0000000e”, “0?SIPRemoveHeader(Alert-Info:)”) in new stack
– Executing [s@func-apply-sipheaders:8] ExecIf(“PJSIP/telnyx-0000000e”, “1?Set(PJSIP_HEADER(remove,Alert-Info)=)”) in new stack
[2022-04-24 12:54:36] ERROR[3933]: res_pjsip_header_funcs.c:410 remove_header: No headers had been previously added to this session.
– Executing [s@func-apply-sipheaders:9] ExecIf(“PJSIP/telnyx-0000000e”, “0?Set(sipheader=http://127.0.0.1;info=unset)”) in new stack
– Executing [s@func-apply-sipheaders:10] ExecIf(“PJSIP/telnyx-0000000e”, “0?Set(sipheader=http://127.0.0.1unset)”) in new stack
– Executing [s@func-apply-sipheaders:11] ExecIf(“PJSIP/telnyx-0000000e”, “0?SIPAddHeader(Alert-Info:unset)”) in new stack
– Executing [s@func-apply-sipheaders:12] ExecIf(“PJSIP/telnyx-0000000e”, “0?Set(PJSIP_HEADER(add,Alert-Info)=unset)”) in new stack
– Executing [s@func-apply-sipheaders:13] EndWhile(“PJSIP/telnyx-0000000e”, “”) in new stack
– Executing [s@func-apply-sipheaders:5] While(“PJSIP/telnyx-0000000e”, “0”) in new stack
– Executing [s@func-apply-sipheaders:14] Return(“PJSIP/telnyx-0000000e”, “”) in new stack
== Spawn extension (from-pstn, external CID, 1) exited non-zero on ‘PJSIP/telnyx-0000000e’
– PJSIP/telnyx-0000000e Internal Gosub(func-apply-sipheaders,s,1(3)) complete GOSUB_RETVAL=

This is an artefact introduced by FreePBX, and not a real error.

You need to enable protocol logging, with CLI: pjsip set logger on, to be able to understand why the call is failing.

Ok, gotcha. I’ll update later today.

I ran sngrep utill along with normal pjsip logging and found these interesting records in the SIP packets:

SIP/2.0 200 Keepalive
SIP/2.0 407 Proxy Authentication Required
SIP/2.0 100 (extension I think) Telnyx trying
SIP/2.0 401 Unauthorized

Does it mean my credentials are bad?

Let me know if you need a full packet output.

Update: It might be that my account is locked, lost MFA method. Working with support to recover access. But if you have any clue, please let me know.

No. You didn’t show a complete SIP trace, but authorization is required and you provided nothing. Asterisk is challenging you and that is the normal behavior (in most cases). You should post a complete SIP trace of the SIP dialog.

Ok,
I will post tomorrow, it’s too late here. Something strange happened with my system. It seems now it affected only PJSIP trunks. Sometimes I can call out with PJSIP trunks.
When failing it says “the number is not answering”
I confirmed that my external trunk is fine as are credentials.

My trunk setup:

They have asked you to authenticate yourself, but then started ignoring you. Maybe they have blacklisted you?

If the obfuscated address was a private address, there was little point in obfuscating it. If it wasn’t, that will be part of your problem. I’m assuming that the 192… address is for equipment provided by Telnyx.

Yes, blurred ones are private of mine, 192 is their SIP.
Another thing is. It sometimes works. I suspect issue on my end. I have 2nd PJSIP trunk with exact behavior, so when it works both are working.

You’ve enabled video codecs h264 and mpeg4, that is not correct for Telnyx.

Ok, not sure how it happened. I will disable to test.

Here are the screenshots of the packets flow captured by sngrep:





So far so good after disabling those video codecs…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.