Forwarding Calls IAX A to B but when B Dials to a outbound dongle at A fails (loop!)

Hello,
I have the following scenario’s with two IAX2 connected over the Internet+VPN. The problem is that When I dial 91XXX number from Server A which has to go out via Server B IAX2 → Dongle0. It creates a loop instead of custom dialout.

The setup is as follows:
Server A is connected with 1 SIPs + 2 IAX (of which one is IAX to Server B) (Dialing Patterns are Configured here by Country Code i.e: 1XXXX, 378XXXX, 91XXX per SIP)
Server B has 2 Dongle’s Connected via chan_dongle + 1 IAX (to Server A) (Dialing Pattern is configured as 91XXX via only One Dongle)

Configuration IAX2 on A

type=friend
qualify=yes
qualifyfreqok=25000
host=XXXXB
disallow=all
context=from-trunk
allow=ulaw

Configuration IAX2 on A

type=friend
qualify=yes
qualifyfreqok=25000
host=XXXXB
disallow=all
context=from-trunk
allow=ulaw

Inbound Route on Server B:
1x It has a Custom Destination with custom-200 to forward all inbound to Server A (Extension)

[custom-200]
exten => s,1,Dial(IAX2/IN_to_EE/100,30,r)

Outbound Route on Server B:
91GSM → is pointed to the Dongle Trunk with Dial Pattern Match

On Server A I have added the dialing pattern 91XXX with a custom trunk dial out

IAX2/EE_to_IN/+$OUTNUM$

If I just setup a Dial Pattern against current IAX trunk the call is on Server A itself.

Server A logs when Dialling from EXT.100 to 91XXXX

