Inbound call connecting to wrong trunk

Hi FreePBX users, great software to use!

Inbound call from mobile xxxxxxxxxx to landline number xxxxxxxxxx is executed via an incorrect trunk number 5.
If I remove this trunk number 5, then the inbound call from mobile xxxxxxxxxx to landline number xxxxxxxxxx does literally nothing. The mobile phone call just ends and Unix shows no executions by Asterisk.

Previously, I have always had inbound calls from mobile xxxxxxxxxx to landline xxxxxxxxxx run via trunk number 1. This then allows the ‘Callback’, ‘DISA’ and ‘Custom Contexts’ feature to run smoothly.

Now with the inbound call from mobile xxxxxxxxxx to landline number xxxxxxxxxx executing via the incorrect trunk number 5, the ‘Callback’, ‘DISA’ and ‘Custom Contexts’ will not work.

Please see the debug below with trunk 5 and then with trunk 5 removed.

Connected to Asterisk 1.6.2.10 currently running on Home (pid = 2606)
Verbosity is at least 3
– Remote UNIX connection
– Remote UNIX connection disconnected
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [[email protected]:1] Set(“SIP/Helen-0000006e”, “GROUP()=OUT_5”) in new stack
– Executing [[email protected]:2] Goto(“SIP/Helen-0000006e”, “from-trunk,xxxxxxxxxx,1”) in new stack
– Goto (from-trunk,xxxxxxxxxx,1)
– Executing [[email protected]:1] Set(“SIP/Helen-0000006e”, “__FROM_DID=xxxxxxxxxx”) in new stack
– Executing [[email protected]:2] Gosub(“SIP/Helen-0000006e”, “app-blacklist-check,s,1”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/Helen-0000006e”, “0?blacklisted”) in new stack
– Executing [[email protected]:2] Set(“SIP/Helen-0000006e”, “CALLED_BLACKLIST=1”) in new stack
– Executing [[email protected]:3] Return(“SIP/Helen-0000006e”, “”) in new stack
– Executing [[email protected]:3] ExecIf(“SIP/Helen-0000006e”, “0 ?Set(CALLERID(name)=xxxxxxxxxx)”) in new stack
– Executing [[email protected]:4] Set(“SIP/Helen-0000006e”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:5] Set(“SIP/Helen-0000006e”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [[email protected]:6] Goto(“SIP/Helen-0000006e”, “callback,1,1”) in new stack
– Goto (callback,1,1)
– Executing [[email protected]:1] Set(“SIP/Helen-0000006e”, “CALL=xxxxxxxxxx”) in new stack
– Executing [[email protected]:2] Set(“SIP/Helen-0000006e”, “DESTINATION=disa.1.1”) in new stack
– Executing [[email protected]:3] Set(“SIP/Helen-0000006e”, “SLEEP=0”) in new stack
– Executing [[email protected]:4] System(“SIP/Helen-0000006e”, “/var/lib/asterisk/bin/callback xxxxxxxxxx disa.1.1 0 &”) in new stack
– Executing [[email protected]:5] Hangup(“SIP/Helen-0000006e”, “”) in new stack
== Spawn extension (callback, 1, 5) exited non-zero on ‘SIP/Helen-0000006e’
== Manager ‘admin’ logged on from 127.0.0.1
– Executing [[email protected]:1] Macro(“Local/[email protected];2”, “user-callerid,SKIPTTL,”) in new stack
– Executing [[email protected]:1] Set(“Local/[email protected];2”, “AMPUSER=”) in new stack
– Executing [[email protected]:2] GotoIf(“Local/[email protected];2”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [[email protected]:10] GotoIf(“Local/[email protected];2”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] NoOp(“Local/[email protected];2”, “Using CallerID “Callback” <>”) in new stack
– Executing [[email protected]:2] Set(“Local/[email protected];2”, “_NODEST=”) in new stack
– Executing [[email protected]:3] Macro(“Local/[email protected];2”, “record-enable,OUT,”) in new stack
– Executing [[email protected]:1] GotoIf(“Local/[email protected];2”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“Local/[email protected];2”, “1?MacroExit()”) in new stack
– Executing [[email protected]:4] Macro(“Local/[email protected];2”, “dialout-trunk,1,xxxxxxxxxx,”) in new stack
– Executing [[email protected]:1] Set(“Local/[email protected];2”, “DIAL_TRUNK=1”) in new stack
– Executing [[email protected]:2] GosubIf(“Local/[email protected];2”, “0?sub-pincheck,s,1”) in new stack
– Executing [[email protected]:3] GotoIf(“Local/[email protected];2”, “0?disabletrunk,1”) in new stack
– Executing [[email protected]:4] Set(“Local/[email protected];2”, “DIAL_NUMBER=xxxxxxxxxx”) in new stack
– Executing [[email protected]:5] Set(“Local/[email protected];2”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [[email protected]:6] Set(“Local/[email protected];2”, “OUTBOUND_GROUP=OUT_1”) in new stack
– Executing [[email protected]:7] GotoIf(“Local/[email protected];2”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [[email protected]:9] GotoIf(“Local/[email protected];2”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“Local/[email protected];2”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [[email protected]:11] Macro(“Local/[email protected];2”, “outbound-callerid,1”) in new stack
– Executing [[email protected]:1] ExecIf(“Local/[email protected];2”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [[email protected]:2] ExecIf(“Local/[email protected];2”, “1?Set(REALCALLERIDNUM=)”) in new stack
– Executing [[email protected]:3] GotoIf(“Local/[email protected];2”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [[email protected]:6] Set(“Local/[email protected];2”, “USEROUTCID=”) in new stack
– Executing [[email protected]:7] Set(“Local/[email protected];2”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:8] Set(“Local/[email protected];2”, “TRUNKOUTCID=xxxxxxxx”) in new stack
– Executing [[email protected]:9] GotoIf(“Local/[email protected];2”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [[email protected]:12] ExecIf(“Local/[email protected];2”, “1?Set(CALLERID(all)=xxxxxxxx)”) in new stack
– Executing [[email protected]:13] ExecIf(“Local/[email protected];2”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:14] ExecIf(“Local/[email protected];2”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [[email protected]:15] ExecIf(“Local/[email protected];2”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [[email protected]:12] ExecIf(“Local/[email protected];2”, “1?AGI(fixlocalprefix)”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
== fixlocalprefix: Dialpattern XX. matched. xxxxxxxxxx -> xxxxxxxxxx
– <Local/[email protected];2>AGI Script fixlocalprefix completed, returning 0
– Executing [[email protected]:13] Set(“Local/[email protected];2”, “OUTNUM=xxxxxxxxxx”) in new stack
– Executing [[email protected]:14] Set(“Local/[email protected];2”, “custom=SIP/Solutions”) in new stack
– Executing [[email protected]:15] ExecIf(“Local/[email protected];2”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^))”) in new stack
– Executing [[email protected]:16] Macro(“Local/[email protected];2”, “dialout-trunk-predial-hook,”) in new stack
– Executing [[email protected]:1] MacroExit(“Local/[email protected];2”, “”) in new stack
– Executing [[email protected]:17] GotoIf(“Local/[email protected];2”, “0?bypass,1”) in new stack
– Executing [[email protected]:18] GotoIf(“Local/[email protected];2”, “0?customtrunk”) in new stack
– Executing [[email protected]:19] Dial(“Local/[email protected];2”, “SIP/Solutions/xxxxxxxxxx,300,”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called Solutions/xxxxxxxxxx
– SIP/Solutions-0000006f is ringing
– SIP/Solutions-0000006f is making progress passing it to Local/[email protected];2
– SIP/Solutions-0000006f answered Local/[email protected];2
== Manager ‘admin’ logged off from 127.0.0.1
– Executing [[email protected]:1] Set(“Local/[email protected];1”, “_DISA=“disa,1,newcall””) in new stack
– Executing [[email protected]:2] Set(“Local/[email protected];1”, “_DISACONTEXT=customcontext”) in new stack
– Executing [[email protected]:3] Set(“Local/[email protected];1”, “_KEEPCID=TRUE”) in new stack
– Executing [[email protected]:4] Set(“Local/[email protected];1”, “_HANGUP=Hg”) in new stack
– Executing [[email protected]:5] Set(“Local/[email protected];1”, “TIMEOUT(digit)=10”) in new stack
– Digit timeout set to 10.000
– Executing [[email protected]:6] Set(“Local/[email protected];1”, “TIMEOUT(response)=10”) in new stack
– Response timeout set to 10.000
– Executing [[email protected]:7] Set(“Local/[email protected];1”, “CALLERID(all)=0403420075”) in new stack
– Executing [[email protected]:8] DISA(“Local/[email protected];1”, “no-password,disa-dial”) in new stack
– Executing [[email protected]:1] Macro(“Local/[email protected];2”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“Local/[email protected];2”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“Local/[email protected];2”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [[email protected]:7] GotoIf(“Local/[email protected];2”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] Hangup(“Local/[email protected];2”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘Local/[email protected];2’ in macro ‘hangupcall’
== Spawn extension (macro-dialout-trunk, s, 19) exited non-zero on ‘Local/[email protected];2’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, xxxxxxxxxx, 4) exited non-zero on ‘Local/[email protected];2’


With trunk 5 removed.

Connected to Asterisk 1.6.2.10 currently running on Home (pid = 2606)
Verbosity is at least 3
– Remote UNIX connection
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Home*CLI>
Disconnected from Asterisk server
[[email protected] ~]#

What sort of trunks are you using? SIP? Dahdi? IAX?

Tom