Scenario: ----Settings---- # A short description and references: I attach a report with needed configuration files and different perspectives: - an Asterisk CLI view (later ACV). In my scenario "Asterisk" receive the forked call, - an Asterisk Wireshark view (later AWV), and the configuration and "extensions.conf" files. # The file list ................................................................................................................................ ..Asterisk ................................................................................................................................ [incoming-calls] include => full-capabilities exten => 9,1,SayUnixTime() exten => 9,n,Hangup() [full-capabilities] exten => tolegacy,1,Dial(SIP/called,20) exten => tolegacy,n,Hangup() exten => voicemail,1,Voicemail(3542@default) ................................................................................................................................ ..Asterisk ................................................................................................................................ [general] realm=garr.it context=incoming-calls ; incoming calls will be received into incoming-calls context port=5060 ; bindaddr=0.0.0.0 ................................................................................................................................ ..SER route ................................................................................................................................ route{ # for testing purposes, simply okay all REGISTERs if (method=="REGISTER") { log("REGISTER"); sl_send_reply("200", "ok"); break; }; # try these two destinations first in parallel; the second # destination is targeted to sink port — that will make ser # wait until timer hits seturi("sip:tolegacy@Asterisk_IP"); append_branch("sip:voicemail@Asterisk_IP"); # if we do not get a positive reply, continue at reply_route[1] t_on_failure("1"); # forward the request to all destinations in destination set now t_relay(); } failure_route[1] { # forwarding failed — try again at another destination append_branch("sip:tolegacy@Asterisk_IP"); log(1,"first redirection\n"); # if this alternative destination fails too, proceed to reply_route[2] t_on_failure("2"); t_relay(); } failure_route[2] { # try out the last resort destination append_branch("sip:voicemail@Asterisk_IP"); log(1, "second redirection\n"); # we no more call t_on_negative here; if this destination # fails too, transaction will complete t_relay(); } ................................................................................................................................ ----Data captures---- ................................................................................................................................ ................................................................................................................................ ...ACV....For test purposes the "SIP channel" replace a "ZAP" channel (the results don't change if call PSTN endpoint or all SIP endpoint)........................................................................................................... ................................................................................................................................ Asterisk Ready. *CLI> *CLI> *CLI> -- Executing [voicemail@full-capabilities:1] VoiceMail("SIP/called-09ecf3d8", "3542@default") in new stack -- Playing 'vm-intro' (language 'en') == Spawn extension (full-capabilities, voicemail, 1) exited non-zero on 'SIP/called-09ecf3d8' [Jan 27 06:28:44] NOTICE[20781]: chan_sip.c:12817 handle_response_peerpoke: Peer 'called' is now Reachable. (32ms / 2000ms) [Jan 27 06:28:44] NOTICE[20781]: chan_sip.c:12817 handle_response_peerpoke: Peer 'called' is now Reachable. (32ms / 2000ms) *CLI> *CLI> *CLI> *CLI> *CLI> *CLI> *CLI> -- Executing [tolegacy@full-capabilities:1] Dial("SIP/called-09ecf3d8", "SIP/called|20") in new stack -- Called called -- SIP/called-09f24470 is ringing *CLI> core show channels verbose Channel Context Extension Prio State Application Data CallerID Duration Accountcode BridgedTo SIP/called-0 full-capabilities tolegacy 1 Ringing AppDial (Outgoing Line) tolegacy 00:00:06 (None) SIP/called-0 full-capabilities tolegacy 1 Ring Dial SIP/called|20 +390649623542 00:00:06 (None) 2 active channels 1 active call *CLI> *CLI> -- Nobody picked up in 20000 ms -- Executing [tolegacy@full-capabilities:2] Hangup("SIP/called-09ecf3d8", "") in new stack == Spawn extension (full-capabilities, tolegacy, 2) exited non-zero on 'SIP/called-09ecf3d8' ................................................................................................................................ ...AWV ................................................................................................................................ A short signalling diagram Asterisk <-----INVITE tolegacy ---SER Asterisk <-----INVITE voicemial---SER Asterisk ------Trying---tolegacy->SER Asterisk ------Trying--voicemail->SER Asterisk -----Ringing---tolegacy->SER Asterisk -----Declined----------->SER The captured pkts INVITE sip:tolegacy@Asterisk_IP SIP/2.0 Via: SIP/2.0/UDP SER_IP:5068;branch=z9hG4bK6522.e95641d.0 Via: SIP/2.0/UDP UAC_IP:5088;rport=5088;branch=z9hG4bKgbioqqyx Max-Forwards: 70 To: From: "called" ;tag=mrqyz Call-ID: hxfnejodooazkjl@UAC_IP CSeq: 410 INVITE Contact: Content-Type: application/sdp Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE Organization: GARR Supported: replaces,norefersub,100rel User-Agent: Twinkle/1.1 Content-Length: 322 v=0 o=called 1760819494 2067710003 IN IP4 UAC_IP s=- c=IN IP4 UAC_IP t=0 0 m=audio 8052 RTP/AVP 98 97 8 0 3 101 a=rtpmap:98 speex/16000 a=rtpmap:97 speex/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 INVITE sip:voicemail@Asterisk_IP SIP/2.0 Via: SIP/2.0/UDP SER_IP:5068;branch=z9hG4bK6522.e95641d.1 Via: SIP/2.0/UDP UAC_IP:5088;rport=5088;branch=z9hG4bKgbioqqyx Max-Forwards: 70 To: From: "called" ;tag=mrqyz Call-ID: hxfnejodooazkjl@UAC_IP CSeq: 410 INVITE Contact: Content-Type: application/sdp Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE Organization: GARR Supported: replaces,norefersub,100rel User-Agent: Twinkle/1.1 Content-Length: 322 v=0 o=called 1760819494 2067710003 IN IP4 UAC_IP s=- c=IN IP4 UAC_IP t=0 0 m=audio 8052 RTP/AVP 98 97 8 0 3 101 a=rtpmap:98 speex/16000 a=rtpmap:97 speex/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20 SIP/2.0 100 Trying Via: SIP/2.0/UDP SER_IP:5068;branch=z9hG4bK6522.e95641d.0;received=SER_IP Via: SIP/2.0/UDP UAC_IP:5088;rport=5088;branch=z9hG4bKgbioqqyx From: "called" ;tag=mrqyz To: Call-ID: hxfnejodooazkjl@UAC_IP CSeq: 410 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 SIP/2.0 100 Trying Via: SIP/2.0/UDP SER_IP:5068;branch=z9hG4bK6522.e95641d.1;received=SER_IP Via: SIP/2.0/UDP UAC_IP:5088;rport=5088;branch=z9hG4bKgbioqqyx From: "called" ;tag=mrqyz To: Call-ID: hxfnejodooazkjl@UAC_IP CSeq: 410 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 SIP/2.0 180 Ringing Via: SIP/2.0/UDP SER_IP:5068;branch=z9hG4bK6522.e95641d.0;received=SER_IP Via: SIP/2.0/UDP UAC_IP:5088;rport=5088;branch=z9hG4bKgbioqqyx From: "called" ;tag=mrqyz To: ;tag=as7f3210e2 Call-ID: hxfnejodooazkjl@UAC_IP CSeq: 410 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0 SIP/2.0 603 Declined Via: SIP/2.0/UDP SER_IP:5068;branch=z9hG4bK6522.e95641d.0;received=SER_IP Via: SIP/2.0/UDP UAC_IP:5088;rport=5088;branch=z9hG4bKgbioqqyx From: "called" ;tag=mrqyz To: ;tag=as7f3210e2 Call-ID: hxfnejodooazkjl@UAC_IP CSeq: 410 INVITE User-Agent: Asterisk PBX Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY Supported: replaces Contact: Content-Length: 0