== 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 [[email protected]:1] Macro("PJSIP/100-00000027", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [[email protected]:1] Set("PJSIP/100-00000027", "TOUCH_MONITOR=1654521388.73") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/100-00000027", "CHANCONTEXT=") in new stack
    -- Executing [[email protected]:3] Set("PJSIP/100-00000027", "CHANCONTEXT=") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/100-00000027", "CHANEXTENCONTEXT=100-00000027") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/100-00000027", "CHANEXTEN=100-00000027") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/100-00000027", "CALLERID(number)=100") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/100-00000027", "AMPUSER=100") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/100-00000027", "HOTDESCKCHAN=100-00000027") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/100-00000027", "HOTDESKEXTEN=100") in new stack
    -- Executing [[email protected]:10] Set("PJSIP/100-00000027", "HOTDESKCALL=0") in new stack
    -- Executing [[email protected]:11] ExecIf("PJSIP/100-00000027", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [[email protected]:12] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [[email protected]:13] GotoIf("PJSIP/100-00000027", "0?report") in new stack
    -- Executing [[email protected]:14] ExecIf("PJSIP/100-00000027", "1?Set(REALCALLERIDNUM=100)") in new stack
    -- Executing [[email protected]:15] Set("PJSIP/100-00000027", "AMPUSER=100") in new stack
    -- Executing [[email protected]:16] GotoIf("PJSIP/100-00000027", "0?limit") in new stack
    -- Executing [[email protected]:17] Set("PJSIP/100-00000027", "AMPUSERCIDNAME=100") in new stack
    -- Executing [[email protected]:18] ExecIf("PJSIP/100-00000027", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [[email protected]:19] GotoIf("PJSIP/100-00000027", "0?report") in new stack
    -- Executing [[email protected]:20] Set("PJSIP/100-00000027", "AMPUSERCID=100") in new stack
    -- Executing [[email protected]:21] Set("PJSIP/100-00000027", "__DIAL_OPTIONS=HhTtr") in new stack
    -- Executing [[email protected]:22] Set("PJSIP/100-00000027", "CALLERID(all)="100" <100>") in new stack
    -- Executing [[email protected]:23] ExecIf("PJSIP/100-00000027", "0?Set(CUSDIAL=)") in new stack
    -- Executing [[email protected]:24] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(all)="100" <100>)") in new stack
    -- Executing [[email protected]:25] GotoIf("PJSIP/100-00000027", "0?limit") in new stack
    -- Executing [[email protected]:26] ExecIf("PJSIP/100-00000027", "1?Set(GROUP(concurrency_limit)=100)") in new stack
    -- Executing [[email protected]:27] ExecIf("PJSIP/100-00000027", "1?Set(CHANNEL(language)=en)") in new stack
    -- Executing [[email protected]:28] NoOp("PJSIP/100-00000027", "Macro Depth is 1") in new stack
    -- Executing [[email protected]:29] GotoIf("PJSIP/100-00000027", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,30)
    -- Executing [[email protected]:30] GotoIf("PJSIP/100-00000027", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,49)
    -- Executing [[email protected]:49] Set("PJSIP/100-00000027", "CALLERID(number)=100") in new stack
    -- Executing [[email protected]:50] Set("PJSIP/100-00000027", "CALLERID(name)=100") in new stack
    -- Executing [[email protected]:51] GotoIf("PJSIP/100-00000027", "0?cnum") in new stack
    -- Executing [[email protected]:52] Set("PJSIP/100-00000027", "CDR(cnam)=100") in new stack
    -- Executing [[email protected]:53] Set("PJSIP/100-00000027", "CDR(cnum)=100") in new stack
    -- Executing [[email protected]:54] Set("PJSIP/100-00000027", "CHANNEL(language)=en") in new stack
    -- Executing [[email protected]:2] Gosub("PJSIP/100-00000027", "sub-record-check,s,1(out,91XX,dontcare)") in new stack
    -- Executing [[email protected]:1] GotoIf("PJSIP/100-00000027", "0?initialized") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/100-00000027", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [[email protected]:3] Set("PJSIP/100-00000027", "NOW=1654521388") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/100-00000027", "__DAY=06") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/100-00000027", "__MONTH=06") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/100-00000027", "__YEAR=2022") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/100-00000027", "__TIMESTR=20220606-131628") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/100-00000027", "__FROMEXTEN=100") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/100-00000027", "__MON_FMT=wav") in new stack
    -- Executing [[email protected]:10] NoOp("PJSIP/100-00000027", "Recordings initialized") in new stack
    -- Executing [[email protected]:11] ExecIf("PJSIP/100-00000027", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [[email protected]:12] Set("PJSIP/100-00000027", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [[email protected]:13] ExecIf("PJSIP/100-00000027", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [[email protected]:14] GotoIf("PJSIP/100-00000027", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [[email protected]:17] GotoIf("PJSIP/100-00000027", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [[email protected]:1] NoOp("PJSIP/100-00000027", "Outbound Recording Check from 100 to 91XX") in new stack
    -- Executing [[email protected]:2] Set("PJSIP/100-00000027", "RECMODE=dontcare") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/100-00000027", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [[email protected]:7] Gosub("PJSIP/100-00000027", "recordcheck,1(dontcare,out,91XX)") in new stack
    -- Executing [[email protected]:1] NoOp("PJSIP/100-00000027", "Starting recording check against dontcare") in new stack
    -- Executing [[email protected]:2] Goto("PJSIP/100-00000027", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [[email protected]:3] Return("PJSIP/100-00000027", "") in new stack
    -- Executing [[email protected]:8] Return("PJSIP/100-00000027", "") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/100-00000027", "0 ?Set(CDR(accountcode)=)") in new stack
    -- Executing [[email protected]:4] Set("PJSIP/100-00000027", "_ROUTEID=3") in new stack
    -- Executing [[email protected]:5] Set("PJSIP/100-00000027", "_ROUTENAME=IN_98") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/100-00000027", "MOHCLASS=default") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/100-00000027", "_CALLERIDNAMEINTERNAL=100") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/100-00000027", "_CALLERIDNUMINTERNAL=100") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/100-00000027", "_EMAILNOTIFICATION=FALSE") in new stack
    -- Executing [[email protected]:10] Set("PJSIP/100-00000027", "_NODEST=") in new stack
    -- Executing [[email protected]:11] Macro("PJSIP/100-00000027", "dialout-trunk,6,91XX,,off") in new stack
    -- Executing [[email protected]:1] Set("PJSIP/100-00000027", "DIAL_TRUNK=6") in new stack
    -- Executing [[email protected]:2] ExecIf("PJSIP/100-00000027", "0?Set(DIAL_OPTIONS=Hhtr)") in new stack
    -- Executing [[email protected]:3] GosubIf("PJSIP/100-00000027", "0?sub-pincheck,s,1()") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(num)=100)") in new stack
    -- Executing [[email protected]:5] GotoIf("PJSIP/100-00000027", "0?disabletrunk,1") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/100-00000027", "DIAL_NUMBER=91XX") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/100-00000027", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/100-00000027", "OUTBOUND_GROUP=OUT_6") in new stack
    -- Executing [[email protected]:9] Set("PJSIP/100-00000027", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [[email protected]:10] GotoIf("PJSIP/100-00000027", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,12)
    -- Executing [[email protected]:12] GotoIf("PJSIP/100-00000027", "0?skipoutcid") in new stack
    -- Executing [[email protected]:13] Macro("PJSIP/100-00000027", "outbound-callerid,6") in new stack
    -- Executing [[email protected]:1] NoOp("PJSIP/100-00000027", "100") in new stack
    -- Executing [[email protected]:2] NoOp("PJSIP/100-00000027", "") in new stack
    -- Executing [[email protected]:3] NoOp("PJSIP/100-00000027", "off") in new stack
    -- Executing [[email protected]:4] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(name-pres)=)") in new stack
    -- Executing [s[email protected]:5] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(num-pres)=)") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/100-00000027", "HOTDESCKCHAN=100-00000027") in new stack
    -- Executing [[email protected]:7] Set("PJSIP/100-00000027", "HOTDESKEXTEN=100") in new stack
    -- Executing [[email protected]:8] Set("PJSIP/100-00000027", "HOTDESKCALL=0") in new stack
    -- Executing [[email protected]:9] ExecIf("PJSIP/100-00000027", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [[email protected]:10] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [[email protected]:11] Set("PJSIP/100-00000027", "ALLOWTHISROUTE=NO") in new stack
    -- Executing [[email protected]:12] ExecIf("PJSIP/100-00000027", "0?Set(ALLOWTHISROUTE=YES)") in new stack
    -- Executing [[email protected]:13] ExecIf("PJSIP/100-00000027", "0?Hangup()") in new stack
    -- Executing [[email protected]:14] ExecIf("PJSIP/100-00000027", "0?Set(REALCALLERIDNUM=100)") in new stack
    -- Executing [[email protected]:15] ExecIf("PJSIP/100-00000027", "0?Set(AMPUSER=100)") in new stack
    -- Executing [[email protected]:16] GotoIf("PJSIP/100-00000027", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [[email protected]:20] Set("PJSIP/100-00000027", "USEROUTCID=") in new stack
    -- Executing [[email protected]:21] Set("PJSIP/100-00000027", "EMERGENCYCID=") in new stack
    -- Executing [[email protected]:22] ExecIf("PJSIP/100-00000027", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [[email protected]:23] Set("PJSIP/100-00000027", "TRUNKOUTCID=") in new stack
    -- Executing [[email protected]:24] GotoIf("PJSIP/100-00000027", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,30)
    -- Executing [[email protected]:30] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:31] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:32] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [[email protected]:33] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(all)=100)") in new stack
    -- Executing [[email protected]:34] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(all)=100)") in new stack
    -- Executing [[email protected]:35] Set("PJSIP/100-00000027", "TIOHIDE=no") in new stack
    -- Executing [[email protected]:36] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:37] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:38] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:39] ExecIf("PJSIP/100-00000027", "0?Set(CALLERID(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [[email protected]:40] Set("PJSIP/100-00000027", "CDR(outbound_cnum)=100") in new stack
    -- Executing [[email protected]:41] Set("PJSIP/100-00000027", "CDR(outbound_cnam)=100") in new stack
    -- Executing [[email protected]:14] GosubIf("PJSIP/100-00000027", "0?sub-flp-6,s,1()") in new stack
    -- Executing [[email protected]:15] Set("PJSIP/100-00000027", "OUTNUM=91XX") in new stack
    -- Executing [[email protected]:16] Set("PJSIP/100-00000027", "custom=AMP") in new stack
    -- Executing [[email protected]:17] ExecIf("PJSIP/100-00000027", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [[email protected]:18] ExecIf("PJSIP/100-00000027", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [[email protected]:19] GotoIf("PJSIP/100-00000027", "1?gocall") in new stack
    -- Goto (macro-dialout-trunk,s,21)
    -- Executing [[email protected]:21] Macro("PJSIP/100-00000027", "dialout-trunk-predial-hook,") in new stack
    -- Executing [[email protected]:1] MacroExit("PJSIP/100-00000027", "") in new stack
    -- Executing [[email protected]:22] GotoIf("PJSIP/100-00000027", "0?skipcrm") in new stack
    -- Executing [[email protected]:23] Set("PJSIP/100-00000027", "__CRM_DIRECTION=OUTBOUND") in new stack
    -- Executing [[email protected]:24] Set("PJSIP/100-00000027", "__CRM_DESTINATION=91XX") in new stack
    -- Executing [[email protected]:25] Set("PJSIP/100-00000027", "__CRM_SOURCE=100") in new stack
    -- Executing [[email protected]:26] AGI("PJSIP/100-00000027", "agi://127.0.0.1/sangomacrm.agi") in new stack
    -- <PJSIP/100-00000027>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
    -- Executing [[email protected]:27] Set("PJSIP/100-00000027", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack
    -- Executing [[email protected]:28] NoOp("PJSIP/100-00000027", "CRM Finished") in new stack
    -- Executing [[email protected]:29] GotoIf("PJSIP/100-00000027", "0?bypass,1") in new stack
    -- Executing [[email protected]:30] ExecIf("PJSIP/100-00000027", "1?Set(CONNECTEDLINE(num,i)=91XX)") in new stack
    -- Executing [[email protected]:31] ExecIf("PJSIP/100-00000027", "1?Set(CONNECTEDLINE(name,i)=CID:100)") in new stack
    -- Executing [[email protected]:32] ExecIf("PJSIP/100-00000027", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)100)") in new stack
    -- Executing [[email protected]:33] GotoIf("PJSIP/100-00000027", "1?customtrunk") in new stack
    -- Goto (macro-dialout-trunk,s,39)
    -- Executing [[email protected]:39] Set("PJSIP/100-00000027", "pre_num=AMP:IAX2/EE_to_IN/+") in new stack
    -- Executing [[email protected]:40] Set("PJSIP/100-00000027", "the_num=OUTNUM") in new stack
    -- Executing [[email protected]:41] Set("PJSIP/100-00000027", "post_num=") in new stack
    -- Executing [[email protected]:42] GotoIf("PJSIP/100-00000027", "1?outnum:skipoutnum") in new stack
    -- Goto (macro-dialout-trunk,s,43)
    -- Executing [[email protected]:43] Set("PJSIP/100-00000027", "the_num=91XX") in new stack
    -- Executing [[email protected]:44] Dial("PJSIP/100-00000027", "IAX2/EE_to_IN/+91XX,300,T") in new stack    -- Called IAX2/EE_to_IN/+91XX
    -- Call accepted by 10.8.0.2:4569 (format ulaw)
    -- Format for call is (ulaw)
    -- IAX2/EE_to_IN-2051 is circuit-busy
    -- Hungup 'IAX2/EE_to_IN-2051'
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [[email protected]:45] NoOp("PJSIP/100-00000027", "Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 34") in new stack
    -- Executing [[email protected]:46] GotoIf("PJSIP/100-00000027", "0?continue,1:s-CONGESTION,1") in new stack
    -- Goto (macro-dialout-trunk,s-CONGESTION,1)
    -- Executing [[email protected]:1] Set("PJSIP/100-00000027", "RC=34") in new stack
    -- Executing [[email protected]:2] Goto("PJSIP/100-00000027", "34,1") in new stack
    -- Goto (macro-dialout-trunk,34,1)
    -- Executing [[email protected]:1] Goto("PJSIP/100-00000027", "continue,1") in new stack
    -- Goto (macro-dialout-trunk,continue,1)
    -- Executing [[email protected]:1] NoOp("PJSIP/100-00000027", "TRUNK Dial failed due to CONGESTION HANGUPCAUSE: 34 - failing through to other trunks") in new stack
    -- Executing [[email protected]:2] ExecIf("PJSIP/100-00000027", "1?Set(CALLERID(number)=100)") in new stack
    -- Executing [[email protected]:12] Macro("PJSIP/100-00000027", "outisbusy,") in new stack
    -- Executing [[email protected]:1] Progress("PJSIP/100-00000027", "") in new stack
    -- Executing [[email protected]:2] GotoIf("PJSIP/100-00000027", "0?emergency,1") in new stack
    -- Executing [[email protected]:3] GotoIf("PJSIP/100-00000027", "0?intracompany,1") in new stack
    -- Executing [[email protected]:4] Playback("PJSIP/100-00000027", "all-circuits-busy-now&please-try-call-later, noanswer") in new stack
    -- <PJSIP/100-00000027> Playing 'all-circuits-busy-now.ulaw' (language 'en')
    -- <PJSIP/100-00000027> Playing 'please-try-call-later.ulaw' (language 'en')
    -- Executing [[email protected]:5] Congestion("PJSIP/100-00000027", "20") in new stack
  == Spawn extension (macro-outisbusy, s, 5) exited non-zero on 'PJSIP/100-00000027' in macro 'outisbusy'
  == Spawn extension (from-internal, 91XX, 12) exited non-zero on 'PJSIP/100-00000027'
    -- Executing [[email protected]:1] Macro("PJSIP/100-00000027", "hangupcall") in new stack
    -- Executing [[email protected]:1] GotoIf("PJSIP/100-00000027", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [[email protected]:3] ExecIf("PJSIP/100-00000027", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [[email protected]:4] Hangup("PJSIP/100-00000027", "") in new stack
  == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/100-00000027' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/100-00000027'
    -- PJSIP/100-00000027 Internal Gosub(crm-hangup,s,1) start
    -- Executing [[email protected]:1] NoOp("PJSIP/100-00000027", "Sending Hangup to CRM") in new stack
    -- Executing [[email protected]:2] NoOp("PJSIP/100-00000027", "HANGUP CAUSE: 34") in new stack
    -- Executing [[email protected]:3] ExecIf("PJSIP/100-00000027", "0?Set(__CRM_VOICEMAIL=)") in new stack
    -- Executing [[email protected]:4] NoOp("PJSIP/100-00000027", "MASTER CHANNEL: 1654521388.73 = 1654521388.73") in new stack
    -- Executing [[email protected]:5] GotoIf("PJSIP/100-00000027", "0?return") in new stack
    -- Executing [[email protected]:6] Set("PJSIP/100-00000027", "__CRM_HANGUP=1") in new stack
    -- Executing [[email protected]:7] AGI("PJSIP/100-00000027", "agi://127.0.0.1/sangomacrm.agi") in new stack
    -- <PJSIP/100-00000027>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
    -- Executing [[email protected]:8] Return("PJSIP/100-00000027", "") in new stack
  == Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/100-00000027'

Server B logs receiving the IAX2 dialout

    -- Accepting UNAUTHENTICATED call from 10.8.0.1:4569:
    --        > requested format = ulaw,
    --        > requested prefs = (ulaw),
    --        > actual format = ulaw,
    --        > host prefs = (ulaw),
    --        > priority = mine
    -- Executing [[email protected]:1] NoOp("IAX2/10.8.0.1:4569-14225", "Catch-All DID Match - Found +91XX - You probably want a DID for this.") in new stack
    -- Executing [[email protected]:2] Set("IAX2/10.8.0.1:4569-14225", "__FROM_DID=+91XX") in new stack
    -- Executing [[email protected]:3] Goto("IAX2/10.8.0.1:4569-14225", "ext-did,s,1") in new stack
    -- Goto (ext-did,s,1)
    -- Executing [[email protected]:1] Set("IAX2/10.8.0.1:4569-14225", "__DIRECTION=INBOUND") in new stack
    -- Executing [[email protected]:2] Gosub("IAX2/10.8.0.1:4569-14225", "sub-record-check,s,1(in,s,dontcare)") in new stack
    -- Executing [[email protected]:1] GotoIf("IAX2/10.8.0.1:4569-14225", "0?initialized") in new stack
    -- Executing [[email protected]:2] Set("IAX2/10.8.0.1:4569-14225", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [[email protected]:3] Set("IAX2/10.8.0.1:4569-14225", "NOW=1654521389") in new stack
    -- Executing [[email protected]:4] Set("IAX2/10.8.0.1:4569-14225", "__DAY=06") in new stack
    -- Executing [[email protected]:5] Set("IAX2/10.8.0.1:4569-14225", "__MONTH=06") in new stack
    -- Executing [[email protected]:6] Set("IAX2/10.8.0.1:4569-14225", "__YEAR=2022") in new stack
    -- Executing [[email protected]:7] Set("IAX2/10.8.0.1:4569-14225", "__TIMESTR=20220606-141629") in new stack
    -- Executing [[email protected]:8] Set("IAX2/10.8.0.1:4569-14225", "__FROMEXTEN=unknown") in new stack
    -- Executing [[email protected]:9] Set("IAX2/10.8.0.1:4569-14225", "__MON_FMT=wav") in new stack
    -- Executing [[email protected]:10] NoOp("IAX2/10.8.0.1:4569-14225", "Recordings initialized") in new stack
    -- Executing [[email protected]:11] ExecIf("IAX2/10.8.0.1:4569-14225", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [[email protected]:12] Set("IAX2/10.8.0.1:4569-14225", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [[email protected]:13] ExecIf("IAX2/10.8.0.1:4569-14225", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [[email protected]:14] GotoIf("IAX2/10.8.0.1:4569-14225", "2?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [[email protected]:17] GotoIf("IAX2/10.8.0.1:4569-14225", "1?sub-record-check,in,1") in new stack
    -- Goto (sub-record-check,in,1)
    -- Executing [[email protected]:1] NoOp("IAX2/10.8.0.1:4569-14225", "Inbound Recording Check to s") in new stack
    -- Executing [[email protected]:2] Set("IAX2/10.8.0.1:4569-14225", "FROMEXTEN=unknown") in new stack
    -- Executing [[email protected]:3] ExecIf("IAX2/10.8.0.1:4569-14225", "3?Set(FROMEXTEN=100)") in new stack
    -- Executing [[email protected]:4] Gosub("IAX2/10.8.0.1:4569-14225", "recordcheck,1(dontcare,in,s)") in new stack
    -- Executing [[email protected]:1] NoOp("IAX2/10.8.0.1:4569-14225", "Starting recording check against dontcare") in new stack
    -- Executing [[email protected]:2] Goto("IAX2/10.8.0.1:4569-14225", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [[email protected]:3] Return("IAX2/10.8.0.1:4569-14225", "") in new stack
    -- Executing [[email protected]:5] Return("IAX2/10.8.0.1:4569-14225", "") in new stack
    -- Executing [[email protected]:3] Set("IAX2/10.8.0.1:4569-14225", "CHANNEL(tonezone)=in") in new stack
    -- Executing [[email protected]:4] ExecIf("IAX2/10.8.0.1:4569-14225", "0?Set(__FROM_DID=s)") in new stack
    -- Executing [[email protected]:5] Set("IAX2/10.8.0.1:4569-14225", "CDR(did)=+91XX") in new stack
    -- Executing [[email protected]:6] ExecIf("IAX2/10.8.0.1:4569-14225", "0 ?Set(CALLERID(name)=100)") in new stack
    -- Executing [[email protected]:7] Set("IAX2/10.8.0.1:4569-14225", "__MOHCLASS=") in new stack
    -- Executing [[email protected]:8] Set("IAX2/10.8.0.1:4569-14225", "__REVERSAL_REJECT=FALSE") in new stack
    -- Executing [[email protected]:9] GotoIf("IAX2/10.8.0.1:4569-14225", "1?post-reverse-charge") in new stack
    -- Goto (ext-did,s,11)
    -- Executing [[email protected]:11] NoOp("IAX2/10.8.0.1:4569-14225", "") in new stack
    -- Executing [[email protected]:12] Set("IAX2/10.8.0.1:4569-14225", "__CALLINGNAMEPRES_SV=allowed_not_screened") in new stack
    -- Executing [[email protected]:13] Set("IAX2/10.8.0.1:4569-14225", "__CALLINGNUMPRES_SV=allowed_not_screened") in new stack
    -- Executing [[email protected]:14] Set("IAX2/10.8.0.1:4569-14225", "CALLERID(name-pres)=allowed_not_screened") in new stack
    -- Executing [[email protected]:15] Set("IAX2/10.8.0.1:4569-14225", "CALLERID(num-pres)=allowed_not_screened") in new stack
    -- Executing [[email protected]:16] NoOp("IAX2/10.8.0.1:4569-14225", "CallerID Entry Point") in new stack
    -- Executing [[email protected]:17] Goto("IAX2/10.8.0.1:4569-14225", "custom-200,s,1") in new stack
    -- Goto (custom-200,s,1)
    -- Executing [[email protected]:1] Dial("IAX2/10.8.0.1:4569-14225", "IAX2/IN_to_EE/100,30,r") in new stack
[2022-06-06 14:16:29] WARNING[25420][C-0000001b]: app_dial.c:2584 dial_exec_full: Unable to create channel of type 'IAX2' (cause 20 - Subscriber absent)
    -- No devices or endpoints to dial (technology/resource)
    -- Auto fallthrough, channel 'IAX2/10.8.0.1:4569-14225' status is 'CHANUNAVAIL'
    -- Hungup 'IAX2/10.8.0.1:4569-14225'

My troubleshooting so far:

  • Dialing/Receiving on Server B to the Server B Extension all Works. :white_check_mark:
  • Receiving from Server B Incoming Calls to Server A via Custom Destination :white_check_mark:
  • Internal Dialing Works 2XX and 1xx between two servers when context=from-internal is used :white_check_mark:
  • Incoming Dongle0 and Dongle1 Calls on Server A :white_check_mark:
  • Dialout from Server A to Server B via Dongle :negative_squared_cross_mark:

I know it’s creating a loop but If I change inbound routes on Server B, I don’t get any calls from Server B to Server A. Hence I am stuck in a loop dilema. Help appreciated, Thank you :slight_smile:

The context setting for a trunk determines how incoming calls will be handled. You have it set on both ends to from-trunk meaning that all inbound calls that match the trunk settings will be processed by inbound routes. If you’re expecting inbound calls over the trunk to be processed similarly to how they would be if dialed from a local extension out an outbound route, you want to use context from-internal.

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