All circuits busy on outbound calls

Hello helpers,

I have a SIP Phone account from my ISP and a Raspberry PIe device behind my TD-LTE modem running Raspbx 10 (FreePBX 15, Asterisk 16). I have configured a SIP trunk to use my SIP account as a trunk. Incoming calls work fine however outgoing calls does not work and returns “All circuits are busy now”. I have an IAX2 extension and a outbound route with a “2” prefix configured. Below is trunk config:

Outgoing:
username=DID
secret=SECRET
type=peer
host=voice.asiatech.ir
qualify=yes
allow=all
canreinvite=no
nat=yes
context=from-internal

Bellow is the asterisk log:

raspbx*CLI>
Reliably Transmitting (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK10920c54;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as518a1821
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Reliably Transmitting (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK207134ff;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as12bed3d3
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #1 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK10920c54;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as518a1821
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #1 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK207134ff;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as12bed3d3
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


-- Accepting AUTHENTICATED call from 2.179.48.230:11867:
--        > requested format = opus,
--        > requested prefs = (),
--        > actual format = ulaw,
--        > host prefs = (ulaw|alaw|gsm),
--        > priority = mine
-- Executing [21544@from-internal:1] Macro("IAX2/102-14660", "user-callerid,LIMIT,EXTERNAL,") in new stack
-- Executing [s@macro-user-callerid:1] Set("IAX2/102-14660", "TOUCH_MONITOR=1578338199.52") in new stack
-- Executing [s@macro-user-callerid:2] Set("IAX2/102-14660", "AMPUSER=102") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("IAX2/102-14660", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("IAX2/102-14660", "1?Set(REALCALLERIDNUM=102)") in new stack
-- Executing [s@macro-user-callerid:5] Set("IAX2/102-14660", "AMPUSER=102") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("IAX2/102-14660", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("IAX2/102-14660", "AMPUSERCIDNAME=Navidan") in new stack
-- Executing [s@macro-user-callerid:8] ExecIf("IAX2/102-14660", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
-- Executing [s@macro-user-callerid:9] GotoIf("IAX2/102-14660", "0?report") in new stack
-- Executing [s@macro-user-callerid:10] Set("IAX2/102-14660", "AMPUSERCID=102") in new stack
-- Executing [s@macro-user-callerid:11] Set("IAX2/102-14660", "__DIAL_OPTIONS=HhTtr") in new stack
-- Executing [s@macro-user-callerid:12] Set("IAX2/102-14660", "CALLERID(all)="Navidan" <102>") in new stack
-- Executing [s@macro-user-callerid:13] ExecIf("IAX2/102-14660", "0?Set(CALLERID(all)=EXTERNAL)") in new stack
-- Executing [s@macro-user-callerid:14] GotoIf("IAX2/102-14660", "0?limit") in new stack
-- Executing [s@macro-user-callerid:15] ExecIf("IAX2/102-14660", "1?Set(GROUP(concurrency_limit)=102)") in new stack
-- Executing [s@macro-user-callerid:16] NoOp("IAX2/102-14660", "Macro Depth is 1") in new stack
-- Executing [s@macro-user-callerid:17] GotoIf("IAX2/102-14660", "1?report2:macroerror") in new stack
-- Goto (macro-user-callerid,s,18)
-- Executing [s@macro-user-callerid:18] GotoIf("IAX2/102-14660", "1?continue") in new stack
-- Goto (macro-user-callerid,s,36)
-- Executing [s@macro-user-callerid:36] Set("IAX2/102-14660", "CALLERID(number)=102") in new stack
-- Executing [s@macro-user-callerid:37] Set("IAX2/102-14660", "CALLERID(name)=Navidan") in new stack
-- Executing [s@macro-user-callerid:38] GotoIf("IAX2/102-14660", "0?cnum") in new stack
-- Executing [s@macro-user-callerid:39] Set("IAX2/102-14660", "CDR(cnam)=Navidan") in new stack
-- Executing [s@macro-user-callerid:40] Set("IAX2/102-14660", "CDR(cnum)=102") in new stack
-- Executing [s@macro-user-callerid:41] Set("IAX2/102-14660", "CHANNEL(language)=fa") in new stack
-- Executing [21544@from-internal:2] Gosub("IAX2/102-14660", "sub-record-check,s,1(out,21544,dontcare)") in new stack
-- Executing [s@sub-record-check:1] GotoIf("IAX2/102-14660", "0?initialized") in new stack
-- Executing [s@sub-record-check:2] Set("IAX2/102-14660", "__REC_STATUS=INITIALIZED") in new stack
-- Executing [s@sub-record-check:3] Set("IAX2/102-14660", "NOW=1578338199") in new stack
-- Executing [s@sub-record-check:4] Set("IAX2/102-14660", "__DAY=06") in new stack
-- Executing [s@sub-record-check:5] Set("IAX2/102-14660", "__MONTH=01") in new stack
-- Executing [s@sub-record-check:6] Set("IAX2/102-14660", "__YEAR=2020") in new stack
-- Executing [s@sub-record-check:7] Set("IAX2/102-14660", "__TIMESTR=20200106-191639") in new stack
-- Executing [s@sub-record-check:8] Set("IAX2/102-14660", "__FROMEXTEN=102") in new stack
-- Executing [s@sub-record-check:9] Set("IAX2/102-14660", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:10] NoOp("IAX2/102-14660", "Recordings initialized") in new stack
-- Executing [s@sub-record-check:11] ExecIf("IAX2/102-14660", "0?Set(ARG3=dontcare)") in new stack
-- Executing [s@sub-record-check:12] Set("IAX2/102-14660", "REC_POLICY_MODE_SAVE=") in new stack
-- Executing [s@sub-record-check:13] ExecIf("IAX2/102-14660", "0?Set(REC_STATUS=NO)") in new stack
-- Executing [s@sub-record-check:14] GotoIf("IAX2/102-14660", "3?checkaction") in new stack
-- Goto (sub-record-check,s,17)
-- Executing [s@sub-record-check:17] GotoIf("IAX2/102-14660", "1?sub-record-check,out,1") in new stack
-- Goto (sub-record-check,out,1)
-- Executing [out@sub-record-check:1] NoOp("IAX2/102-14660", "Outbound Recording Check from 102 to 21544") in new stack
-- Executing [out@sub-record-check:2] Set("IAX2/102-14660", "RECMODE=dontcare") in new stack
-- Executing [out@sub-record-check:3] ExecIf("IAX2/102-14660", "1?Goto(routewins)") in new stack
-- Goto (sub-record-check,out,7)
-- Executing [out@sub-record-check:7] Gosub("IAX2/102-14660", "recordcheck,1(dontcare,out,21544)") in new stack
-- Executing [recordcheck@sub-record-check:1] NoOp("IAX2/102-14660", "Starting recording check against dontcare") in new stack
-- Executing [recordcheck@sub-record-check:2] Goto("IAX2/102-14660", "dontcare") in new stack
-- Goto (sub-record-check,recordcheck,3)
-- Executing [recordcheck@sub-record-check:3] Return("IAX2/102-14660", "") in new stack
-- Executing [out@sub-record-check:8] Return("IAX2/102-14660", "") in new stack
-- Executing [21544@from-internal:3] Set("IAX2/102-14660", "MOHCLASS=default") in new stack
-- Executing [21544@from-internal:4] ExecIf("IAX2/102-14660", "1?Set(TRUNKCIDOVERRIDE=2191012100)") in new stack
-- Executing [21544@from-internal:5] Set("IAX2/102-14660", "_NODEST=") in new stack
-- Executing [21544@from-internal:6] Macro("IAX2/102-14660", "dialout-trunk,2,1544,,on") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("IAX2/102-14660", "DIAL_TRUNK=2") in new stack
-- Executing [s@macro-dialout-trunk:2] ExecIf("IAX2/102-14660", "0?Set(DIAL_OPTIONS=Hhtr)") in new stack
-- Executing [s@macro-dialout-trunk:3] GosubIf("IAX2/102-14660", "0?sub-pincheck,s,1()") in new stack
-- Executing [s@macro-dialout-trunk:4] ExecIf("IAX2/102-14660", "0?Set(CALLERID(num)=102)") in new stack
-- Executing [s@macro-dialout-trunk:5] GotoIf("IAX2/102-14660", "0?disabletrunk,1") in new stack
-- Executing [s@macro-dialout-trunk:6] Set("IAX2/102-14660", "DIAL_NUMBER=1544") in new stack
-- Executing [s@macro-dialout-trunk:7] Set("IAX2/102-14660", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
-- Executing [s@macro-dialout-trunk:8] Set("IAX2/102-14660", "OUTBOUND_GROUP=OUT_2") in new stack
-- Executing [s@macro-dialout-trunk:9] Set("IAX2/102-14660", "DIAL_TRUNK_OPTIONS=Tt") in new stack
-- Executing [s@macro-dialout-trunk:10] GotoIf("IAX2/102-14660", "1?nomax") in new stack
-- Goto (macro-dialout-trunk,s,12)
-- Executing [s@macro-dialout-trunk:12] GotoIf("IAX2/102-14660", "0?skipoutcid") in new stack
-- Executing [s@macro-dialout-trunk:13] Macro("IAX2/102-14660", "outbound-callerid,2") in new stack
-- Executing [s@macro-outbound-callerid:1] NoOp("IAX2/102-14660", "102") in new stack
-- Executing [s@macro-outbound-callerid:2] NoOp("IAX2/102-14660", "") in new stack
-- Executing [s@macro-outbound-callerid:3] NoOp("IAX2/102-14660", "off") in new stack
-- Executing [s@macro-outbound-callerid:4] ExecIf("IAX2/102-14660", "0?Set(CALLERPRES(name-pres)=)") in new stack
-- Executing [s@macro-outbound-callerid:5] ExecIf("IAX2/102-14660", "0?Set(CALLERPRES(num-pres)=)") in new stack
-- Executing [s@macro-outbound-callerid:6] ExecIf("IAX2/102-14660", "0?Set(REALCALLERIDNUM=102)") in new stack
-- Executing [s@macro-outbound-callerid:7] ExecIf("IAX2/102-14660", "0?Set(AMPUSER=102)") in new stack
-- Executing [s@macro-outbound-callerid:8] GotoIf("IAX2/102-14660", "1?normcid") in new stack
-- Goto (macro-outbound-callerid,s,12)
-- Executing [s@macro-outbound-callerid:12] Set("IAX2/102-14660", "USEROUTCID=102") in new stack
-- Executing [s@macro-outbound-callerid:13] Set("IAX2/102-14660", "EMERGENCYCID=") in new stack
-- Executing [s@macro-outbound-callerid:14] Set("IAX2/102-14660", "TRUNKOUTCID=2191012100") in new stack
-- Executing [s@macro-outbound-callerid:15] GotoIf("IAX2/102-14660", "1?trunkcid") in new stack
-- Goto (macro-outbound-callerid,s,21)
-- Executing [s@macro-outbound-callerid:21] ExecIf("IAX2/102-14660", "1?Set(CALLERID(all)=2191012100)") in new stack
-- Executing [s@macro-outbound-callerid:22] ExecIf("IAX2/102-14660", "1?Set(CALLERID(all)=102)") in new stack
-- Executing [s@macro-outbound-callerid:23] ExecIf("IAX2/102-14660", "1?Set(CALLERID(all)=2191012100)") in new stack
-- Executing [s@macro-outbound-callerid:24] ExecIf("IAX2/102-14660", "0?Set(CALLERID(all)=102)") in new stack
-- Executing [s@macro-outbound-callerid:25] ExecIf("IAX2/102-14660", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
-- Executing [s@macro-outbound-callerid:26] ExecIf("IAX2/102-14660", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
-- Executing [s@macro-outbound-callerid:27] Set("IAX2/102-14660", "CDR(outbound_cnum)=2191012100") in new stack
-- Executing [s@macro-outbound-callerid:28] Set("IAX2/102-14660", "CDR(outbound_cnam)=") in new stack
-- Executing [s@macro-dialout-trunk:14] GosubIf("IAX2/102-14660", "0?sub-flp-2,s,1()") in new stack
-- Executing [s@macro-dialout-trunk:15] Set("IAX2/102-14660", "OUTNUM=1544") in new stack
-- Executing [s@macro-dialout-trunk:16] Set("IAX2/102-14660", "custom=SIP/Asiatel-021") in new stack
-- Executing [s@macro-dialout-trunk:17] ExecIf("IAX2/102-14660", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)Tt)") in new stack
-- Executing [s@macro-dialout-trunk:18] ExecIf("IAX2/102-14660", "0?Set(DIAL_TRUNK_OPTIONS=TtM(confirm))") in new stack
-- Executing [s@macro-dialout-trunk:19] Macro("IAX2/102-14660", "dialout-trunk-predial-hook,") in new stack
-- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("IAX2/102-14660", "") in new stack
-- Executing [s@macro-dialout-trunk:20] GotoIf("IAX2/102-14660", "0?bypass,1") in new stack
-- Executing [s@macro-dialout-trunk:21] ExecIf("IAX2/102-14660", "1?Set(CONNECTEDLINE(num,i)=1544)") in new stack
-- Executing [s@macro-dialout-trunk:22] ExecIf("IAX2/102-14660", "1?Set(CONNECTEDLINE(name,i)=CID:2191012100)") in new stack
-- Executing [s@macro-dialout-trunk:23] ExecIf("IAX2/102-14660", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)2191012100)") in new stack
-- Executing [s@macro-dialout-trunk:24] GotoIf("IAX2/102-14660", "0?customtrunk") in new stack
-- Executing [s@macro-dialout-trunk:25] ExecIf("IAX2/102-14660", "0?Set(DIAL_TRUNK_OPTIONS=t)") in new stack
-- Executing [s@macro-dialout-trunk:26] Dial("IAX2/102-14660", "SIP/Asiatel-021/1544,300,Ttb(func-apply-sipheaders^s^1,(2))") in new stack

[2020-01-06 19:16:39] WARNING[12927][C-00000021]: app_dial.c:2578 dial_exec_full: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [s@macro-dialout-trunk:27] NoOp(“IAX2/102-14660”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 20”) in new stack
– Executing [s@macro-dialout-trunk:28] GotoIf(“IAX2/102-14660”, “1?continue,1:s-CHANUNAVAIL,1”) in new stack
– Goto (macro-dialout-trunk,continue,1)
– Executing [continue@macro-dialout-trunk:1] NoOp(“IAX2/102-14660”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 20 - failing through to other trunks”) in new stack
– Executing [continue@macro-dialout-trunk:2] ExecIf(“IAX2/102-14660”, “1?Set(CALLERID(number)=102)”) in new stack
– Executing [21544@from-internal:7] Macro(“IAX2/102-14660”, “outisbusy,”) in new stack
– Executing [s@macro-outisbusy:1] Progress(“IAX2/102-14660”, “”) in new stack
– Executing [s@macro-outisbusy:2] GotoIf(“IAX2/102-14660”, “0?emergency,1”) in new stack
– Executing [s@macro-outisbusy:3] GotoIf(“IAX2/102-14660”, “0?intracompany,1”) in new stack
– Executing [s@macro-outisbusy:4] Playback(“IAX2/102-14660”, “all-circuits-busy-now&please-try-call-later, noanswer”) in new stack
– <IAX2/102-14660> Playing ‘all-circuits-busy-now.ulaw’ (language ‘fa’)
Really destroying SIP dialog ‘[email protected]:5060’ Method: INVITE
Retransmitting #2 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK10920c54;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as518a1821
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #2 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK207134ff;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as12bed3d3
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #3 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK10920c54;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as518a1821
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #3 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK207134ff;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as12bed3d3
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #4 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK10920c54;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as518a1821
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:37 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
Retransmitting #4 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK207134ff;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as12bed3d3
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
Reliably Transmitting (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK2ccbf304;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as5b78172a
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #1 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK2ccbf304;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as5b78172a
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #2 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK2ccbf304;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as5b78172a
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


-- <IAX2/102-14660> Playing 'please-try-call-later.ulaw' (language 'fa')
-- Executing [h@from-internal:1] Macro("IAX2/102-14660", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("IAX2/102-14660", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("IAX2/102-14660", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] NoOp("IAX2/102-14660", " montior file= ") in new stack
-- Executing [s@macro-hangupcall:5] GotoIf("IAX2/102-14660", "1?skipagi") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [s@macro-hangupcall:7] Hangup("IAX2/102-14660", "") in new stack

== Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘IAX2/102-14660’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘IAX2/102-14660’
– Hungup ‘IAX2/102-14660’
Retransmitting #3 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK2ccbf304;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as5b78172a
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Retransmitting #4 (NAT) to 185.98.113.122:5060:
OPTIONS sip:voice.asiatech.ir SIP/2.0
Via: SIP/2.0/UDP 37.156.8.217:5060;branch=z9hG4bK2ccbf304;rport
Max-Forwards: 70
From: “Unknown” sip:[email protected];tag=as5b78172a
To: sip:voice.asiatech.ir
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-15.0.16.38(16.6.1)
Date: Mon, 06 Jan 2020 19:16:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
raspbx*CLI>

I may be missing it, but I don’t see an INVITE sip packet to the provider, only OPTIONS. I’m wondering if the correct Outgoing Route is triggered, and the number that’s sent to the provider looks correct. It looks like Ext 102 is calling 21544. Is that correct? Could your Outgoing Route be unexpectedly altering the number before it’s sent to the provider?

Can you try getting another CLI dump with pjsip(or sip) logging enabled before placing an outbound call? If it was enabled for the output above, how is it being enabled?

Yes, sip logging was enabled by issuing “sip set debug on” in CLI. I have configured 2 outbound routes each with different prefixes. The dials with 2 prefixed, goes a chan_sip trunk on which incoming calls work fine. I have earlier posted the config.

Is it possible that it is due to inter-channel call being placed? Can an IAX2 extension dial out through a chan_sip trunk?

Any idea?

-Now it gets “407407 Proxy Authentication Required” from remote SIP trunk. What amI missing in outgoing config?

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

Did you make any changes on the PBX or the provider to trigger that “407407 Proxy Authentication Required” message?

I’m not sure why we are not seeing any INVITE sip packets to your provider during your call tests, not just OPTIONS. We really want to see what callerid and destination number is being sent to the provider. From your cli output, it looks like ext102 is trying to call 21544. Is 21544 a valid number to be calling over that provider? It seems short, if it’s supposed to be a typical external number.

Can you try enabling sip debugging again, and look for INVITE packets? Try an inbound call as well, since we know those work, and they should generate INVITE packets as well. Does the provider have any documentation about setting up an asterisk based system with their service?

I don’t think IAX clients would be an issue for this, but you may want to try a sip phone to rule that out, maybe a free softphone if you don’t have a deskphone available.

The provider has allocated just one concurrent outgoing channel so it sometime happen that the channel is considered as busy. I changed “continue if busy” to “Yes” and it works after one or two retries. However, now the issue is audio. When call is established, no incoming audio is heared but outgoing audio is heared on callee side. RTP ports are properly forwarded and tcpdump shows incoming packets.

Thanks.

Are your incoming calls also having audio issues? If so, are the same voice codecs set to be used for outbound calls? Do you always have to do one or two retries for outbound calls, even when there are no other calls on the system? That would seem odd. Is the tcpdump showing RTP packets flowing in both directions, between your pbx and the provider? You can try taking a look at Settings->Asterisk SIP Settings, and take a look at the external address option to make sure it’s accurate.

edit: I’ll close this post for now, and continue this in the other thread for this issue.