<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Bogdan.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for the help, <span style="font-family: "Courier New", Arial, Helvetica, sans-serif;">
script_trace</span> helps a lot. However, one problem appears to be our Asterisk sending BYEs to the OpenSIPS management IP, rather than the service IP - the other is no BYEs appearing from our upstream provider, so there may yet be some NAT fiddling in the
 network.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is a tcpdump of a short test call from the OpenSIPS host, repeating lines have been cropped.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:20.965341 IP <SUPPLIER_IP_1>.5060 > <OSIPS_SVC_IP>.5060: SIP: INVITE sip:<OUR_DDI>@<OSIPS_SVC_IP> SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:20.976766 IP <OSIPS_SVC_IP>.5060 > <SUPPLIER_IP_1>.5060: SIP: SIP/2.0 100 Giving it a try</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:20.976914 IP <OSIPS_SVC_IP>.5060 > <AST_SVC_IP>.5060: SIP: INVITE sip:<INTERNAL_NO>@<AST_SVC_IP> SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:20.980867 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 100 Trying</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:20.983652 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 180 Ringing</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:20.983956 IP <OSIPS_SVC_IP>.5060 > <SUPPLIER_IP_1>.5060: SIP: SIP/2.0 180 Ringing</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:24.494830 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 200 OK</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:24.512790 IP <OSIPS_SVC_IP>.5060 > <SUPPLIER_IP_1>.5060: SIP: SIP/2.0 200 OK</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:27.994889 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 200 OK</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:27.995144 IP <OSIPS_SVC_IP>.5060 > <SUPPLIER_IP_1>.5060: SIP: SIP/2.0 200 OK</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:31.995201 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 200 OK</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:43.995343 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 200 OK <-- Hangup</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:55.995731 IP <AST_SVC_IP>.5060 > <OSIPS_SVC_IP>.5060: SIP: SIP/2.0 200 OK</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:56.495480 IP <AST_SVC_IP>.5060 > <OSIPS_MGMT_IP>.5060: SIP: BYE sip:<CALLERS_DDI>@<SUPPLIER_IP_2>:5060 SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:37:56.994867 IP <AST_SVC_IP>.5060 > <OSIPS_MGMT_IP>.5060: SIP: BYE sip:<CALLERS_DDI>@<SUPPLIER_IP_2>:5060 SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:38:23.994375 IP <AST_SVC_IP>.5060 > <OSIPS_MGMT_IP>.5060: SIP: BYE sip:<CALLERS_DDI>@<SUPPLIER_IP_2>:5060 SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:38:27.995061 IP <AST_SVC_IP>.5060 > <OSIPS_MGMT_IP>.5060: SIP: BYE sip:<CALLERS_DDI>@<SUPPLIER_IP_2>:5060 SIP/2.0</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
