I have modify del dialplan:
exten => _X.,1,Dial(SIP/${EXTEN}@SIPtrunkCisco)
same => n,ExecIf($["${DIALSTATUS}" != "ANSWER"]?Dial(SIP/${DEST2}@SIPtrunkCisco,1))
same => n,Hangup
and too the privilege of file call.
but I have always the same problem. ring first 7001, reject the call and not ringing DEST2 but always 7001.
This is log file:
zabbix-asterisk*CLI>
zabbix-asterisk*CLI>
<--- SIP read from UDP:172.31.XX.XX:65271 --->
<------------->
[Oct 28 15:55:47] WARNING[19948]: pbx_spool.c:350 safe_append: Unable to set utime on /var/spool/asterisk/outgoing/phone.call: Operation not permitted
-- Attempting call on local/7001@dialout for application Playback(ProblemGeneric) (Retry 1)
-- Called 7001@dialout
-- Executing [7001@dialout:1] Dial("Local/7001@dialout-00000094;2", "SIP/7001") in new stack
== Using SIP RTP CoS mark 5
We think we can do text
Audio is at 12772
Adding codec slin to SDP
Adding codec ulaw to SDP
Adding codec amr to SDP
Adding codec amrwb to SDP
Adding codec g723 to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g726 to SDP
Adding codec g726aal2 to SDP
Adding codec adpcm to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec lpc10 to SDP
Adding codec g729 to SDP
Adding codec speex to SDP
Adding codec speex to SDP
Adding codec speex to SDP
Adding codec ilbc to SDP
Adding codec g722 to SDP
Adding codec siren7 to SDP
Adding codec siren14 to SDP
Adding codec testlaw to SDP
Adding codec g719 to SDP
Adding codec opus to SDP
Adding codec silk to SDP
Adding codec silk to SDP
Adding codec silk to SDP
Adding codec silk to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 172.31.XX.XX:65271:
INVITE sip:7001@172.31.XX.XX:65271;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK4566dad8;rport
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as31578ec1
To: <sip:7001@172.31.XX.XX:65271;ob>
Contact: <sip:anonymous@192.168.141.26:5060>
Call-ID: 03f3e42c394f9933645e1fbf732205d1@192.168.141.26:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Date: Fri, 28 Oct 2022 15:55:47 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Type: application/sdp
Content-Length: 955
v=0
o=root 937195690 937195690 IN IP4 192.168.141.26
s=Asterisk PBX 13.18.3~dfsg-1ubuntu4
c=IN IP4 192.168.141.26
t=0 0
m=audio 12772 RTP/AVP 10 0 108 109 4 8 3 111 112 5 118 7 18 110 117 119 97 9 102 115 116 107 101
a=rtpmap:10 L16/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:108 AMR/8000
a=rtpmap:109 AMR-WB/16000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:112 AAL2-G726-32/8000
a=rtpmap:5 DVI4/8000
a=rtpmap:118 L16/16000
a=rtpmap:7 LPC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:110 speex/8000
a=rtpmap:117 speex/16000
a=rtpmap:119 speex/32000
a=rtpmap:97 iLBC/8000
a=rtpmap:9 G722/8000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:116 G719/48000
a=fmtp:116 bitrate=64000
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:20
a=sendrecv
---
-- Called SIP/7001
<--- SIP read from UDP:172.31.XX.XX:65271 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.141.26:5060;rport=5060;received=192.168.141.26;branch=z9hG4bK4566dad8
Call-ID: 03f3e42c394f9933645e1fbf732205d1@192.168.141.26:5060
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as31578ec1
To: <sip:7001@172.31.XX.XX;ob>
CSeq: 102 INVITE
Content-Length: 0
<------------->
--- (7 headers 0 lines) ---
<--- SIP read from UDP:172.31.XX.XX:65271 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.141.26:5060;rport=5060;received=192.168.141.26;branch=z9hG4bK4566dad8
Call-ID: 03f3e42c394f9933645e1fbf732205d1@192.168.141.26:5060
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as31578ec1
To: <sip:7001@172.31.XX.XX;ob>;tag=f14c32e23ee142cda8edc49bad2fcd34
CSeq: 102 INVITE
Contact: <sip:7001@172.31.XX.XX:65271;ob>
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
sip_route_dump: route/path hop: <sip:7001@172.31.XX.XX:65271;ob>
-- SIP/7001-0000014e is ringing
-- Local/7001@dialout-00000094;1 is ringing
<--- SIP read from UDP:172.31.XX.XX:65271 --->
SIP/2.0 486 Busy Here
Via: SIP/2.0/UDP 192.168.141.26:5060;rport=5060;received=192.168.141.26;branch=z9hG4bK4566dad8
Call-ID: 03f3e42c394f9933645e1fbf732205d1@192.168.141.26:5060
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as31578ec1
To: <sip:7001@172.31.XX.XX;ob>;tag=f14c32e23ee142cda8edc49bad2fcd34
CSeq: 102 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
<------------->
--- (8 headers 0 lines) ---
-- Got SIP response 486 "Busy Here" back from 172.31.XX.XX:65271
Transmitting (NAT) to 172.31.XX.XX:65271:
ACK sip:7001@172.31.XX.XX:65271;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK4566dad8;rport
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as31578ec1
To: <sip:7001@172.31.XX.XX:65271;ob>;tag=f14c32e23ee142cda8edc49bad2fcd34
Contact: <sip:anonymous@192.168.141.26:5060>
Call-ID: 03f3e42c394f9933645e1fbf732205d1@192.168.141.26:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Content-Length: 0
---
-- SIP/7001-0000014e is busy
== Everyone is busy/congested at this time (1:1/0/0)
-- Executing [7001@dialout:2] ExecIf("Local/7001@dialout-00000094;2", "1?Dial(SIP/0339XXXXXXXX@SIPtrunkCisco,1)") in new stack
== Using SIP RTP CoS mark 5
Really destroying SIP dialog '03f3e42c394f9933645e1fbf732205d1@192.168.141.26:5060' Method: INVITE
We think we can do text
Audio is at 15068
Adding codec slin to SDP
Adding codec ulaw to SDP
Adding codec amr to SDP
Adding codec amrwb to SDP
Adding codec g723 to SDP
Adding codec alaw to SDP
Adding codec gsm to SDP
Adding codec g726 to SDP
Adding codec g726aal2 to SDP
Adding codec adpcm to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec slin to SDP
Adding codec lpc10 to SDP
Adding codec g729 to SDP
Adding codec speex to SDP
Adding codec speex to SDP
Adding codec speex to SDP
Adding codec ilbc to SDP
Adding codec g722 to SDP
Adding codec siren7 to SDP
Adding codec siren14 to SDP
Adding codec testlaw to SDP
Adding codec g719 to SDP
Adding codec opus to SDP
Adding codec silk to SDP
Adding codec silk to SDP
Adding codec silk to SDP
Adding codec silk to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 192.168.71.252:5060:
INVITE sip:0339XXXXXXXX@192.168.71.252 SIP/2.0
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK50059e51;rport
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as76f018f5
To: <sip:0339XXXXXXXX@192.168.71.252>
Contact: <sip:anonymous@192.168.141.26:5060>
Call-ID: 4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Date: Fri, 28 Oct 2022 15:55:50 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Type: application/sdp
Content-Length: 957
v=0
o=root 1203475287 1203475287 IN IP4 192.168.141.26
s=Asterisk PBX 13.18.3~dfsg-1ubuntu4
c=IN IP4 192.168.141.26
t=0 0
m=audio 15068 RTP/AVP 10 0 108 109 4 8 3 111 112 5 118 7 18 110 117 119 97 9 102 115 116 107 101
a=rtpmap:10 L16/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:108 AMR/8000
a=rtpmap:109 AMR-WB/16000
a=rtpmap:4 G723/8000
a=fmtp:4 annexa=no
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:112 AAL2-G726-32/8000
a=rtpmap:5 DVI4/8000
a=rtpmap:118 L16/16000
a=rtpmap:7 LPC/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:110 speex/8000
a=rtpmap:117 speex/16000
a=rtpmap:119 speex/32000
a=rtpmap:97 iLBC/8000
a=rtpmap:9 G722/8000
a=rtpmap:102 G7221/16000
a=fmtp:102 bitrate=32000
a=rtpmap:115 G7221/32000
a=fmtp:115 bitrate=48000
a=rtpmap:116 G719/48000
a=fmtp:116 bitrate=64000
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:20
a=sendrecv
---
-- Called SIP/0339XXXXXXXX@SIPtrunkCisco
<--- SIP read from UDP:192.168.71.252:55938 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK50059e51;rport
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as76f018f5
To: <sip:0339XXXXXXXX@192.168.71.252>
Date: Fri, 28 Oct 2022 15:55:50 GMT
Call-ID: 4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060
CSeq: 102 INVITE
Allow-Events: telephone-event
Server: Cisco-SIPGateway/IOS-15.4.3.M5
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
-- Nobody picked up in 1000 ms
Scheduling destruction of SIP dialog '4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060' in 32000 ms (Method: INVITE)
Reliably Transmitting (NAT) to 192.168.71.252:55938:
CANCEL sip:0339XXXXXXXX@192.168.71.252 SIP/2.0
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK50059e51;rport
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as76f018f5
To: <sip:0339XXXXXXXX@192.168.71.252>
Call-ID: 4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060
CSeq: 102 CANCEL
User-Agent: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Content-Length: 0
---
Scheduling destruction of SIP dialog '4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060' in 32000 ms (Method: INVITE)
-- Executing [7001@dialout:3] Hangup("Local/7001@dialout-00000094;2", "") in new stack
== Spawn extension (dialout, 7001, 3) exited non-zero on 'Local/7001@dialout-00000094;2'
[Oct 28 15:55:51] NOTICE[59680]: pbx_spool.c:447 attempt_thread: Call failed to go through, reason (0) Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)
<--- SIP read from UDP:192.168.71.252:55938 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK50059e51;rport
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as76f018f5
To: <sip:0339XXXXXXXX@192.168.71.252>
Date: Fri, 28 Oct 2022 15:55:51 GMT
Call-ID: 4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060
CSeq: 102 CANCEL
Content-Length: 0
<------------->
--- (8 headers 0 lines) ---
<--- SIP read from UDP:192.168.71.252:55938 --->
SIP/2.0 487 Request Cancelled
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK50059e51;rport
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as76f018f5
To: <sip:0339XXXXXXXX@192.168.71.252>;tag=F3D320C4-1913
Date: Fri, 28 Oct 2022 15:55:51 GMT
Call-ID: 4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060
CSeq: 102 INVITE
Allow-Events: telephone-event
Server: Cisco-SIPGateway/IOS-15.4.3.M5
Reason: Q.850;cause=16
Content-Length: 0
<------------->
--- (11 headers 0 lines) ---
Transmitting (NAT) to 192.168.71.252:55938:
ACK sip:0339XXXXXXXX@192.168.71.252 SIP/2.0
Via: SIP/2.0/UDP 192.168.141.26:5060;branch=z9hG4bK50059e51;rport
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as76f018f5
To: <sip:0339XXXXXXXX@192.168.71.252>;tag=F3D320C4-1913
Contact: <sip:anonymous@192.168.141.26:5060>
Call-ID: 4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.18.3~dfsg-1ubuntu4
Content-Length: 0
---
Scheduling destruction of SIP dialog '4d04741641c6221f0e0cd2ea56756e59@192.168.141.26:5060' in 32000 ms (Method: INVITE)
<--- SIP read from UDP:172.31.XX.XX:65271 --->
<------------->
However, I see that Asterisk after INVITE to DEST2 , send to cancel. Thisis visible too tcpdump:
16:16:24.227124 IP 172.31.XX.XX.65271 > asterisk.sip: SIP: SIP/2.0 100 Trying
16:16:24.227163 IP 172.31.XX.XX.65271 > asterisk.sip: SIP: SIP/2.0 180 Ringing
16:16:27.200552 IP 172.31.XX.XX.65271 > asterisk.sip: SIP: SIP/2.0 486 Busy Here
16:16:27.201065 IP asterisk.sip > 172.31.XX.XX.65271: SIP: ACK sip:7001@172.31.XX.XX:65271;ob SIP/2.0
16:16:27.204072 IP asterisk.sip > 192.168.71.252.sip: SIP: INVITE sip:0339XXXXXXXX@192.168.71.252 SIP/2.0
16:16:27.226634 IP 192.168.71.252.55938 > asterisk.sip: SIP: SIP/2.0 100 Trying
16:16:28.206252 IP asterisk.sip > 192.168.71.252.55938: SIP: CANCEL sip:0339XXXXXXXX@192.168.71.252 SIP/2.0
16:16:28.215007 IP 192.168.71.252.55938 > asterisk.sip: SIP: SIP/2.0 200 OK
16:16:28.215061 IP 192.168.71.252.55938 > asterisk.sip: SIP: SIP/2.0 487 Request Cancelled
16:16:28.215372 IP asterisk.sip > 192.168.71.252.55938: SIP: ACK sip:0339XXXXXXXX@192.168.71.252 SIP/2.0
16:16:32.771045 IP 172.31.XX.XX.65271 > asterisk.sip: SIP