Engin + Asterisk - Seperating DIDs from To header

Hey Guys

Hoping someone can help me, I have tried everything I can think of.

I have no problems with inbound and outbound calls, can hear everything fine. The issue i’m having is that no matter which of the 10 DIDs I call, they all default to the primary DID and call that ring group… I have set 2 up to extensions, and the other 7 to terminate the call if they are called.

I have researched on end to find a solution to this, but it just doesn’t want to play ball… any help would be greatly appreciated.

have something to this effect in my extensions_custom.conf

[custom-get-did-from-sip]
exten => s,1,Noop(Fixing DID using information from SIP TO header)
exten => s,n,Set(pseudodid=${SIP_HEADER(To)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => s,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => s,n,Goto(from-trunk,${pseudodid},1)

cheers guys :),

Andrew

You provided no info as to what version of FreePBX you are using.

Im using the latest version of AsteriskNOW, not sure where to find the freepbx version information.
Sorry, new to this

Found it, I’m using FreePBX 2.11.0.10

you should probably post a sip debug of an incoming call.

[2013-08-21 18:29:51] VERBOSE[1865][C-00000002] netsock2.c: == Using SIP RTP TOS bits 184
[2013-08-21 18:29:51] VERBOSE[1865][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk-sip-Engin:1] Set(“SIP/Engin-00000004”, “GROUP()=OUT_2”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk-sip-Engin:2] Goto(“SIP/Engin-00000004”, “from-trunk,0399758540,1”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (from-trunk,0399758540,1)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk:1] Set(“SIP/Engin-00000004”, “__FROM_DID=0399758540”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk:2] Set(“SIP/Engin-00000004”, “CDR(did)=0399758540”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk:3] ExecIf(“SIP/Engin-00000004”, “0 ?Set(CALLERID(name)=0413893298)”) in new stack
[2013-08-21 18:29:51] WARNING[2290][C-00000002] func_callerid.c: CALLERPRES is deprecated. Use CALLERID(name-pres) or CALLERID(num-pres) instead.
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk:4] Set(“SIP/Engin-00000004”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk:5] Set(“SIP/Engin-00000004”, “CALLERPRES()=allowed_not_screened”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [0399758540@from-trunk:6] Goto(“SIP/Engin-00000004”, “ext-group,600,1”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (ext-group,600,1)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:1] Macro(“SIP/Engin-00000004”, “user-callerid,”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:1] Set(“SIP/Engin-00000004”, “TOUCH_MONITOR=1377073791.4”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:2] Set(“SIP/Engin-00000004”, “AMPUSER=0413893298”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:3] GotoIf(“SIP/Engin-00000004”, “0?report”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:4] ExecIf(“SIP/Engin-00000004”, “1?Set(REALCALLERIDNUM=0413893298)”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:5] Set(“SIP/Engin-00000004”, “AMPUSER=”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:6] Set(“SIP/Engin-00000004”, “AMPUSERCIDNAME=”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:7] GotoIf(“SIP/Engin-00000004”, “1?report”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (macro-user-callerid,s,13)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:13] GotoIf(“SIP/Engin-00000004”, “0?continue”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:14] Set(“SIP/Engin-00000004”, “__TTL=64”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:15] GotoIf(“SIP/Engin-00000004”, “1?continue”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (macro-user-callerid,s,26)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:26] Set(“SIP/Engin-00000004”, “CALLERID(number)=0413893298”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:27] Set(“SIP/Engin-00000004”, “CALLERID(name)=0413893298”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:28] Set(“SIP/Engin-00000004”, “CDR(cnum)=0413893298”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:29] Set(“SIP/Engin-00000004”, “CDR(cnam)=0413893298”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-user-callerid:30] Set(“SIP/Engin-00000004”, “CHANNEL(language)=en”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:2] Macro(“SIP/Engin-00000004”, “blkvm-setifempty,”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:1] GotoIf(“SIP/Engin-00000004”, “1?init”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (macro-blkvm-setifempty,s,4)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:4] Set(“SIP/Engin-00000004”, “__BLKVM_CHANNEL=SIP/Engin-00000004”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:5] Set(“SIP/Engin-00000004”, “SHARED(BLKVM,SIP/Engin-00000004)=TRUE”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:6] Set(“SIP/Engin-00000004”, “GOSUB_RETVAL=TRUE”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:7] MacroExit(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:3] GotoIf(“SIP/Engin-00000004”, “1?skipov”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (ext-group,600,6)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:6] Set(“SIP/Engin-00000004”, “RRNODEST=”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:7] Set(“SIP/Engin-00000004”, “__NODEST=600”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:8] GosubIf(“SIP/Engin-00000004”, “0?sub-rgsetcid,s,1()”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:9] Gosub(“SIP/Engin-00000004”, “sub-record-check,s,1(rg,600,dontcare)”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:1] Set(“SIP/Engin-00000004”, “REC_POLICY_MODE_SAVE=”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:2] GotoIf(“SIP/Engin-00000004”, “1?check”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (sub-record-check,s,7)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:7] Set(“SIP/Engin-00000004”, “__MON_FMT=wav”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:8] GotoIf(“SIP/Engin-00000004”, “1?next”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (sub-record-check,s,11)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:11] ExecIf(“SIP/Engin-00000004”, “0?Return()”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:12] ExecIf(“SIP/Engin-00000004”, “1?Set(__REC_POLICY_MODE=dontcare)”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:13] GotoIf(“SIP/Engin-00000004”, “0?rg,1”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:14] Set(“SIP/Engin-00000004”, “__REC_STATUS=INITIALIZED”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:15] Set(“SIP/Engin-00000004”, “NOW=1377073791”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:16] Set(“SIP/Engin-00000004”, “__DAY=21”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:17] Set(“SIP/Engin-00000004”, “__MONTH=08”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:18] Set(“SIP/Engin-00000004”, “__YEAR=2013”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:19] Set(“SIP/Engin-00000004”, “__TIMESTR=20130821-182951”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:20] Set(“SIP/Engin-00000004”, “__FROMEXTEN=0413893298”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:21] Set(“SIP/Engin-00000004”, “__CALLFILENAME=rg-600-0413893298-20130821-182951-1377073791.4”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-check:22] Goto(“SIP/Engin-00000004”, “rg,1”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (sub-record-check,rg,1)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [rg@sub-record-check:1] GosubIf(“SIP/Engin-00000004”, “0?record,1(rg,dontcare,0413893298)”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [rg@sub-record-check:2] Return(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:10] Set(“SIP/Engin-00000004”, “RingGroupMethod=ringall”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:11] Macro(“SIP/Engin-00000004”, “dial,20,Ttr,8541-8542”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-dial:1] GotoIf(“SIP/Engin-00000004”, “1?dial”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Goto (macro-dial,s,3)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-dial:3] AGI(“SIP/Engin-00000004”, “dialparties.agi”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: dialparties.agi: Starting New Dialparties.agi
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: dialparties.agi: Caller ID name is ‘0413893298’ number is ‘0413893298’
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: dialparties.agi: Methodology of ring is ‘ringall’
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Added extension 8541 to extension map
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Added extension 8542 to extension map
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Extension 8541 cf is disabled
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Extension 8542 cf is disabled
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Extension 8541 do not disturb is disabled
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Extension 8542 do not disturb is disabled
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: dbset CALLTRACE/8541 to 0413893298
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: dbset CALLTRACE/8542 to 0413893298
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – dialparties.agi: Filtered ARG3: 8541-8542
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] res_agi.c: – <SIP/Engin-00000004>AGI Script dialparties.agi completed, returning 0
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-dial:7] Dial(“SIP/Engin-00000004”, “SIP/8541&SIP/8542,20,TtrM(auto-blkvm)”) in new stack
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] netsock2.c: == Using SIP RTP TOS bits 184
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5
[2013-08-21 18:29:51] WARNING[2290][C-00000002] app_dial.c: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
[2013-08-21 18:29:51] VERBOSE[2290][C-00000002] app_dial.c: – Called SIP/8541
[2013-08-21 18:29:52] VERBOSE[2290][C-00000002] app_dial.c: – SIP/8541-00000005 is ringing
[2013-08-21 18:29:54] VERBOSE[1865][C-00000002] chan_sip.c: – Got SIP response 486 “Busy Here” back from 192.168.1.151:5060
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] app_dial.c: – SIP/8541-00000005 is busy
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] app_dial.c: == Everyone is busy/congested at this time (2:1/0/1)
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-dial:8] Set(“SIP/Engin-00000004”, “DIALSTATUS=BUSY”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-dial:9] GosubIf(“SIP/Engin-00000004”, “0?BUSY,1”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:12] Gosub(“SIP/Engin-00000004”, “sub-record-cancel,s,1()”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-cancel:1] Set(“SIP/Engin-00000004”, “__REC_POLICY_MODE=”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@sub-record-cancel:2] ExecIf(“SIP/Engin-00000004”, “1?Return()”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:13] Set(“SIP/Engin-00000004”, “RingGroupMethod=”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:14] GotoIf(“SIP/Engin-00000004”, “0?nodest”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:15] Set(“SIP/Engin-00000004”, “__NODEST=”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:16] Macro(“SIP/Engin-00000004”, “blkvm-clr,”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-clr:1] Set(“SIP/Engin-00000004”, “SHARED(BLKVM,SIP/Engin-00000004)=”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-clr:2] Set(“SIP/Engin-00000004”, “GOSUB_RETVAL=”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [s@macro-blkvm-clr:3] MacroExit(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [600@ext-group:17] Goto(“SIP/Engin-00000004”, “app-blackhole,hangup,1”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Goto (app-blackhole,hangup,1)
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [hangup@app-blackhole:1] NoOp(“SIP/Engin-00000004”, “Blackhole Dest: Hangup”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: – Executing [hangup@app-blackhole:2] Hangup(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 18:29:54] VERBOSE[2290][C-00000002] pbx.c: == Spawn extension (app-blackhole, hangup, 2) exited non-zero on ‘SIP/Engin-00000004’

I dialed the number ending in 8543 but it defaulted to the main SIP number, I have since discovered that if I change the DID in the SIP Trunk registration then it will default to that line… not really sure what I should be doing, any suggestions? :slight_smile:

That has no SIP debug information.

That’s a dial plan debug not a SIP trace. Check Asterisk documentation for format and syntax of SIP CLI commands.

Turn off dial plan verbosity when debugging SIP to unclutter display.

Your trunk is in from-trunk, if you want to use the custom context you need to update the trunk context name to reflect the name of your custom extensions in your example “custom-get-did-from-sip”

If you look at the custom extension you posted the last line is a goto from-trunk, this passes control back to FreePBX generated dial plan.

<------------->
[2013-08-21 20:19:47] VERBOSE[1849] chan_sip.c: — (14 headers 0 lines) —
[2013-08-21 20:19:47] VERBOSE[1849] chan_sip.c: Really destroying SIP dialog ‘[email protected]:5060’ Method: OPTIONS
[2013-08-21 20:20:01] VERBOSE[1849] chan_sip.c:
<— SIP read from UDP:192.168.1.151:5060 —>

<------------->
[2013-08-21 20:20:13] VERBOSE[1849] chan_sip.c:
<— SIP read from UDP:203.161.160.71:5060 —>
INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKvejgb900982hmg5m84k1.1
From: "0413893298"sip:[email protected];user=phone;tag=SDe4r7e01-699021075-1377158651201-
To: "Andrew Chapman"sip:[email protected]
Call-ID: SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
CSeq: 310816417 INVITE
Contact: sip:SD1o6i6-vv9pmjj9mvp7tbr5iqonkdpvku9rouvrjrdrvorsmqvtoh8gjpv1-6@203.161.160.71:5060;transport=udp
P-Called-Party-ID: sip:[email protected]
Supported: 100rel,timer
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Accept: application/media_control+xml,application/sdp,multipart/mixed
Min-SE: 60
Session-Expires: 1800;refresher=uas
Max-Forwards: 9
Content-Type: application/sdp
Content-Disposition: session;handling=required
Content-Length: 317

v=0
o=BroadWorks 31798833 1 IN IP4 203.161.160.71
s=-
c=IN IP4 203.161.160.71
t=0 0
m=audio 19848 RTP/AVP 18 8 0 101
c=IN IP4 203.161.160.71
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=bsoft: 1 image udptl t38
<------------->
[2013-08-21 20:20:13] VERBOSE[1849] chan_sip.c: — (17 headers 14 lines) —
[2013-08-21 20:20:13] VERBOSE[1849] chan_sip.c: Sending to 203.161.160.71:5060 (no NAT)
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Sending to 203.161.160.71:5060 (no NAT)
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Using INVITE request as basis request - SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found peer ‘Engin’ for ‘0413893298’ from 203.161.160.71:5060
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] netsock2.c: == Using SIP RTP TOS bits 184
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found RTP audio format 18
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found RTP audio format 8
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found RTP audio format 0
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found RTP audio format 101
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found audio description format G729 for ID 18
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found audio description format PCMA for ID 8
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found audio description format PCMU for ID 0
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Found audio description format telephone-event for ID 101
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw|g729)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Peer audio RTP is at port 203.161.160.71:19848
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: Looking for 0399758540 in from-trunk-sip-Engin (domain 192.168.1.166)
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c: list_route: hop: sip:SD1o6i6-vv9pmjj9mvp7tbr5iqonkdpvku9rouvrjrdrvorsmqvtoh8gjpv1-6@203.161.160.71:5060;transport=udp
[2013-08-21 20:20:13] VERBOSE[1849][C-00000002] chan_sip.c:
<— Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKvejgb900982hmg5m84k1.1;received=203.161.160.71;rport=5060
From: "0413893298"sip:[email protected];user=phone;tag=SDe4r7e01-699021075-1377158651201-
To: "Andrew Chapman"sip:[email protected]
Call-ID: SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
CSeq: 310816417 INVITE
Server: FPBX-2.11.0(11.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk-sip-Engin:1] Set(“SIP/Engin-00000004”, “GROUP()=OUT_2”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk-sip-Engin:2] Goto(“SIP/Engin-00000004”, “from-trunk,0399758540,1”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (from-trunk,0399758540,1)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk:1] Set(“SIP/Engin-00000004”, “__FROM_DID=0399758540”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk:2] Set(“SIP/Engin-00000004”, “CDR(did)=0399758540”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk:3] ExecIf(“SIP/Engin-00000004”, “0 ?Set(CALLERID(name)=0413893298)”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk:4] Set(“SIP/Engin-00000004”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk:5] Set(“SIP/Engin-00000004”, “CALLERPRES()=allowed_not_screened”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [0399758540@from-trunk:6] Goto(“SIP/Engin-00000004”, “ext-group,600,1”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (ext-group,600,1)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:1] Macro(“SIP/Engin-00000004”, “user-callerid,”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:1] Set(“SIP/Engin-00000004”, “TOUCH_MONITOR=1377080413.4”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:2] Set(“SIP/Engin-00000004”, “AMPUSER=0413893298”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:3] GotoIf(“SIP/Engin-00000004”, “0?report”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:4] ExecIf(“SIP/Engin-00000004”, “1?Set(REALCALLERIDNUM=0413893298)”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:5] Set(“SIP/Engin-00000004”, “AMPUSER=”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:6] Set(“SIP/Engin-00000004”, “AMPUSERCIDNAME=”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:7] GotoIf(“SIP/Engin-00000004”, “1?report”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (macro-user-callerid,s,13)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:13] GotoIf(“SIP/Engin-00000004”, “0?continue”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:14] Set(“SIP/Engin-00000004”, “__TTL=64”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:15] GotoIf(“SIP/Engin-00000004”, “1?continue”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (macro-user-callerid,s,26)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:26] Set(“SIP/Engin-00000004”, “CALLERID(number)=0413893298”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:27] Set(“SIP/Engin-00000004”, “CALLERID(name)=0413893298”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:28] Set(“SIP/Engin-00000004”, “CDR(cnum)=0413893298”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:29] Set(“SIP/Engin-00000004”, “CDR(cnam)=0413893298”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-user-callerid:30] Set(“SIP/Engin-00000004”, “CHANNEL(language)=en”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:2] Macro(“SIP/Engin-00000004”, “blkvm-setifempty,”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:1] GotoIf(“SIP/Engin-00000004”, “1?init”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (macro-blkvm-setifempty,s,4)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:4] Set(“SIP/Engin-00000004”, “__BLKVM_CHANNEL=SIP/Engin-00000004”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:5] Set(“SIP/Engin-00000004”, “SHARED(BLKVM,SIP/Engin-00000004)=TRUE”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:6] Set(“SIP/Engin-00000004”, “GOSUB_RETVAL=TRUE”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-setifempty:7] MacroExit(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:3] GotoIf(“SIP/Engin-00000004”, “1?skipov”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (ext-group,600,6)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:6] Set(“SIP/Engin-00000004”, “RRNODEST=”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:7] Set(“SIP/Engin-00000004”, “__NODEST=600”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:8] GosubIf(“SIP/Engin-00000004”, “0?sub-rgsetcid,s,1()”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:9] Gosub(“SIP/Engin-00000004”, “sub-record-check,s,1(rg,600,dontcare)”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:1] Set(“SIP/Engin-00000004”, “REC_POLICY_MODE_SAVE=”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:2] GotoIf(“SIP/Engin-00000004”, “1?check”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (sub-record-check,s,7)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:7] Set(“SIP/Engin-00000004”, “__MON_FMT=wav”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:8] GotoIf(“SIP/Engin-00000004”, “1?next”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (sub-record-check,s,11)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:11] ExecIf(“SIP/Engin-00000004”, “0?Return()”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:12] ExecIf(“SIP/Engin-00000004”, “1?Set(__REC_POLICY_MODE=dontcare)”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:13] GotoIf(“SIP/Engin-00000004”, “0?rg,1”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:14] Set(“SIP/Engin-00000004”, “__REC_STATUS=INITIALIZED”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:15] Set(“SIP/Engin-00000004”, “NOW=1377080413”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:16] Set(“SIP/Engin-00000004”, “__DAY=21”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:17] Set(“SIP/Engin-00000004”, “__MONTH=08”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:18] Set(“SIP/Engin-00000004”, “__YEAR=2013”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:19] Set(“SIP/Engin-00000004”, “__TIMESTR=20130821-202013”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:20] Set(“SIP/Engin-00000004”, “__FROMEXTEN=0413893298”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:21] Set(“SIP/Engin-00000004”, “__CALLFILENAME=rg-600-0413893298-20130821-202013-1377080413.4”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-check:22] Goto(“SIP/Engin-00000004”, “rg,1”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (sub-record-check,rg,1)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [rg@sub-record-check:1] GosubIf(“SIP/Engin-00000004”, “0?record,1(rg,dontcare,0413893298)”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [rg@sub-record-check:2] Return(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:10] Set(“SIP/Engin-00000004”, “RingGroupMethod=ringall”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:11] Macro(“SIP/Engin-00000004”, “dial,20,Ttr,8541-8542”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-dial:1] GotoIf(“SIP/Engin-00000004”, “1?dial”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Goto (macro-dial,s,3)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-dial:3] AGI(“SIP/Engin-00000004”, “dialparties.agi”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: dialparties.agi: Starting New Dialparties.agi
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: dialparties.agi: Caller ID name is ‘0413893298’ number is ‘0413893298’
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: dialparties.agi: Methodology of ring is ‘ringall’
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Added extension 8541 to extension map
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Added extension 8542 to extension map
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Extension 8541 cf is disabled
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Extension 8542 cf is disabled
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Extension 8541 do not disturb is disabled
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Extension 8542 do not disturb is disabled
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: dbset CALLTRACE/8541 to 0413893298
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: dbset CALLTRACE/8542 to 0413893298
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – dialparties.agi: Filtered ARG3: 8541-8542
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] res_agi.c: – <SIP/Engin-00000004>AGI Script dialparties.agi completed, returning 0
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-dial:7] Dial(“SIP/Engin-00000004”, “SIP/8541&SIP/8542,20,TtrM(auto-blkvm)”) in new stack
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] netsock2.c: == Using SIP RTP TOS bits 184
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] netsock2.c: == Using SIP RTP CoS mark 5
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c: Really destroying SIP dialog ‘[email protected]:5060’ Method: INVITE
[2013-08-21 20:20:13] WARNING[2370][C-00000002] app_dial.c: Unable to create channel of type ‘SIP’ (cause 20 - Subscriber absent)
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c: Audio is at 19298
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c: Adding codec 100003 (ulaw) to SDP
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c: Adding codec 100004 (alaw) to SDP
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c: Adding non-codec 0x1 (telephone-event) to SDP
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c: Reliably Transmitting (NAT) to 192.168.1.151:5060:
INVITE sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.166:5060;branch=z9hG4bK61a0ffc3;rport
Max-Forwards: 70
From: “0413893298” sip:[email protected];tag=as49a9d2f2
To: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: FPBX-2.11.0(11.5.0)
Date: Wed, 21 Aug 2013 10:20:13 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 259

v=0
o=root 168371142 168371142 IN IP4 192.168.1.166
s=Asterisk PBX 11.5.0
c=IN IP4 192.168.1.166
t=0 0
m=audio 19298 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] app_dial.c: – Called SIP/8541
[2013-08-21 20:20:13] VERBOSE[2370][C-00000002] chan_sip.c:
<— Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKvejgb900982hmg5m84k1.1;received=203.161.160.71;rport=5060
From: "0413893298"sip:[email protected];user=phone;tag=SDe4r7e01-699021075-1377158651201-
To: "Andrew Chapman"sip:[email protected];tag=as543527bb
Call-ID: SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
CSeq: 310816417 INVITE
Server: FPBX-2.11.0(11.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
[2013-08-21 20:20:13] VERBOSE[1849] chan_sip.c:
<— SIP read from UDP:192.168.1.151:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.166:5060;branch=z9hG4bK61a0ffc3;rport=5060
To: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP
From: “0413893298” sip:[email protected];tag=as49a9d2f2
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Content-Length: 0

<------------->
[2013-08-21 20:20:13] VERBOSE[1849] chan_sip.c: — (7 headers 0 lines) —
[2013-08-21 20:20:14] VERBOSE[1849] chan_sip.c:
<— SIP read from UDP:192.168.1.151:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.1.166:5060;branch=z9hG4bK61a0ffc3;rport=5060
Contact: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP
To: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP;tag=c1568354
From: "0413893298"sip:[email protected];tag=as49a9d2f2
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Zoiper for Windows 2.39 r16838
Content-Length: 0

<------------->
[2013-08-21 20:20:14] VERBOSE[1849] chan_sip.c: — (9 headers 0 lines) —
[2013-08-21 20:20:14] VERBOSE[1849][C-00000002] chan_sip.c: list_route: hop: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP
[2013-08-21 20:20:14] VERBOSE[2370][C-00000002] app_dial.c: – SIP/8541-00000005 is ringing
[2013-08-21 20:20:14] VERBOSE[2370][C-00000002] chan_sip.c:
<— Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKvejgb900982hmg5m84k1.1;received=203.161.160.71;rport=5060
From: "0413893298"sip:[email protected];user=phone;tag=SDe4r7e01-699021075-1377158651201-
To: "Andrew Chapman"sip:[email protected];tag=as543527bb
Call-ID: SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
CSeq: 310816417 INVITE
Server: FPBX-2.11.0(11.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5060
Content-Length: 0

<------------>
[2013-08-21 20:20:17] VERBOSE[1849] chan_sip.c:
<— SIP read from UDP:192.168.1.151:5060 —>
SIP/2.0 486 Busy Here
Via: SIP/2.0/UDP 192.168.1.166:5060;branch=z9hG4bK61a0ffc3;rport=5060
To: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP;tag=c1568354
From: "0413893298"sip:[email protected];tag=as49a9d2f2
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Zoiper for Windows 2.39 r16838
Content-Length: 0

<------------->
[2013-08-21 20:20:17] VERBOSE[1849] chan_sip.c: — (8 headers 0 lines) —
[2013-08-21 20:20:17] VERBOSE[1849][C-00000002] chan_sip.c: – Got SIP response 486 “Busy Here” back from 192.168.1.151:5060
[2013-08-21 20:20:17] VERBOSE[1849][C-00000002] chan_sip.c: set_destination: Parsing sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP for address/port to send to
[2013-08-21 20:20:17] VERBOSE[1849][C-00000002] chan_sip.c: set_destination: set destination to 120.148.129.121:5060
[2013-08-21 20:20:17] VERBOSE[1849][C-00000002] chan_sip.c: Transmitting (NAT) to 192.168.1.151:5060:
ACK sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP SIP/2.0
Via: SIP/2.0/UDP 192.168.1.166:5060;branch=z9hG4bK61a0ffc3;rport
Max-Forwards: 70
From: “0413893298” sip:[email protected];tag=as49a9d2f2
To: sip:[email protected]:5060;rinstance=1777570692dd2bff;transport=UDP;tag=c1568354
Contact: sip:[email protected]:5060
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: FPBX-2.11.0(11.5.0)
Content-Length: 0


[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] app_dial.c: – SIP/8541-00000005 is busy
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] app_dial.c: == Everyone is busy/congested at this time (2:1/0/1)
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-dial:8] Set(“SIP/Engin-00000004”, “DIALSTATUS=BUSY”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-dial:9] GosubIf(“SIP/Engin-00000004”, “0?BUSY,1”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:12] Gosub(“SIP/Engin-00000004”, “sub-record-cancel,s,1()”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-cancel:1] Set(“SIP/Engin-00000004”, “__REC_POLICY_MODE=”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@sub-record-cancel:2] ExecIf(“SIP/Engin-00000004”, “1?Return()”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:13] Set(“SIP/Engin-00000004”, “RingGroupMethod=”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:14] GotoIf(“SIP/Engin-00000004”, “0?nodest”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:15] Set(“SIP/Engin-00000004”, “__NODEST=”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:16] Macro(“SIP/Engin-00000004”, “blkvm-clr,”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-clr:1] Set(“SIP/Engin-00000004”, “SHARED(BLKVM,SIP/Engin-00000004)=”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-clr:2] Set(“SIP/Engin-00000004”, “GOSUB_RETVAL=”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [s@macro-blkvm-clr:3] MacroExit(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [600@ext-group:17] Goto(“SIP/Engin-00000004”, “app-blackhole,hangup,1”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Goto (app-blackhole,hangup,1)
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [hangup@app-blackhole:1] NoOp(“SIP/Engin-00000004”, “Blackhole Dest: Hangup”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: – Executing [hangup@app-blackhole:2] Hangup(“SIP/Engin-00000004”, “”) in new stack
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] pbx.c: == Spawn extension (app-blackhole, hangup, 2) exited non-zero on ‘SIP/Engin-00000004’
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] chan_sip.c: Scheduling destruction of SIP dialog ‘SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3’ in 32000 ms (Method: INVITE)
[2013-08-21 20:20:17] VERBOSE[2370][C-00000002] chan_sip.c:
<— Reliably Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 486 Busy here
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKvejgb900982hmg5m84k1.1;received=203.161.160.71;rport=5060
From: "0413893298"sip:[email protected];user=phone;tag=SDe4r7e01-699021075-1377158651201-
To: "Andrew Chapman"sip:[email protected];tag=as543527bb
Call-ID: SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
CSeq: 310816417 INVITE
Server: FPBX-2.11.0(11.5.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

<------------>
[2013-08-21 20:20:17] VERBOSE[1849] chan_sip.c: Really destroying SIP dialog ‘[email protected]:5060’ Method: INVITE
[2013-08-21 20:20:17] VERBOSE[1849] chan_sip.c:
<— SIP read from UDP:203.161.160.71:5060 —>
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKvejgb900982hmg5m84k1.1
CSeq: 310816417 ACK
From: "0413893298"sip:[email protected];user=phone;tag=SDe4r7e01-699021075-1377158651201-
To: "Andrew Chapman"sip:[email protected];tag=as543527bb
Call-ID: SDe4r7e01-8edcf0787e7ad2ee1874529e84760236-au418e3
Max-Forwards: 9
Content-Length: 0

<------------->
[2013-08-21 20:20:17] VERBOSE[1849] chan_sip.c: — (8 headers 0 lines) —

Is this better?

Engin sent in the email that all the DID numbers would be passed through in the To field of the SIP header, this is the exact code I have

[from-trunk-custom] exten => s,1,NoOp(${SIP_HEADER(To)}) exten => s,n,Set(DID=${SIP_HEADER(To)}) exten => s,n,Set(DID=${CUT(DID,:,2)}) exten => s,n,Set(DID=${CUT(DID,@,1)}) exten => s,n,Goto(from-trunk,${DID},1)

It doesn’t seem to add any functionality to it at all.

The DID that I’m dialing should terminate the call right away, however it seems to just send it to the primary SIP DID. So confused haha

do I need multiple trunks for each DID or should all 10 DIDs be able to come in under the 1 trunk as long as they are defined in Inbound Routes?

For almost every carrier all DID’s should come in on same trunk. If you have a separate account for each DID then you will have to have 10 trunks.

Yeah that’s what was confusing me, not really sure how I’m meant to split this up, I tried 3CX and haven’t had the issue, same with miniSIP… I don’t know what setting im missing

FreePBX provides the following context in extensions.conf ‘out of the box’ which should work with most carriers that are sending the DID in the ‘TO’ header.

You should not need to write anything custom unless this doesn’t work, you just choose this as your context in your trunk configuration:

;-------------------------------------------------------------------------------
; from-pstn-to-did:
;
; The context is designed for providers who send the DID in the TO: SIP header
; only. The format of this header is:
;
; To: &lt;sip:[email protected]&gt;
;
; So the DID must be extracted between the sip: and the @, which this does
;
[from-pstn-toheader]
exten => _.,1,Goto(from-pstn,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1)
;-------------------------------------------------------------------------------