and the headers from an INVITE packet</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
18:44:04.428866 IP <OSIPS_SVC_IP>.5060 > <AST_SVC_IP>.5060: SIP: INVITE sip:<INTERNAL_NO>@<AST_SVC_IP> SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
E..Jb-@.@...%<n.%<n......6+.INVITE sip:<INTERNAL_NO>@<AST_SVC_IP> SIP/2.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Record-Route: <sip:<OSIPS_MGMT_IP>:5060;lr;did=e9f.c2eba4c6></div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Record-Route: <sip:<SUPPLIER_IP_3>;lr;ftag=gK0e701262;did=e9f.85477a97></div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Via: SIP/2.0/UDP <OSIPS_MGMT_IP>:5060;branch=z9hG4bK421c.1ab0cbb5.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Via: SIP/2.0/UDP <SUPPLIER_IP_3>:5060;branch=z9hG4bK421c.ffa73133.0</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Via: SIP/2.0/UDP <SUPPLIER_IP_2>:5060;branch=z9hG4bK0eB8733317d12c9fc4b</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
From: <sip:<CALLERS_DDI>@<SUPPLIER_IP_4>;user=phone>;tag=gK0e701262</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
To: <sip:<OUR_DDI>@<SUPPLIER_IP_3>;user=phone></div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Call-ID: 355393690_100431806@<SUPPLIER_IP_2></div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
CSeq: 493596 INVITE</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Max-Forwards: 68</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Accept: application/sdp, application/isup, application/dtmf, application/dtmf-relay, multipart/mixed</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Contact: <sip:<CALLERS_DDI>4@<SUPPLIER_IP_2>:5060></div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
P-Asserted-Identity: <sip:<CALLERS_DDI>@<SUPPLIER_IP_2>:5060;user=phone></div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
In the configuration I've set:</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
socket=udp:<OSIPS_SVC_IP>:5060 as <OSIPS_MGMT_IP>:5060</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If a call is allowed through the INVITE path I previously posted, a routing block with a variation in the
<span style="font-family: "Courier New", Arial, Helvetica, sans-serif;">$ru</span> value will send it to the appropriate internal host.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
route[ALLOW]{</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
    if ($ru =~ "sip:111[0-9]@*"){</div>
<div style="direction: ltr; font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
            $avp(routegroup) = $(avp(site){s.int});</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
            do_routing($avp(routegroup));</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
            route(REJECT);</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
            exit;</div>
<div style="font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
      }</div>
<div style="direction: ltr; font-family: "Courier New", Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
...</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Does it look like I've misconfigured something, or is Asterisk skipping a host & sending the BYEs to the host one beyond its peer?</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Asterisk has no knowledge of the OpenSIPS management IPs in its configuration.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks again,</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Al.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr;">
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>Bogdan-Andrei Iancu <bogdan@opensips.org><br>
<b>Date: </b>Monday, 2 February 2026 at 9:31 am<br>
<b>To: </b>OpenSIPS users mailling list <users@lists.opensips.org>, Alistair Cleminson <alistair.cleminson@wifinity.co.uk><br>
<b>Subject: </b>Re: [OpenSIPS-Users] Problems passing BYE signal in v3.7<br>
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing">Hi Alistiar,<br>
<br>
The BYE is a sequential/indialog request, so you need to check your script on how these are handled. Usually they are routed via record_route() (if the routing mechanism is used in your cfg). See
<a href="https://github.com/OpenSIPS/opensips/blob/3.6/etc/opensips.cfg#L110" class="moz-txt-link-freetext" originalsrc="https://github.com/OpenSIPS/opensips/blob/3.6/etc/opensips.cfg#L110" data-outlook-id="b5b06d33-670f-42e6-a8c5-0c5d4d9dbfad">
https://github.com/OpenSIPS/opensips/blob/3.6/etc/opensips.cfg#L110</a><br>
<br>
IF you do not understand you cfg flow, maybe you can add this script tracing function on top of your cfg, so you can see how the execution goes step by step via the cfg:
<a href="https://www.opensips.org/Documentation/Script-CoreFunctions-3-6#script_trace" class="moz-txt-link-freetext" originalsrc="https://www.opensips.org/Documentation/Script-CoreFunctions-3-6#script_trace" data-outlook-id="ae7ea6cd-0d42-45e0-9553-62122bd2bc27">
https://www.opensips.org/Documentation/Script-CoreFunctions-3-6#script_trace</a><br>
<br>
Regards,</div>
<pre><div class="moz-signature">Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  <a href="https://www.opensips-solutions.com/" class="moz-txt-link-freetext" originalsrc="https://www.opensips-solutions.com/" data-outlook-id="995035f6-2725-4e8c-a409-c4d15423755c">https://www.opensips-solutions.com</a>
  <a href="https://www.siphub.com/" class="moz-txt-link-freetext" originalsrc="https://www.siphub.com/" data-outlook-id="e5695272-c949-4f19-a5c5-0c9f96175436">https://www.siphub.com</a></div></pre>
<div class="moz-cite-prefix">On 30.01.2026 18:54, Alistair Cleminson wrote:</div>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for the tip, it turns out I'd completely misunderstood the process. This configuration doesn't generate the errors & passes calls:</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<snip></div>
</blockquote>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>johan de clercq <a href="mailto:johan@democon.be" class="moz-txt-link-rfc2396E" data-outlook-id="fd931c9d-e19e-4119-b51a-cd498d234445">
<johan@democon.be></a><br>
<b>Date: </b>Thursday, 29 January 2026 at 9:41 am<br>
<b>To: </b>Alistair Cleminson <a href="mailto:alistair.cleminson@wifinity.co.uk" class="moz-txt-link-rfc2396E" data-outlook-id="9064c5f8-fe11-49d8-8773-61c15fc91691">
<alistair.cleminson@wifinity.co.uk></a><br>
<b>Subject: </b>Re: [OpenSIPS-Users] Problems passing BYE signal in v3.7<br>
<br>
</div>
maybe changing the 2 vars to avp's will fix the issue. 
<div class="moz-cite-prefix" style="direction: ltr;"><br>
</div>
<div class="moz-cite-prefix">On 1/27/26 17:27, Alistair Cleminson wrote:</div>
<blockquote>
<div class="ms-outlook-mobile-reference-message skipProofing" style="font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="text-transform: none;">Hi,</span></div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; text-align: left; text-indent: 0px; text-transform: none; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; text-align: left; text-indent: 0px; text-transform: none; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I've nearly completed the process of upgrading our ancient v1.7 deployment to v3.6. The new deployment is installed on Ubuntu 24.04 from the OpenSIPS repos. These servers are our inbound hand-off from our upstream supplier, they take a call, inspect the called
 number element against the database, and then pass it on to the target system with the internal reference or decline the call.</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; text-align: left; text-indent: 0px; text-transform: none; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="ms-outlook-mobile-reference-message skipProofing" style="direction: ltr; text-align: left; text-indent: 0px; text-transform: none; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<snip></div>
</blockquote>
</div>
</blockquote>
</div>
</body>
</html>