Dialplan is easy. 9|X.
Sip debug from right before the inbound call:
zgmsvoip01*CLI>
<— SIP read from UDP://10.10.7.41:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK27f96047;rport
From: “Unknown” sip:Unknown@10.10.7.220;tag=as1720426f
To: sip:4500@10.10.7.41;tag=A17084D8-61583069
CSeq: 102 OPTIONS
Call-ID: 2c7b6de43060311c43267f134b426f8e@10.10.7.220
Contact: sip:4500@10.10.7.41
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_670-UA/3.0.3.0401
Content-Length: 0
<------------->
— (10 headers 0 lines) —
Really destroying SIP dialog ‘2c7b6de43060311c43267f134b426f8e@10.10.7.220’ Method: OPTIONS
set_destination: Parsing sip:6038041999@192.168.250.5:5060;transport=udp for address/port to send to
set_destination: set destination to 192.168.250.5, port 5060
Audio is at 10.10.7.220 port 12268
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.250.5:5060:
INVITE sip:6038041999@192.168.250.5:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport
Max-Forwards: 70
From: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
To: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
Contact: sip:6035464702@10.10.7.220
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Require: timer
Session-Expires: 60;refresher=uas
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (Session-Timers)
Content-Type: application/sdp
Content-Length: 270
v=0
o=root 1570455997 1570455997 IN IP4 10.10.7.220
s=Asterisk PBX 1.6.0.9-samy-r27
c=IN IP4 10.10.7.220
t=0 0
m=audio 12268 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
zgmsvoip01*CLI>
<— SIP read from UDP://192.168.250.5:5060 —>
SIP/2.0 420 Bad Extension
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport=5060
From: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
To: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 INVITE
Unsupported: timer
<------------->
— (7 headers 0 lines) —
– Got SIP response 420 “Bad Extension” back from 192.168.250.5
set_destination: Parsing sip:6038041999@192.168.250.5:5060;transport=udp for address/port to send to
set_destination: set destination to 192.168.250.5, port 5060
Transmitting (NAT) to 192.168.250.5:5060:
ACK sip:6038041999@192.168.250.5:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK2257629f;rport
Max-Forwards: 70
From: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
To: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
Contact: sip:6035464702@10.10.7.220
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Content-Length: 0
-- Executing [h@macro-dial:1] Macro("SIP/6035897253-09da8178", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] ResetCDR("SIP/6035897253-09da8178", "vw") in new stack
-- Executing [s@macro-hangupcall:2] NoCDR("SIP/6035897253-09da8178", "") in new stack
-- Executing [s@macro-hangupcall:3] GotoIf("SIP/6035897253-09da8178", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,6)
-- Executing [s@macro-hangupcall:6] GotoIf("SIP/6035897253-09da8178", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] GotoIf("SIP/6035897253-09da8178", "1?theend") in new stack
-- Goto (macro-hangupcall,s,11)
-- Executing [s@macro-hangupcall:11] Hangup("SIP/6035897253-09da8178", "") in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘SIP/6035897253-09da8178’ in macro ‘hangupcall’
== Spawn extension (macro-dial, h, 1) exited non-zero on ‘SIP/6035897253-09da8178’
Scheduling destruction of SIP dialog ‘27af1a02558bbc275ecdb7f2789ca040@10.10.7.220’ in 6400 ms (Method: INVITE)
set_destination: Parsing sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426 for address/port to send to
set_destination: set destination to 10.10.9.79, port 58100
Reliably Transmitting (NAT) to 10.10.9.79:58100:
BYE sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426 SIP/2.0
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK27ec1959;rport
Max-Forwards: 70
From: “GLOBAL NAPS - N” sip:6038041999@10.10.7.220;tag=as495a918c
To: sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426;tag=f4ccb86e
Call-ID: 27af1a02558bbc275ecdb7f2789ca040@10.10.7.220
CSeq: 103 BYE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘SIP/6035897253-09da8178’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘SIP/6035897253-09da8178’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 4702, 1) exited non-zero on ‘SIP/6035897253-09da8178’
zgmsvoip01*CLI>
<— SIP read from UDP://10.10.9.79:58100 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.7.220:5060;branch=z9hG4bK27ec1959;rport=5060
Contact: sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426
To: sip:4702@10.10.9.79:58100;rinstance=a27af9c9b8ac6426;tag=f4ccb86e
From: "GLOBAL NAPS - N"sip:6038041999@10.10.7.220;tag=as495a918c
Call-ID: 27af1a02558bbc275ecdb7f2789ca040@10.10.7.220
CSeq: 103 BYE
User-Agent: X-Lite Beta release 4.0 Beta stamp 54293
Content-Length: 0
<------------->
— (9 headers 0 lines) —
Really destroying SIP dialog ‘27af1a02558bbc275ecdb7f2789ca040@10.10.7.220’ Method: INVITE
Really destroying SIP dialog ‘BW005018422100809-1935807693@64.198.149.134’ Method: ACK
zgmsvoip01*CLI>
<— SIP read from UDP://192.168.250.5:5060 —>
BYE sip:6035464702@10.10.7.220 SIP/2.0
Via: SIP/2.0/UDP 192.168.250.5:5060;branch=z9hG4bK14074i207og06go79100cd00p7me1.1
From: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
To: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 14967645 BYE
Max-Forwards: 46
Content-Length: 0
<------------->
— (8 headers 0 lines) —
<— Transmitting (no NAT) to 192.168.250.5:5060 —>
SIP/2.0 481 Call leg/transaction does not exist
Via: SIP/2.0/UDP 192.168.250.5:5060;branch=z9hG4bK14074i207og06go79100cd00p7me1.1;received=192.168.250.5
From: "GLOBAL NAPS - N"sip:6038041999@192.168.250.5;user=phone;tag=1530546119-1249865418422-
To: ". TYBRIN CORP"sip:6035464702@10.10.7.220;2286057=2286057-fbbohmhbc71t3;tag=as28eb1195
Call-ID: BW005018422100809-1935807693@64.198.149.134
CSeq: 14967645 BYE
User-Agent: Asterisk PBX 1.6.0.9-samy-r27
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces, timer
Content-Length: 0