"All circuits are busy now" with SIP 403 Forbidden

Hi! I’m having trouble and I can’t solve it…

This is an outgoing call to a mobile phone (inbound call works well).

The calling phone is extension 200, an analog phone, and it’s calling number 911234567 (that’s what you see in the log below, I obfuscated that a bit).
It connects to a Grandstream FXS Gateway, 10.0.0.2
That connects to FreePBX (10.0.0.10).
FreePBX sends it (correctly) on an OutboundRouteExterna, an outbound trunk to the phone company, where our number (after obfuscation) is 211234567
That route connects to a Grandstream FXO Gateway (10.0.0.3), which connects to the company line.

It’s failing with “all circuits are busy now”, and in the PJSIP trace I see that final gateway returning a “403 Forbidden”.

What could that be? How can I solve it?

Here’s the first part of the SIP trace:

freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI> pjsip set logger on
PJSIP Logging enabled

<--- Received SIP request (1293 bytes) from UDP:10.0.0.2:5060 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK407964590;rport
Route: <sip:10.0.0.10:5060;lr>
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 150 INVITE
Contact: "Garagem" <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: Grandstream GXW4216V2 1.0.15.2
Privacy: none
P-Preferred-Identity: "Garagem" <sip:[email protected]>
P-Access-Network-Info: IEEE-EUI-48;eui-48-addr=D2-21-F9-85-6B-4E
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=C0-74-AD-AC-D5-99
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length:   488

v=0
o=200 8000 8000 IN IP4 10.0.0.2
s=SIP Call
c=IN IP4 10.0.0.2
t=0 0
m=audio 50000 RTP/AVP 0 8 4 18 2 97 123 9 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54

<--- Transmitting SIP response (471 bytes) to UDP:10.0.0.2:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.0.2:5060;rport=5060;received=10.0.0.2;branch=z9hG4bK407964590
Call-ID: [email protected]
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=z9hG4bK407964590
CSeq: 150 INVITE
WWW-Authenticate: Digest realm="asterisk",nonce="1699031145/5e2cc6b913e6cc9758678a7f37a1a44e",opaque="3bb380b7545bff42",algorithm=MD5,qop="auth"
Server: FPBX-16.0.40.7(18.17.1)
Content-Length:  0


<--- Received SIP request (308 bytes) from UDP:10.0.0.2:5060 --->
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK407964590;rport
Route: <sip:10.0.0.10:5060;lr>
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=z9hG4bK407964590
Call-ID: [email protected]
CSeq: 150 ACK
Content-Length: 0


<--- Received SIP request (1562 bytes) from UDP:10.0.0.2:5060 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK607604217;rport
Route: <sip:10.0.0.10:5060;lr>
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 151 INVITE
Contact: "Garagem" <sip:[email protected]:5060>
Authorization: Digest username="200", realm="asterisk", nonce="1699031145/5e2cc6b913e6cc9758678a7f37a1a44e", uri="sip:[email protected]", response="c9e61e25490ca04e72b6e9cd00fccdd0", algorithm=MD5, cnonce="08238538", opaque="3bb380b7545bff42", qop=auth, nc=00000001
Max-Forwards: 70
User-Agent: Grandstream GXW4216V2 1.0.15.2
Privacy: none
P-Preferred-Identity: "Garagem" <sip:[email protected]>
P-Access-Network-Info: IEEE-EUI-48;eui-48-addr=D2-21-F9-85-6B-4E
P-Emergency-Info: IEEE-EUI-48;eui-48-addr=C0-74-AD-AC-D5-99
Supported: replaces, path, timer, eventlist
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Type: application/sdp
Accept: application/sdp, application/dtmf-relay
Content-Length:   488

v=0
o=200 8000 8000 IN IP4 10.0.0.2
s=SIP Call
c=IN IP4 10.0.0.2
t=0 0
m=audio 50000 RTP/AVP 0 8 4 18 2 97 123 9 101
a=sendrecv
a=rtpmap:0 PCMU/8000
a=ptime:20
a=rtpmap:8 PCMA/8000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:2 G726-32/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=20
a=rtpmap:123 opus/48000/2
a=fmtp:123 maxplaybackrate=16000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-36,54

