<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I need a sanity check if you don’t mind…  I am setting up a stateless proxy for several (separate, not load balanced) Asterisk servers behind Kamailio 4.2 (with domain and dispatcher).  All works as expected except when called party hangs up, as Asterisk seems to address the BYE “To” (that is sent to the calling party) to the originating domain, and not the IP of the UA (as it does in other cases).  When this happens, stateless Kamailio does not seem to know how to route them, which makes sense.  I assume I would need to rewrite the “To” field on BYE message so that it contains the UA’s IP (to match the BYE’s that are routed correctly).  The RURI header contains the IP/port of the UA, so I am attempting to use it and here is where I am stuck…<div class=""><br class=""></div><div class="">Here is the subst from onreply_route:</div><div class=""><br class=""></div><div class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">              </span>    if (is_method("BYE")) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                           </span>xlog("L_NOTICE", "BYE Detected \n");</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                          </span>subst('/^To:(.*)<sip:(.*)@(.*)>(.*)$/To: <<a href="sip:\2@$rd:$rp" class="">sip:\2@$rd:$rp</a>>\4/ig');</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                       </span>}</div><div class=""><br class="webkit-block-placeholder"></div><div class="">
<div style="font-variant-ligatures: normal; font-variant-position: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Here is the “To”:</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div class="">    To: "Test User 2" <<a href="sip:102@zxcv.asdf.qwerty.net" class="">sip:102@zxcv.asdf.qwerty.net</a>>;tag=8AB53900B9646F1DF05330E7FBF846C8  </div><div class=""><br class=""></div><div class="">Any obvious glaring mistakes here?  Would I then need additional logic to forward the BYE on?</div><div class=""><br class=""></div><div class="">My apologies if this is wordy, or nonsensical...</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div></div><br class="Apple-interchange-newline" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">

</div>
<br class=""></div></body></html>