OK, here goes (part 1)
Here is a normal incoming call to the Telco 1 Trunk. This is the working trunk on a private network.
As the call is established near the bottom of the trace, you will find the line
To: called_number The 10.13.154.xxx subnet is on VLan 25 of the NUC NIC and this traffic is routed to the private network gateway.
usn*CLI> sip set debug peer CallPlus
SIP Debugging Enabled for IP: 10.20.60.1
-- Attempting call on Local/s@tc-maint for application NoCDR() (Retry 1)
-- Executing [s@tc-maint:1] NoCDR("Local/s@tc-maint-0001444d;2", "") in new stack
-- Executing [s@tc-maint:2] Set("Local/s@tc-maint-0001444d;2", "TCMAINT=RETURN") in new stack
-- Executing [s@tc-maint:3] Gosub("Local/s@tc-maint-0001444d;2", "timeconditions,1,1()") in new stack
-- Executing [1@timeconditions:1] Set("Local/s@tc-maint-0001444d;2", "DB(TC/1/INUSESTATE)=INUSE") in new stack
-- Executing [1@timeconditions:2] Set("Local/s@tc-maint-0001444d;2", "DB(TC/1/NOT_INUSESTATE)=NOT_INUSE") in new stack
-- Executing [1@timeconditions:3] GotoIfTime("Local/s@tc-maint-0001444d;2", "08:00-16:30,mon-fri,,?truestate") in new stack
-- Executing [1@timeconditions:4] GotoIf("Local/s@tc-maint-0001444d;2", "0?truegoto") in new stack
-- Executing [1@timeconditions:5] ExecIf("Local/s@tc-maint-0001444d;2", "0?Set(DB(TC/1)=)") in new stack
-- Executing [1@timeconditions:6] Set("Local/s@tc-maint-0001444d;2", "DEVICE_STATE(Custom:TC1)=INUSE") in new stack
-- Executing [1@timeconditions:7] ExecIf("Local/s@tc-maint-0001444d;2", "0?Set(NOT_INUSE)") in new stack
-- Executing [1@timeconditions:8] GotoIf("Local/s@tc-maint-0001444d;2", "0?ext-queues,9100,1") in new stack
-- Executing [1@timeconditions:9] Set("Local/s@tc-maint-0001444d;2", "TCSTATE=false") in new stack
-- Executing [1@timeconditions:10] Set("Local/s@tc-maint-0001444d;2", "TCOVERRIDE=false") in new stack
-- Executing [1@timeconditions:11] Return("Local/s@tc-maint-0001444d;2", "") in new stack
-- Executing [s@tc-maint:4] System("Local/s@tc-maint-0001444d;2", "/var/lib/asterisk/bin/schedtc.php 60 /var/spool/asterisk/outgoing 1") in new stack
-- Executing [s@tc-maint:5] Answer("Local/s@tc-maint-0001444d;2", "") in new stack
Channel Local/s@tc-maint-0001444d;1 was answered.
Launching NoCDR() on Local/s@tc-maint-0001444d;1
[2015-12-13 16:52:00] NOTICE[18313]: pbx_spool.c:402 attempt_thread: Call completed to Local/s@tc-maint
== Spawn extension (tc-maint, s, 5) exited non-zero on 'Local/s@tc-maint-0001444d;2'
<--- SIP read from UDP:10.20.60.1:5060 ---> v=0 <--- Transmitting (no NAT) to 10.20.60.1:5060 ---> <------------> <--- Reliably Transmitting (no NAT) to 10.20.60.1:5060 ---> v=0 <------------> <--- SIP read from UDP:10.20.60.1:5060 ---> <-------------> 0xb2b47708 -- Probation passed - setting RTP source address to 10.20.60.1:15194 <--- SIP read from UDP:10.20.60.1:5060 ---> <-------------> <--- Transmitting (no NAT) to 10.20.60.1:5060 ---> <------------>
INVITE sip:called_number@10.13.154.157:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.20.60.1:5060;branch=z9hG4bKd5f9hd301omgaokei491.1
From: my_phone number phone _number@10.20.60.1:5060;user=phone>;tag=1449979963
To: called_number
Call-ID: 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
CSeq: 1 INVITE
Max-Forwards: 68
Supported: timer
Session-Expires: 1800
Min-SE: 1800
Contact:
Allow: INVITE,ACK,PRACK,SUBSCRIBE,BYE,CANCEL,NOTIFY,INFO,REFER,UPDATE
P-Asserted-Identity: my_phone number phone _number@10.20.60.1;user=phone>
Content-Type: application/sdp
Content-Length: 409
P-hint: outbound
o=- 3349705 0 IN IP4 10.20.60.1
s=Cisco SDP 0
c=IN IP4 10.20.60.1
t=0 0
m=audio 15194 RTP/AVP 8 18 0 101 100
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:100 X-NSE/8000
a=fmtp:100 192-194,200-202
a=X-sqn:0
a=X-cap: 1 audio RTP/AVP 100
a=X-cpar: a=rtpmap:100 X-NSE/8000
a=X-cpar: a=fmtp:100 192-194,200-202
a=X-cap: 2 image udptl t38
<------------->
--- (16 headers 17 lines) ---
Sending to 10.20.60.1:5060 (no NAT)
Sending to 10.20.60.1:5060 (no NAT)
Using INVITE request as basis request - 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
Found peer 'CallPlus' for 'my_phone _number' from 10.20.60.1:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 101
Found RTP audio format 100
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Found unknown media description format X-NSE for ID 100
Capabilities: us - (ulaw|alaw|g722), peer - audio=(ulaw|alaw|g729)/video=(nothing)/text=(nothing), combined - (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.20.60.1:15194
Looking for called_number in from-trunk (domain 10.13.154.157)
list_route: hop:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.20.60.1:5060;branch=z9hG4bKd5f9hd301omgaokei491.1;received=10.20.60.1
From: my_phone number phone _number@10.20.60.1:5060;user=phone>;tag=1449979963
To: called_number
Call-ID: 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
CSeq: 1 INVITE
Server: FPBX-12.0.65(11.17.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact:
Content-Length: 0
-- Executing [called_number@from-trunk:1] Set("SIP/CallPlus-000090f5", "_FROMDID=called_number") in new stack
-- Executing [called_number@from-trunk:2] Set("SIP/CallPlus-000090f5", "CHANNEL(language)=en_NZ") in new stack
-- Executing [called_number@from-trunk:3] Gosub("SIP/CallPlus-000090f5", "app-blacklist-check,s,1()") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/CallPlus-000090f5", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/CallPlus-000090f5", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/CallPlus-000090f5", "") in new stack
-- Executing [called_number@from-trunk:4] Set("SIP/CallPlus-000090f5", "CDR(did)=called_number") in new stack
-- Executing [called_number@from-trunk:5] ExecIf("SIP/CallPlus-000090f5", "0 ?Set(CALLERID(name)=my_phone _number)") in new stack
-- Executing [called_number@from-trunk:6] Set("SIP/CallPlus-000090f5", "CHANNEL(musicclass)=Maxicom") in new stack
-- Executing [called_number@from-trunk:7] Set("SIP/CallPlus-000090f5", "__MOHCLASS=Maxicom") in new stack
[2015-12-13 16:52:20] WARNING[18327][C-00012ac4]: func_channel.c:538 func_channel_read: Unknown or unavailable item requested: 'reversecharge'
-- Executing [called_number@from-trunk:8] GotoIf("SIP/CallPlus-000090f5", "0?macro-hangupcall") in new stack
-- Executing [called_number@from-trunk:9] Set("SIP/CallPlus-000090f5", "_CALLINGPRESSV=allowed_not_screened") in new stack
-- Executing [called_number@from-trunk:10] Set("SIP/CallPlus-000090f5", "CALLERPRES()=allowed_not_screened") in new stack
-- Executing [called_number@from-trunk:11] Goto("SIP/CallPlus-000090f5", "app-setcid,96,1") in new stack
-- Goto (app-setcid,96,1)
-- Executing [96@app-setcid:1] NoOp("SIP/CallPlus-000090f5", "(*DDI 95) Changing cid to called_number ") in new stack
-- Executing [96@app-setcid:2] Set("SIP/CallPlus-000090f5", "CALLERID(name)=called_number") in new stack
-- Executing [96@app-setcid:3] Set("SIP/CallPlus-000090f5", "CALLERID(num)=my_phone _number") in new stack
-- Executing [96@app-setcid:4] Goto("SIP/CallPlus-000090f5", "ext-local,vmu395,1") in new stack
-- Goto (ext-local,vmu395,1)
-- Executing [vmu395@ext-local:1] Macro("SIP/CallPlus-000090f5", "vm,395,NOANSWER,") in new stack
-- Executing [s@macro-vm:1] Macro("SIP/CallPlus-000090f5", "user-callerid,SKIPTTL") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/CallPlus-000090f5", "TOUCH_MONITOR=1449978740.203163") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/CallPlus-000090f5", "AMPUSER=my_phone _number") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/CallPlus-000090f5", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("SIP/CallPlus-000090f5", "1?Set(REALCALLERIDNUM=my_phone _number)") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/CallPlus-000090f5", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/CallPlus-000090f5", "0?limit") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/CallPlus-000090f5", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:8] GotoIf("SIP/CallPlus-000090f5", "1?report") in new stack
-- Goto (macro-user-callerid,s,16)
-- Executing [s@macro-user-callerid:16] GotoIf("SIP/CallPlus-000090f5", "1?continue") in new stack
-- Goto (macro-user-callerid,s,30)
-- Executing [s@macro-user-callerid:30] Set("SIP/CallPlus-000090f5", "CALLERID(number)=my_phone _number") in new stack
-- Executing [s@macro-user-callerid:31] Set("SIP/CallPlus-000090f5", "CALLERID(name)=called_number") in new stack
-- Executing [s@macro-user-callerid:32] Set("SIP/CallPlus-000090f5", "CDR(cnum)=my_phone _number") in new stack
-- Executing [s@macro-user-callerid:33] Set("SIP/CallPlus-000090f5", "CDR(cnam)=called_number") in new stack
-- Executing [s@macro-user-callerid:34] Set("SIP/CallPlus-000090f5", "CHANNEL(language)=en_NZ") in new stack
-- Executing [s@macro-vm:2] Set("SIP/CallPlus-000090f5", "VMGAIN=g(12)") in new stack
-- Executing [s@macro-vm:3] Macro("SIP/CallPlus-000090f5", "blkvm-check,") in new stack
-- Executing [s@macro-blkvm-check:1] Set("SIP/CallPlus-000090f5", "GOSUB_RETVAL=") in new stack
-- Executing [s@macro-blkvm-check:2] ExecIf("SIP/CallPlus-000090f5", "0?Set(GOSUB_RETVAL=TRUE)") in new stack
-- Executing [s@macro-blkvm-check:3] MacroExit("SIP/CallPlus-000090f5", "") in new stack
-- Executing [s@macro-vm:4] GotoIf("SIP/CallPlus-000090f5", "1?vmx,1") in new stack
-- Goto (macro-vm,vmx,1)
-- Executing [vmx@macro-vm:1] Set("SIP/CallPlus-000090f5", "MEXTEN=395") in new stack
-- Executing [vmx@macro-vm:2] Set("SIP/CallPlus-000090f5", "MMODE=NOANSWER") in new stack
-- Executing [vmx@macro-vm:3] Set("SIP/CallPlus-000090f5", "RETVM=") in new stack
-- Executing [vmx@macro-vm:4] Set("SIP/CallPlus-000090f5", "MODE=unavail") in new stack
-- Executing [vmx@macro-vm:5] Macro("SIP/CallPlus-000090f5", "get-vmcontext,395") in new stack
-- Executing [s@macro-get-vmcontext:1] Set("SIP/CallPlus-000090f5", "VMCONTEXT=default") in new stack
-- Executing [s@macro-get-vmcontext:2] GotoIf("SIP/CallPlus-000090f5", "0?200:300") in new stack
-- Goto (macro-get-vmcontext,s,300)
-- Executing [s@macro-get-vmcontext:300] NoOp("SIP/CallPlus-000090f5", "") in new stack
-- Executing [vmx@macro-vm:6] Set("SIP/CallPlus-000090f5", "MODE=unavail") in new stack
-- Executing [vmx@macro-vm:7] NoOp("SIP/CallPlus-000090f5", "MODE IS: unavail") in new stack
-- Executing [vmx@macro-vm:8] GotoIf("SIP/CallPlus-000090f5", "0?chknomsg") in new stack
-- Executing [vmx@macro-vm:9] Set("SIP/CallPlus-000090f5", "VM_OPTS=") in new stack
-- Executing [vmx@macro-vm:10] GotoIf("SIP/CallPlus-000090f5", "0?s-NOANSWER,1") in new stack
-- Executing [vmx@macro-vm:11] GotoIf("SIP/CallPlus-000090f5", "1?notdirect") in new stack
-- Goto (macro-vm,vmx,13)
-- Executing [vmx@macro-vm:13] NoOp("SIP/CallPlus-000090f5", "Checking if ext 395 is enabled: enabled") in new stack
-- Executing [vmx@macro-vm:14] GotoIf("SIP/CallPlus-000090f5", "0?s-NOANSWER,1") in new stack
-- Executing [vmx@macro-vm:15] GotoIf("SIP/CallPlus-000090f5", "1?nofile") in new stack
-- Goto (macro-vm,vmx,56)
-- Executing [vmx@macro-vm:56] NoOp("SIP/CallPlus-000090f5", "File for mode: unavail does not exist, SYSTEMSTATUS: , going to normal voicemail") in new stack
-- Executing [vmx@macro-vm:57] Goto("SIP/CallPlus-000090f5", "s-NOANSWER,1") in new stack
-- Goto (macro-vm,s-NOANSWER,1)
-- Executing [s-NOANSWER@macro-vm:1] Macro("SIP/CallPlus-000090f5", "get-vmcontext,395") in new stack
-- Executing [s@macro-get-vmcontext:1] Set("SIP/CallPlus-000090f5", "VMCONTEXT=default") in new stack
-- Executing [s@macro-get-vmcontext:2] GotoIf("SIP/CallPlus-000090f5", "0?200:300") in new stack
-- Goto (macro-get-vmcontext,s,300)
-- Executing [s@macro-get-vmcontext:300] NoOp("SIP/CallPlus-000090f5", "") in new stack
-- Executing [s-NOANSWER@macro-vm:2] VoiceMail("SIP/CallPlus-000090f5", "395@default,ug(12)") in new stack
Audio is at 36030
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.20.60.1:5060;branch=z9hG4bKd5f9hd301omgaokei491.1;received=10.20.60.1
From: my_phone number phone _number@10.20.60.1:5060;user=phone>;tag=1449979963
To: called_number ;tag=as065b84ca
Call-ID: 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
CSeq: 1 INVITE
Server: FPBX-12.0.65(11.17.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact:
Content-Type: application/sdp
Require: timer
Content-Length: 260
o=root 901962426 901962426 IN IP4 10.13.154.157
s=Asterisk PBX 11.17.1
c=IN IP4 10.13.154.157
t=0 0
m=audio 36030 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
ACK sip:called_number@10.13.154.157:5060 SIP/2.0
Via: SIP/2.0/UDP 10.20.60.1:5060;branch=z9hG4bKfl2hn800380g8rs2m2s1.1
From: my_phone number phone _number@10.20.60.1:5060;user=phone>;tag=1449979963
To: called_number ;tag=as065b84ca
Call-ID: 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
CSeq: 1 ACK
Max-Forwards: 68
Content-Length: 0
--- (8 headers 0 lines) ---
-- Playing 'vm-theperson.gsm' (language 'en_NZ')
[2015-12-13 16:52:20] NOTICE[18327][C-00012ac4]: channel.c:4301 _astread: Dropping incompatible voice frame on SIP/CallPlus-000090f5 of format ulaw since our native format has changed to (alaw)
-- Playing 'digits/3.gsm' (language 'en_NZ')
-- Playing 'digits/9.gsm' (language 'en_NZ')
-- Playing 'digits/5.gsm' (language 'en_NZ')
[2015-12-13 16:52:23] NOTICE[2507]: chan_sip.c:29710 sip_poke_peer: Still have a QUALIFY dialog active, deleting
-- Playing 'vm-isunavail.gsm' (language 'en_NZ')
[2015-12-13 16:52:24] NOTICE[2507]: chan_sip.c:29710 sip_poke_peer: Still have a QUALIFY dialog active, deleting
-- Playing 'vm-intro.gsm' (language 'en_NZ')
BYE sip:called_number@10.13.154.157:5060 SIP/2.0
Via: SIP/2.0/UDP 10.20.60.1:5060;branch=z9hG4bKfl2hn800380g8rs2m2s1cd0000010.1
From: my_phone number phone _number@10.20.60.1:5060;user=phone>;tag=1449979963
To: called_number ;tag=as065b84ca
Call-ID: 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
CSeq: 2 BYE
Max-Forwards: 68
Supported: timer
Content-Length: 0
--- (9 headers 0 lines) ---
Sending to 10.20.60.1:5060 (no NAT)
Scheduling destruction of SIP dialog '63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3' in 6400 ms (Method: BYE)
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.20.60.1:5060;branch=z9hG4bKfl2hn800380g8rs2m2s1cd0000010.1;received=10.20.60.1
From: my_phone number phone _number@10.20.60.1:5060;user=phone>;tag=1449979963
To: called_number ;tag=as065b84ca
Call-ID: 63cf545a-3575bb84-3be08a9c-7a19@172.30.255.3
CSeq: 2 BYE
Server: FPBX-12.0.65(11.17.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
== Spawn extension (macro-vm, s-NOANSWER, 2) exited non-zero on 'SIP/CallPlus-000090f5' in macro 'vm'
== Spawn extension (ext-local, vmu395, 1) exited non-zero on 'SIP/CallPlus-000090f5'
-- Executing [h@ext-local:1] Macro("SIP/CallPlus-000090f5", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] ExecIf("SIP/CallPlus-000090f5", "0?Set(CDR(recordingfile)=.)") in new stack
-- Executing [s@macro-hangupcall:2] GotoIf("SIP/CallPlus-000090f5", "1?theend") in new stack
-- Goto (macro-hangupcall,s,4)
-- Executing [s@macro-hangupcall:4] Hangup("SIP/CallPlus-000090f5", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/CallPlus-000090f5' in macro 'hangupcall'
== Spawn extension (ext-local, h, 1) exited non-zero on 'SIP/CallPlus-000090f5'
usn*CLI> sip set debug off
SIP Debugging Disabled
usn*CLI>