<--- Transmitting SIP response (298 bytes) to UDP:10.0.0.2:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.0.2:5060;rport=5060;received=10.0.0.2;branch=z9hG4bK607604217
Call-ID: [email protected]
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>
CSeq: 151 INVITE
Server: FPBX-16.0.40.7(18.17.1)
Content-Length:  0


  == 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 [911234567@from-internal:1] Macro("PJSIP/200-00001008", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("PJSIP/200-00001008", "TOUCH_MONITOR=1699031145.5606") in new stack
    -- Executing [s@macro-user-callerid:2] Set("PJSIP/200-00001008", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:3] Progress("PJSIP/200-00001008", "") in new stack
    -- Executing [s@macro-user-callerid:4] Set("PJSIP/200-00001008", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:5] Set("PJSIP/200-00001008", "CHANEXTENCONTEXT=200-00001008") in new stack
    -- Executing [s@macro-user-callerid:6] Set("PJSIP/200-00001008", "CHANEXTEN=200-00001008") in new stack
    -- Executing [s@macro-user-callerid:7] Set("PJSIP/200-00001008", "CALLERID(number)=200") in new stack
    -- Executing [s@macro-user-callerid:8] Set("PJSIP/200-00001008", "AMPUSER=200") in new stack
    -- Executing [s@macro-user-callerid:9] Set("PJSIP/200-00001008", "HOTDESCKCHAN=200-00001008") in new stack
    -- Executing [s@macro-user-callerid:10] Set("PJSIP/200-00001008", "HOTDESKEXTEN=200") in new stack
    -- Executing [s@macro-user-callerid:11] Set("PJSIP/200-00001008", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:12] ExecIf("PJSIP/200-00001008", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:14] GotoIf("PJSIP/200-00001008", "0?report") in new stack
    -- Executing [s@macro-user-callerid:15] ExecIf("PJSIP/200-00001008", "1?Set(REALCALLERIDNUM=200)") in new stack
    -- Executing [s@macro-user-callerid:16] Set("PJSIP/200-00001008", "AMPUSER=200") in new stack
    -- Executing [s@macro-user-callerid:17] GotoIf("PJSIP/200-00001008", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:18] Set("PJSIP/200-00001008", "AMPUSERCIDNAME=Hall Entrada") in new stack
    -- Executing [s@macro-user-callerid:19] ExecIf("PJSIP/200-00001008", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:20] GotoIf("PJSIP/200-00001008", "0?report") in new stack
    -- Executing [s@macro-user-callerid:21] Set("PJSIP/200-00001008", "AMPUSERCID=200") in new stack
    -- Executing [s@macro-user-callerid:22] Set("PJSIP/200-00001008", "__DIAL_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-user-callerid:23] Set("PJSIP/200-00001008", "CALLERID(all)="Hall Entrada" <200>") in new stack
    -- Executing [s@macro-user-callerid:24] ExecIf("PJSIP/200-00001008", "0?Set(CUSDIAL=)") in new stack
    -- Executing [s@macro-user-callerid:25] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(all)="Hall Entrada" <200>)") in new stack
    -- Executing [s@macro-user-callerid:26] GotoIf("PJSIP/200-00001008", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:27] ExecIf("PJSIP/200-00001008", "1?Set(GROUP(concurrency_limit)=200)") in new stack
    -- Executing [s@macro-user-callerid:28] ExecIf("PJSIP/200-00001008", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:29] NoOp("PJSIP/200-00001008", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:30] GotoIf("PJSIP/200-00001008", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,31)
    -- Executing [s@macro-user-callerid:31] GotoIf("PJSIP/200-00001008", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,50)
    -- Executing [s@macro-user-callerid:50] Set("PJSIP/200-00001008", "CALLERID(number)=200") in new stack
    -- Executing [s@macro-user-callerid:51] Set("PJSIP/200-00001008", "CALLERID(name)=Hall Entrada") in new stack
    -- Executing [s@macro-user-callerid:52] GotoIf("PJSIP/200-00001008", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:53] Set("PJSIP/200-00001008", "__MCNUM=200") in new stack
    -- Executing [s@macro-user-callerid:54] Set("PJSIP/200-00001008", "__MCNAME=Hall Entrada") in new stack
    -- Executing [s@macro-user-callerid:55] Set("PJSIP/200-00001008", "__MCEXTEN=200") in new stack
    -- Executing [s@macro-user-callerid:56] Set("PJSIP/200-00001008", "__MCORGCHAN=PJSIP/200-00001008") in new stack
    -- Executing [s@macro-user-callerid:57] Set("PJSIP/200-00001008", "CDR(cnam)=Hall Entrada") in new stack
<--- Transmitting SIP response (819 bytes) to UDP:10.0.0.2:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 10.0.0.2:5060;rport=5060;received=10.0.0.2;branch=z9hG4bK607604217
Call-ID: [email protected]
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=8cb87d33-9856-4824-b31f-76d4528d68ab
CSeq: 151 INVITE
Server: FPBX-16.0.40.7(18.17.1)
Contact: <sip:10.0.0.10:5060>
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Content-Type: application/sdp
Content-Length:   294

v=0
o=- 8000 8002 IN IP4 10.0.0.10
s=Asterisk
c=IN IP4 10.0.0.10
t=0 0
m=audio 19452 RTP/AVP 0 8 2 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

    -- Executing [s@macro-user-callerid:58] Set("PJSIP/200-00001008", "CDR(cnum)=200") in new stack
    -- Executing [s@macro-user-callerid:59] Set("PJSIP/200-00001008", "CHANNEL(language)=en") in new stack
    -- Executing [911234567@from-internal:2] Gosub("PJSIP/200-00001008", "sub-record-check,s,1(out,911234567,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("PJSIP/200-00001008", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("PJSIP/200-00001008", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("PJSIP/200-00001008", "NOW=1699031145") in new stack
    -- Executing [s@sub-record-check:4] Set("PJSIP/200-00001008", "__DAY=03") in new stack
    -- Executing [s@sub-record-check:5] Set("PJSIP/200-00001008", "__MONTH=11") in new stack
    -- Executing [s@sub-record-check:6] Set("PJSIP/200-00001008", "__YEAR=2023") in new stack
    -- Executing [s@sub-record-check:7] Set("PJSIP/200-00001008", "__TIMESTR=20231103-170545") in new stack
    -- Executing [s@sub-record-check:8] Set("PJSIP/200-00001008", "__FROMEXTEN=200") in new stack
    -- Executing [s@sub-record-check:9] Set("PJSIP/200-00001008", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("PJSIP/200-00001008", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("PJSIP/200-00001008", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("PJSIP/200-00001008", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("PJSIP/200-00001008", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("PJSIP/200-00001008", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("PJSIP/200-00001008", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("PJSIP/200-00001008", "Outbound Recording Check from 200 to 911234567") in new stack
    -- Executing [out@sub-record-check:2] Set("PJSIP/200-00001008", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("PJSIP/200-00001008", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("PJSIP/200-00001008", "recordcheck,1(dontcare,out,911234567)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/200-00001008", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("PJSIP/200-00001008", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("PJSIP/200-00001008", "") in new stack
    -- Executing [out@sub-record-check:8] Return("PJSIP/200-00001008", "") in new stack
    -- Executing [911234567@from-internal:3] ExecIf("PJSIP/200-00001008", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [911234567@from-internal:4] Set("PJSIP/200-00001008", "_ROUTEID=1") in new stack
    -- Executing [911234567@from-internal:5] Set("PJSIP/200-00001008", "_ROUTENAME=OutboundRouteExterna") in new stack
    -- Executing [911234567@from-internal:6] Set("PJSIP/200-00001008", "EMERGENCYROUTE=YES") in new stack
    -- Executing [911234567@from-internal:7] Set("PJSIP/200-00001008", "MOHCLASS=default") in new stack
    -- Executing [911234567@from-internal:8] Set("PJSIP/200-00001008", "_CALLERIDNAMEINTERNAL=Hall Entrada") in new stack
    -- Executing [911234567@from-internal:9] Set("PJSIP/200-00001008", "_CALLERIDNUMINTERNAL=200") in new stack
    -- Executing [911234567@from-internal:10] Set("PJSIP/200-00001008", "_EMAILNOTIFICATION=FALSE") in new stack
    -- Executing [911234567@from-internal:11] Set("PJSIP/200-00001008", "_NODEST=") in new stack
    -- Executing [911234567@from-internal:12] Macro("PJSIP/200-00001008", "dialout-trunk,3,911234567,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("PJSIP/200-00001008", "DIAL_TRUNK=3") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("PJSIP/200-00001008", "0?Set(DIAL_OPTIONS=Hhtr)") in new stack
    -- Executing [s@macro-dialout-trunk:3] GosubIf("PJSIP/200-00001008", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:4] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(num)=200)") in new stack
    -- Executing [s@macro-dialout-trunk:5] GotoIf("PJSIP/200-00001008", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("PJSIP/200-00001008", "DIAL_NUMBER=911234567") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("PJSIP/200-00001008", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("PJSIP/200-00001008", "OUTBOUND_GROUP=OUT_3") in new stack
    -- Executing [s@macro-dialout-trunk:9] Set("PJSIP/200-00001008", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [s@macro-dialout-trunk:10] GotoIf("PJSIP/200-00001008", "0?nomax") in new stack
    -- Executing [s@macro-dialout-trunk:11] GotoIf("PJSIP/200-00001008", "0?chanfull") in new stack
    -- Executing [s@macro-dialout-trunk:12] GotoIf("PJSIP/200-00001008", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:13] Macro("PJSIP/200-00001008", "outbound-callerid,3") in new stack
    -- Executing [s@macro-outbound-callerid:1] NoOp("PJSIP/200-00001008", "200") in new stack
    -- Executing [s@macro-outbound-callerid:2] NoOp("PJSIP/200-00001008", "") in new stack
    -- Executing [s@macro-outbound-callerid:3] NoOp("PJSIP/200-00001008", "off") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:6] Set("PJSIP/200-00001008", "HOTDESCKCHAN=200-00001008") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("PJSIP/200-00001008", "HOTDESKEXTEN=200") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("PJSIP/200-00001008", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-outbound-callerid:9] ExecIf("PJSIP/200-00001008", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-outbound-callerid:10] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-outbound-callerid:11] Set("PJSIP/200-00001008", "ALLOWTHISROUTE=NO") in new stack
    -- Executing [s@macro-outbound-callerid:12] ExecIf("PJSIP/200-00001008", "1?Set(ALLOWTHISROUTE=YES)") in new stack
    -- Executing [s@macro-outbound-callerid:13] ExecIf("PJSIP/200-00001008", "0?Hangup()") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("PJSIP/200-00001008", "0?Set(REALCALLERIDNUM=200)") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("PJSIP/200-00001008", "0?Set(AMPUSER=200)") in new stack
    -- Executing [s@macro-outbound-callerid:16] GotoIf("PJSIP/200-00001008", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [s@macro-outbound-callerid:20] Set("PJSIP/200-00001008", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:21] Set("PJSIP/200-00001008", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/200-00001008", "0?Set(SCDEXT=YES)") in new stack
    -- Executing [s@macro-outbound-callerid:23] ExecIf("PJSIP/200-00001008", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [s@macro-outbound-callerid:24] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-outbound-callerid:25] ExecIf("PJSIP/200-00001008", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [s@macro-outbound-callerid:26] Set("PJSIP/200-00001008", "TRUNKOUTCID=211234567") in new stack
    -- Executing [s@macro-outbound-callerid:27] GotoIf("PJSIP/200-00001008", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,33)
    -- Executing [s@macro-outbound-callerid:33] ExecIf("PJSIP/200-00001008", "1?Set(CALLERID(all)=211234567)") in new stack
    -- Executing [s@macro-outbound-callerid:34] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:35] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:36] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(all)=200)") in new stack
    -- Executing [s@macro-outbound-callerid:37] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(all)=200)") in new stack
    -- Executing [s@macro-outbound-callerid:38] Set("PJSIP/200-00001008", "TIOHIDE=no") in new stack
    -- Executing [s@macro-outbound-callerid:39] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:40] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:41] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:42] ExecIf("PJSIP/200-00001008", "0?Set(CALLERID(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:43] Set("PJSIP/200-00001008", "CDR(outbound_cnum)=211234567") in new stack
    -- Executing [s@macro-outbound-callerid:44] Set("PJSIP/200-00001008", "CDR(outbound_cnam)=") in new stack
    -- Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/200-00001008", "0?sub-flp-3,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("PJSIP/200-00001008", "OUTNUM=911234567") in new stack
    -- Executing [s@macro-dialout-trunk:16] Set("PJSIP/200-00001008", "custom=PJSIP") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/200-00001008", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/200-00001008", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:19] ExecIf("PJSIP/200-00001008", "0?AGI(allowlist-autoadd.agi,)") in new stack
    -- Executing [s@macro-dialout-trunk:20] Macro("PJSIP/200-00001008", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("PJSIP/200-00001008", "") in new stack
    -- Executing [s@macro-dialout-trunk:21] GotoIf("PJSIP/200-00001008", "0?skipcrm") in new stack
    -- Executing [s@macro-dialout-trunk:22] Set("PJSIP/200-00001008", "__CRM_DIRECTION=OUTBOUND") in new stack
    -- Executing [s@macro-dialout-trunk:23] Set("PJSIP/200-00001008", "__CRM_DESTINATION=911234567") in new stack
    -- Executing [s@macro-dialout-trunk:24] Set("PJSIP/200-00001008", "__CRM_SOURCE=200") in new stack
    -- Executing [s@macro-dialout-trunk:25] AGI("PJSIP/200-00001008", "agi://127.0.0.1/sangomacrm.agi") in new stack
    -- <PJSIP/200-00001008>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
    -- Executing [s@macro-dialout-trunk:26] Set("PJSIP/200-00001008", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
    -- Executing [s@macro-dialout-trunk:27] NoOp("PJSIP/200-00001008", "CRM Finished") in new stack
    -- Executing [s@macro-dialout-trunk:28] GotoIf("PJSIP/200-00001008", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:29] ExecIf("PJSIP/200-00001008", "1?Set(CONNECTEDLINE(num,i)=911234567)") in new stack
    -- Executing [s@macro-dialout-trunk:30] ExecIf("PJSIP/200-00001008", "1?Set(CONNECTEDLINE(name,i)=CID:211234567)") in new stack
    -- Executing [s@macro-dialout-trunk:31] ExecIf("PJSIP/200-00001008", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)211234567)") in new stack
    -- Executing [s@macro-dialout-trunk:32] GotoIf("PJSIP/200-00001008", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:33] ExecIf("PJSIP/200-00001008", "0?Set(DIAL_TRUNK_OPTIONS=)") in new stack
    -- Executing [s@macro-dialout-trunk:34] Set("PJSIP/200-00001008", "HASH(__SIPHEADERS,Alert-Info)=unset") in new stack
    -- Executing [s@macro-dialout-trunk:35] Dial("PJSIP/200-00001008", "PJSIP/911234567@211234567,300,Tb(func-apply-sipheaders^s^1,(3))U(sub-send-obroute-email^911234567^911234567^3^1699031145^^211234567)") in new stack
    -- PJSIP/211234567-00001009 Internal Gosub(func-apply-sipheaders,s,1(3)) start
    -- Executing [s@func-apply-sipheaders:1] ExecIf("PJSIP/211234567-00001009", "0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)") in new stack
    -- Executing [s@func-apply-sipheaders:2] NoOp("PJSIP/211234567-00001009", "Applying SIP Headers to channel PJSIP/211234567-00001009") in new stack
    -- Executing [s@func-apply-sipheaders:3] Set("PJSIP/211234567-00001009", "localchan=211234567-00001009") in new stack
    -- Executing [s@func-apply-sipheaders:4] Set("PJSIP/211234567-00001009", "DialMCEXT=211234567") in new stack
    -- Executing [s@func-apply-sipheaders:5] Set("PJSIP/211234567-00001009", "CHANNEL(hangup_handler_push)=app-missedcall-hangup,211234567,1") in new stack
    -- Executing [s@func-apply-sipheaders:6] Set("PJSIP/211234567-00001009", "TECH=PJSIP") in new stack
    -- Executing [s@func-apply-sipheaders:7] Set("PJSIP/211234567-00001009", "SIPHEADERKEYS=Alert-Info") in new stack
    -- Executing [s@func-apply-sipheaders:8] While("PJSIP/211234567-00001009", "1") in new stack
    -- Executing [s@func-apply-sipheaders:9] Set("PJSIP/211234567-00001009", "sipheader=unset") in new stack
    -- Executing [s@func-apply-sipheaders:10] ExecIf("PJSIP/211234567-00001009", "1?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack
[2023-11-03 17:05:45] ERROR[18730]: res_pjsip_header_funcs.c:717 remove_header: No headers had been previously added to this session.
    -- Executing [s@func-apply-sipheaders:11] ExecIf("PJSIP/211234567-00001009", "0?Set(sipheader=<http://127.0.0.1>;info=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:12] ExecIf("PJSIP/211234567-00001009", "0?Set(sipheader=<http://127.0.0.1>unset)") in new stack
    -- Executing [s@func-apply-sipheaders:13] ExecIf("PJSIP/211234567-00001009", "0?Set(PJSIP_HEADER(add,Alert-Info)=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:14] EndWhile("PJSIP/211234567-00001009", "") in new stack
    -- Executing [s@func-apply-sipheaders:8] While("PJSIP/211234567-00001009", "0") in new stack
    -- Executing [s@func-apply-sipheaders:15] Return("PJSIP/211234567-00001009", "") in new stack
  == Spawn extension (func-apply-sipheaders, s, 15) exited non-zero on 'PJSIP/211234567-00001009'
    -- PJSIP/211234567-00001009 Internal Gosub(func-apply-sipheaders,s,1(3)) complete GOSUB_RETVAL=
    -- Called PJSIP/911234567@211234567

Here’s the second part of the trace (still the same call, I just had to break in two due to forum limitations):

<--- Transmitting SIP request (995 bytes) to UDP:10.0.0.3:5062 --->
INVITE sip:[email protected]:5062 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.10:5060;rport;branch=z9hG4bKPj0590a23b-73c4-4115-af2e-49e0286020f9
From: <sip:[email protected]>;tag=5cf8050c-613a-4e01-b263-ee99422c1a3d
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: 735c9d67-5d2c-4f6d-9fad-0b23d7390c8c
CSeq: 32409 INVITE
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(18.17.1)
Content-Type: application/sdp
Content-Length:   333

v=0
o=- 1909063453 1909063453 IN IP4 10.0.0.10
s=Asterisk
c=IN IP4 10.0.0.10
t=0 0
m=audio 11282 RTP/AVP 0 8 111 9 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP response (476 bytes) from UDP:10.0.0.3:5062 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.0.0.10:5060;rport=5060;branch=z9hG4bKPj0590a23b-73c4-4115-af2e-49e0286020f9
From: <sip:[email protected]>;tag=5cf8050c-613a-4e01-b263-ee99422c1a3d
To: <sip:[email protected]>
Call-ID: 735c9d67-5d2c-4f6d-9fad-0b23d7390c8c
CSeq: 32409 INVITE
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT813 1.0.13.3
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0


<--- Received SIP response (494 bytes) from UDP:10.0.0.3:5062 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 10.0.0.10:5060;rport=5060;branch=z9hG4bKPj0590a23b-73c4-4115-af2e-49e0286020f9
From: <sip:[email protected]>;tag=5cf8050c-613a-4e01-b263-ee99422c1a3d
To: <sip:[email protected]>;tag=2034259871
Call-ID: 735c9d67-5d2c-4f6d-9fad-0b23d7390c8c
CSeq: 32409 INVITE
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream HT813 1.0.13.3
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0


<--- Transmitting SIP request (393 bytes) to UDP:10.0.0.3:5062 --->
ACK sip:[email protected]:5062 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.10:5060;rport;branch=z9hG4bKPj0590a23b-73c4-4115-af2e-49e0286020f9
From: <sip:[email protected]>;tag=5cf8050c-613a-4e01-b263-ee99422c1a3d
To: <sip:[email protected]>;tag=2034259871
Call-ID: 735c9d67-5d2c-4f6d-9fad-0b23d7390c8c
CSeq: 32409 ACK
Max-Forwards: 70
User-Agent: FPBX-16.0.40.7(18.17.1)
Content-Length:  0


    -- PJSIP/211234567-00001009 Internal Gosub(app-missedcall-hangup,211234567,1) start
    -- Executing [211234567@app-missedcall-hangup:1] NoOp("PJSIP/211234567-00001009", "Dialed: 211234567") in new stack
    -- Executing [211234567@app-missedcall-hangup:2] NoOp("PJSIP/211234567-00001009", "Caller: 200") in new stack
    -- Executing [211234567@app-missedcall-hangup:3] GotoIf("PJSIP/211234567-00001009", "0?exit") in new stack
    -- Executing [211234567@app-missedcall-hangup:4] Set("PJSIP/211234567-00001009", "EXTENNUM=211234567") in new stack
    -- Executing [211234567@app-missedcall-hangup:5] Set("PJSIP/211234567-00001009", "FEXTENNUM=211234567") in new stack
    -- Executing [211234567@app-missedcall-hangup:6] GotoIf("PJSIP/211234567-00001009", "0?exit") in new stack
    -- Executing [211234567@app-missedcall-hangup:7] AGI("PJSIP/211234567-00001009", "agi://127.0.0.1/missedcallnotify.php,211234567,,211234567,0,,PJSIP/211234567-00001009,,,,") in new stack
    -- <PJSIP/211234567-00001009>AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0
    -- Executing [211234567@app-missedcall-hangup:8] Return("PJSIP/211234567-00001009", "") in new stack
  == Spawn extension (app-missedcall-hangup, 211234567, 8) exited non-zero on 'PJSIP/211234567-00001009'
    -- PJSIP/211234567-00001009 Internal Gosub(app-missedcall-hangup,211234567,1) complete GOSUB_RETVAL=
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@macro-dialout-trunk:36] NoOp("PJSIP/200-00001008", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 21") in new stack
    -- Executing [s@macro-dialout-trunk:37] GotoIf("PJSIP/200-00001008", "0?continue,1:s-CHANUNAVAIL,1") in new stack
    -- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set("PJSIP/200-00001008", "RC=21") in new stack
    -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("PJSIP/200-00001008", "21,1") in new stack
    -- Goto (macro-dialout-trunk,21,1)
    -- Executing [21@macro-dialout-trunk:1] Goto("PJSIP/200-00001008", "continue,1") in new stack
    -- Goto (macro-dialout-trunk,continue,1)
    -- Executing [continue@macro-dialout-trunk:1] NoOp("PJSIP/200-00001008", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 21 - failing through to other trunks") in new stack
    -- Executing [continue@macro-dialout-trunk:2] ExecIf("PJSIP/200-00001008", "1?Set(CALLERID(number)=200)") in new stack
    -- Executing [911234567@from-internal:13] Macro("PJSIP/200-00001008", "outisbusy,") in new stack
    -- Executing [s@macro-outisbusy:1] Progress("PJSIP/200-00001008", "") in new stack
    -- Executing [s@macro-outisbusy:2] GotoIf("PJSIP/200-00001008", "1?emergency,1") in new stack
    -- Goto (macro-outisbusy,emergency,1)
    -- Executing [emergency@macro-outisbusy:1] Playback("PJSIP/200-00001008", "all-circuits-busy-now&please-try-call-later") in new stack
<--- Transmitting SIP response (883 bytes) to UDP:10.0.0.2:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 10.0.0.2:5060;rport=5060;received=10.0.0.2;branch=z9hG4bK607604217
Call-ID: [email protected]
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=8cb87d33-9856-4824-b31f-76d4528d68ab
CSeq: 151 INVITE
Server: FPBX-16.0.40.7(18.17.1)
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Contact: <sip:10.0.0.10:5060>
P-Asserted-Identity: "CID:211234567" <sip:[email protected]>
Content-Type: application/sdp
Content-Length:   294

v=0
o=- 8000 8002 IN IP4 10.0.0.10
s=Asterisk
c=IN IP4 10.0.0.10
t=0 0
m=audio 19452 RTP/AVP 0 8 2 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Transmitting SIP response (917 bytes) to UDP:10.0.0.2:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.2:5060;rport=5060;received=10.0.0.2;branch=z9hG4bK607604217
Call-ID: [email protected]
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=8cb87d33-9856-4824-b31f-76d4528d68ab
CSeq: 151 INVITE
Server: FPBX-16.0.40.7(18.17.1)
Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER
Contact: <sip:10.0.0.10:5060>
Supported: 100rel, timer, replaces, norefersub
P-Asserted-Identity: "CID:211234567" <sip:[email protected]>
Content-Type: application/sdp
Content-Length:   294

v=0
o=- 8000 8002 IN IP4 10.0.0.10
s=Asterisk
c=IN IP4 10.0.0.10
t=0 0
m=audio 19452 RTP/AVP 0 8 2 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:2 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Received SIP request (515 bytes) from UDP:10.0.0.2:5060 --->
ACK sip:10.0.0.10:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK1056720644;rport
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=8cb87d33-9856-4824-b31f-76d4528d68ab
Call-ID: [email protected]
CSeq: 151 ACK
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream GXW4216V2 1.0.15.2
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0


    -- <PJSIP/200-00001008> Playing 'all-circuits-busy-now.ulaw' (language 'en')
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
    -- <PJSIP/200-00001008> Playing 'please-try-call-later.ulaw' (language 'en')
freepbx*CLI>
freepbx*CLI>
<--- Received SIP request (727 bytes) from UDP:10.0.0.120:5060 --->
REGISTER sip:10.0.0.120:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.120:5060;rport;branch=z9hG4bK894519986
From: "Porta Abrir:7*" <sip:[email protected]:5060>;tag=1281097454
To: "Porta Abrir:7*" <sip:[email protected]:5060>
Call-ID: 362555317
CSeq: 37899 REGISTER
Contact: <sip:[email protected]:5060;line=d2b6d9d87be92de>
Authorization: Digest username="301", realm="asterisk", nonce="1699031038/46dc659a2b4c0d5b10880b40641373d2", uri="sip:10.0.0.120:5060", response="7d9dbc64c752faf3ebcc9ed4e8d40c81", algorithm=MD5, cnonce="", opaque="5e73fb3b4579f16b", qop=auth, nc=00000002
Allow: REGISTER, INVITE, ACK, CANCEL, OPTIONS, BYE, INFO, NOTIFY
Max-Forwards: 70
User-Agent: 2N IP Force 2.40.0.53.4
Expires: 120
Content-Length: 0


<--- Transmitting SIP response (493 bytes) to UDP:10.0.0.120:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.0.0.120:5060;rport=5060;received=10.0.0.120;branch=z9hG4bK894519986
Call-ID: 362555317
From: "Porta Abrir:7*" <sip:[email protected]>;tag=1281097454
To: "Porta Abrir:7*" <sip:[email protected]>;tag=z9hG4bK894519986
CSeq: 37899 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1699031148/fda0014e72a76eb27faa164c9a269cca",opaque="2a1998055e8447de",stale=true,algorithm=MD5,qop="auth"
Server: FPBX-16.0.40.7(18.17.1)
Content-Length:  0


freepbx*CLI>
<--- Received SIP request (735 bytes) from UDP:10.0.0.120:5060 --->
REGISTER sip:10.0.0.120:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.120:5060;rport;branch=z9hG4bK742378515
From: "Porta Abrir:7*" <sip:[email protected]:5060>;tag=1281097454
To: "Porta Abrir:7*" <sip:[email protected]:5060>
Call-ID: 362555317
CSeq: 37900 REGISTER
Contact: <sip:[email protected]:5060;line=d2b6d9d87be92de>
Authorization: Digest username="301", realm="asterisk", nonce="1699031148/fda0014e72a76eb27faa164c9a269cca", uri="sip:10.0.0.120:5060", response="ac0a0fbb9047463176ae782dcd4b2457", algorithm=MD5, cnonce="0a4f113b", opaque="2a1998055e8447de", qop=auth, nc=00000001
Allow: REGISTER, INVITE, ACK, CANCEL, OPTIONS, BYE, INFO, NOTIFY
Max-Forwards: 70
User-Agent: 2N IP Force 2.40.0.53.4
Expires: 120
Content-Length: 0


<--- Transmitting SIP response (446 bytes) to UDP:10.0.0.120:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.120:5060;rport=5060;received=10.0.0.120;branch=z9hG4bK742378515
Call-ID: 362555317
From: "Porta Abrir:7*" <sip:[email protected]>;tag=1281097454
To: "Porta Abrir:7*" <sip:[email protected]>;tag=z9hG4bK742378515
CSeq: 37900 REGISTER
Date: Fri, 03 Nov 2023 17:05:48 GMT
Contact: <sip:[email protected]:5060;line=d2b6d9d87be92de>;expires=119
Expires: 120
Server: FPBX-16.0.40.7(18.17.1)
Content-Length:  0


freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
    -- Executing [emergency@macro-outisbusy:2] Congestion("PJSIP/200-00001008", "20") in new stack
<--- Received SIP request (514 bytes) from UDP:10.0.0.2:5060 --->
BYE sip:10.0.0.10:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.2:5060;branch=z9hG4bK492199485;rport
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=8cb87d33-9856-4824-b31f-76d4528d68ab
Call-ID: [email protected]
CSeq: 152 BYE
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
Supported: replaces, path, timer, eventlist
User-Agent: Grandstream GXW4216V2 1.0.15.2
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE
Content-Length: 0


<--- Transmitting SIP response (332 bytes) to UDP:10.0.0.2:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.0.0.2:5060;rport=5060;received=10.0.0.2;branch=z9hG4bK492199485
Call-ID: [email protected]
From: "Garagem" <sip:[email protected]>;tag=1951005369
To: <sip:[email protected]>;tag=8cb87d33-9856-4824-b31f-76d4528d68ab
CSeq: 152 BYE
Server: FPBX-16.0.40.7(18.17.1)
Content-Length:  0


  == Spawn extension (macro-outisbusy, emergency, 2) exited non-zero on 'PJSIP/200-00001008' in macro 'outisbusy'
  == Spawn extension (from-internal, 911234567, 13) exited non-zero on 'PJSIP/200-00001008'
    -- Executing [h@from-internal:1] Macro("PJSIP/200-00001008", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] Set("PJSIP/200-00001008", "__MCVMSTATUS=") in new stack
    -- Executing [s@macro-hangupcall:2] Gosub("PJSIP/200-00001008", "app-missedcall-hangup,s,1()") in new stack
    -- Executing [s@app-missedcall-hangup:1] NoOp("PJSIP/200-00001008", "Dialed: s") in new stack
    -- Executing [s@app-missedcall-hangup:2] NoOp("PJSIP/200-00001008", "Caller: 200") in new stack
    -- Executing [s@app-missedcall-hangup:3] GotoIf("PJSIP/200-00001008", "0?exit") in new stack
    -- Executing [s@app-missedcall-hangup:4] Set("PJSIP/200-00001008", "EXTENNUM=s") in new stack
    -- Executing [s@app-missedcall-hangup:5] Set("PJSIP/200-00001008", "FEXTENNUM=s") in new stack
    -- Executing [s@app-missedcall-hangup:6] GotoIf("PJSIP/200-00001008", "0?exit") in new stack
    -- Executing [s@app-missedcall-hangup:7] AGI("PJSIP/200-00001008", "agi://127.0.0.1/missedcallnotify.php,s,,s,0,,PJSIP/200-00001008,CHANUNAVAIL,,,") in new stack
    -- <PJSIP/200-00001008>AGI Script agi://127.0.0.1/missedcallnotify.php completed, returning 0
    -- Executing [s@app-missedcall-hangup:8] Return("PJSIP/200-00001008", "") in new stack
    -- Executing [s@macro-hangupcall:3] GotoIf("PJSIP/200-00001008", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,5)
    -- Executing [s@macro-hangupcall:5] ExecIf("PJSIP/200-00001008", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:6] Hangup("PJSIP/200-00001008", "") in new stack
  == Spawn extension (macro-hangupcall, s, 6) exited non-zero on 'PJSIP/200-00001008' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/200-00001008'
    -- PJSIP/200-00001008 Internal Gosub(crm-hangup,s,1) start
    -- Executing [s@crm-hangup:1] NoOp("PJSIP/200-00001008", "Sending Hangup to CRM") in new stack
    -- Executing [s@crm-hangup:2] NoOp("PJSIP/200-00001008", "HANGUP CAUSE: 21") in new stack
    -- Executing [s@crm-hangup:3] ExecIf("PJSIP/200-00001008", "0?Set(__CRM_VOICEMAIL=)") in new stack
    -- Executing [s@crm-hangup:4] NoOp("PJSIP/200-00001008", "MASTER CHANNEL: 1699031145.5606 = 1699031145.5606") in new stack
    -- Executing [s@crm-hangup:5] GotoIf("PJSIP/200-00001008", "0?return") in new stack
    -- Executing [s@crm-hangup:6] Set("PJSIP/200-00001008", "__CRM_HANGUP=1") in new stack
    -- Executing [s@crm-hangup:7] AGI("PJSIP/200-00001008", "agi://127.0.0.1/sangomacrm.agi") in new stack
freepbx*CLI>
    -- <PJSIP/200-00001008>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
    -- Executing [s@crm-hangup:8] Return("PJSIP/200-00001008", "") in new stack
  == Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/200-00001008'
    -- PJSIP/200-00001008 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI>
freepbx*CLI> pjsip set logger off
PJSIP Logging disabled
freepbx*CLI>

I would really appreciate some help, I’m stuck…

So the HT813 is rejecting the call, most likely a configuration error. Please post a screenshot of the FXO page settings.

Screenshots of the 211234567 trunk may also be useful (both General and Advanced tabs).

I was thinking this would be caller id problem, something causing the phone company to reject the call. But with your message I went looking for posts describing configuration issues with ht813’s and I found a suggestion

Please set Wait for Dial Tone to No and set Stage Method to 1.

… the author of that being none other than yourself :wink:

It worked like a charm! Thanks! :tada:

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