<div dir="ltr">Hello!<div><br></div><div>Our service delivery logic is as follows:<br>Each user has an internal extension, under which there are several devices with their own identifier.<br>With an incoming call to such a subscriber, FreeSWITCH adds custom SIP headers with these device identifiers.<br>Further on these fields the superior Proxy forks legs and then these legs pass through the Sems to become completely separate calls.<br><br>Now there is a task to replace Sems with OpenSIPS.<br></div><div>The script below works fine, but only if the incoming calls are not forked<br></div><div><br></div><div><i>####### Routing Logic ########<br><br>route{<br><br>  if (is_method("INVITE") && !has_totag()) {<br>        b2b_init_request("top hiding");<br>        exit;<br>    }<br>}<br><br>route[b2b_logic_request] {<br>        b2b_pass_request();<br>        exit;<br>}</i><br><br><div>If there is a fork with an answer on some device, then OpenSIPS does not forward the SIP CANCEL (Reason: SIP;cause=200;text="Call completed elsewhere") to the rest and these devices keep ringing until timeout (Reason: SIP;cause=480;text="NO_ANSWER")<br></div><div>Please help understand the nature of this behavior.<br></div><div><br></div><div>version: opensips 3.2.2 (x86_64/linux)<br></div><div><br></div><div><b>Incoming SIP INVITE:</b><br>2021/09/07 11:38:30.737456 <a href="http://192.168.27.84:5060">192.168.27.84:5060</a> -> <a href="http://192.168.27.84:5080">192.168.27.84:5080</a><br>INVITE sip:qq2s92mnbrda@192.168.27.126:5060;transport=udp SIP/2.0<br>Record-Route: <sip:192.168.27.84;lr=on;ftag=3a8gNpgZQ89pj;did=8b.4a4;vst=AAAAAEcYQ0JfBhUaEEoOFQAAAAAAAAAAAAAJBjY-><br>Record-Route: <sip:192.168.27.126;lr=on;did=8b01.a1d4><br>Via: SIP/2.0/UDP 192.168.27.84;branch=z9hG4bKcc18.ec9a363ccc70d07691e11293d160cca6.1<br>Via: SIP/2.0/UDP 192.168.27.126;branch=z9hG4bKcc18.accd8d8bac35ac66a172f6ce173c9a34.0<br>Via: SIP/2.0/UDP 192.168.27.123;received=192.168.27.123;rport=5060;branch=z9hG4bKavcjKF58g9D1e<br>Max-Forwards: 66<br>From: "VOIP" <<a href="mailto:sip%3A5009@192.168.27.123">sip:5009@192.168.27.123</a>>;tag=3a8gNpgZQ89pj<br>To: <<a href="mailto:sip%3Aqq2s92mnbrda@192.168.27.84">sip:qq2s92mnbrda@192.168.27.84</a>><br>Call-ID: 33e8140a-8a62-123a-e1ba-001dd8b71cb2<br>CSeq: 40949963 INVITE<br>Contact: <<a href="http://sip:mod_sofia@192.168.27.123:5060">sip:mod_sofia@192.168.27.123:5060</a>><br>Supported: timer, path, replaces<br>Allow-Events: talk, hold, conference, refer<br>Privacy: none<br>Content-Type: application/sdp<br>Content-Disposition: session<br><br><b>Outgoing SIP INVITE:</b><br>2021/09/07 11:38:30.737938 <a href="http://192.168.27.84:5080">192.168.27.84:5080</a> -> <a href="http://192.168.27.126:5060">192.168.27.126:5060</a><br>INVITE sip:qq2s92mnbrda@192.168.27.126:5060;transport=udp SIP/2.0<br>Via: SIP/2.0/UDP 192.168.27.84:5080;branch=z9hG4bK6ddf.d88b07f2.0<br>To: <a href="http://sip:qq2s92mnbrda@192.168.27.126:5060">sip:qq2s92mnbrda@192.168.27.126:5060</a><br>From: "VOIP" <<a href="mailto:sip%3A5009@192.168.27.123">sip:5009@192.168.27.123</a>>;tag=94fd20254e546fee730f360cf9860800<br>CSeq: 40949964 INVITE<br>Call-ID: B2B.331.6374211.1631007510<br>Max-Forwards: 70<br>Content-Length: 486<br>User-Agent: OpenSIPS (3.2.2 (x86_64/linux))<br>Content-Type: application/sdp<br>Supported: timer, path, replaces<br>P-Asserted-Identity: " VOIP" <<a href="mailto:sip%3A5009@192.168.27.123">sip:5009@192.168.27.123</a>><br>Privacy: none<br>Content-Disposition: session<br>X-Call-ID: 33e8140a-8a62-123a-e1ba-001dd8b71cb2<br>Contact: <<a href="http://sip:5009@192.168.27.84:5080">sip:5009@192.168.27.84:5080</a>><br><br><b>Incoming SIP CANCEL:</b><br>2021/09/07 11:38:33.593381 <a href="http://192.168.27.84:5060">192.168.27.84:5060</a> -> <a href="http://192.168.27.84:5080">192.168.27.84:5080</a><br>CANCEL sip:qq2s92mnbrda@192.168.27.126:5060;transport=udp SIP/2.0<br>Via: SIP/2.0/UDP 192.168.27.84;branch=z9hG4bKcc18.ec9a363ccc70d07691e11293d160cca6.1<br>Max-Forwards: 66<br>From: "VOIP" <<a href="mailto:sip%3A5009@192.168.27.123">sip:5009@192.168.27.123</a>>;tag=3a8gNpgZQ89pj<br>To: <<a href="mailto:sip%3Aqq2s92mnbrda@192.168.27.84">sip:qq2s92mnbrda@192.168.27.84</a>><br>Call-ID: 33e8140a-8a62-123a-e1ba-001dd8b71cb2<br>CSeq: 40949963 CANCEL<br>Content-Length: 0<br>Reason: SIP;cause=200;text="Call completed elsewhere"<br><br><b>Outgoing SIP CANCEL by timeout (with 27 sec delay):</b><br>2021/09/07 11:39:01.100888 <a href="http://192.168.27.84:5080">192.168.27.84:5080</a> -> <a href="http://192.168.27.126:5060">192.168.27.126:5060</a><br>CANCEL sip:qq2s92mnbrda@192.168.27.126:5060;transport=udp SIP/2.0<br>Via: SIP/2.0/UDP 192.168.27.84:5080;branch=z9hG4bK6ddf.d88b07f2.0<br>From: "VOIP" <<a href="mailto:sip%3A5009@192.168.27.123">sip:5009@192.168.27.123</a>>;tag=94fd20254e546fee730f360cf9860800<br>Call-ID: B2B.331.6374211.1631007510<br>To: <a href="http://sip:qq2s92mnbrda@192.168.27.126:5060">sip:qq2s92mnbrda@192.168.27.126:5060</a><br>CSeq: 40949964 CANCEL<br>Max-Forwards: 70<br>Reason: SIP;cause=480;text="NO_ANSWER"<br>User-Agent: OpenSIPS (3.2.2 (x86_64/linux))<br>Content-Length: 0<br></div><div><br></div><div><br></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div><div>BR,</div><div>Denys Pozniak<br></div><div><br></div><div><br></div></div></div></div></div></div>