<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
The BYE should have a Route header, which is used for routing. If it
does not have a Route header, the UA originating the BYE must be fixed.
Of course, you can hack the BYE by doing the same kind of alias
rewriting as the INVITE, but it is not RFC-compliant.<br>
g-)<br>
<br>
Jeremy A wrote:
<blockquote cite="mid:474DF0BE.1020600@electrosilk.net" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Greger Viken Teigre wrote:
  <blockquote cite="mid:200711280911.lAS9BrPw006253@pontius.teigre.com"
 type="cite">
    <pre wrap="">If you have alias=ip-of-ser in your config, ACK with port 5070 in ruri will match uri==myself.
The ACK should just be relayed.
See example cfg for ser used for sems for an example.
g-)

  </pre>
  </blockquote>
Unfortunately I am still quite puzzled by the SER configuration
process, so I have not been able to work out exactly what to do. The
ser/sems example uses pipes which doesn't help.<br>
  <br>
So far I have simply added a clause to always forward ACK packets. This
is not sufficient.<br>
  <br>
The ACK gets through but now the BYE command gets rejected 404 not
found on the user location lookup. I think this is caused by the
aliases involved in the call ?<br>
  <br>
(Call is dialled as <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated" href="mailto:2311@fesa.sto">2311@fesa.sto</a>.
It gets reformed to
  <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:1001@butler.fesa.sto">1001@butler.fesa.sto</a> and passed
to the SER proxy for butler.fesa.sto.
SER knows 1001 is an alias of registered user 1009 and sends the call
to the user)<br>
  <br>
Here is a log of a call made on the SER machine butler.fesa.sto<br>
  <tt><br>
&nbsp;25.202593&nbsp; 10.50.32.10 -&gt; 127.0.0.1&nbsp;&nbsp;&nbsp; SIP Request: REGISTER
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:localhost.localdomain">sip:localhost.localdomain</a>&nbsp;&nbsp; &nbsp;&nbsp;
&lt;-- my application registering<br>
&nbsp;25.213719&nbsp;&nbsp;&nbsp; 127.0.0.1 -&gt; 10.50.32.10&nbsp; SIP Status: 200 OK&nbsp;&nbsp;&nbsp; (1
bindings)<br>
&nbsp;75.234982&nbsp;&nbsp; 10.1.39.10 -&gt; 10.50.32.10&nbsp; SIP/SDP Request: INVITE
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:1001@butler.fesa.sto;transport=udp">sip:1001@butler.fesa.sto;transport=udp</a>,
with session description&nbsp;&nbsp;
&lt;-- invite to alias<br>
&nbsp;75.255551&nbsp; 10.50.32.10 -&gt; 10.1.39.10&nbsp;&nbsp; SIP Status: 100 trying --
your call is important to us<br>
&nbsp;75.255867&nbsp; 10.50.32.10 -&gt; 10.50.32.10&nbsp; SIP/SDP Request: INVITE
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:1009@10.50.32.10:5070;LINEID=1d5a67e38809">sip:1009@10.50.32.10:5070;LINEID=1d5a67e38809</a>,
with session
description&nbsp;&nbsp; &lt;-- Alias resolved and invite passed to registered
phone<br>
&nbsp;75.266591&nbsp; 10.50.32.10 -&gt; 10.50.32.10&nbsp; SIP Status: 100 Trying<br>
&nbsp;75.576971&nbsp; 10.50.32.10 -&gt; 10.50.32.10&nbsp; SIP Status: 180 Ringing<br>
&nbsp;75.578869&nbsp; 10.50.32.10 -&gt; 10.1.39.10&nbsp;&nbsp; SIP Status: 180 Ringing<br>
&nbsp;77.632370&nbsp; 10.50.32.10 -&gt; 10.50.32.10&nbsp; SIP/SDP Status: 200 OK, with
session description<br>
&nbsp;77.727289&nbsp; 10.50.32.10 -&gt; 10.1.39.10&nbsp;&nbsp; SIP/SDP Status: 200 OK, with
session description<br>
&nbsp;77.745453&nbsp;&nbsp; 10.1.39.10 -&gt; 10.50.32.10&nbsp; SIP Request: ACK
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:2311@10.50.32.10:5070;LINEID=1d5a67e38809">sip:2311@10.50.32.10:5070;LINEID=1d5a67e38809</a>&nbsp;&nbsp;
&lt;-- ACK referencing
originally dialed extension<br>
&nbsp;77.746574&nbsp; 10.50.32.10 -&gt; 10.50.32.10&nbsp; SIP Request: ACK
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:2311@10.50.32.10:5070;LINEID=1d5a67e38809">sip:2311@10.50.32.10:5070;LINEID=1d5a67e38809</a><br>
&nbsp;82.562176&nbsp;&nbsp; 10.1.39.10 -&gt; 10.50.32.10&nbsp; SIP Request: BYE
  <a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="sip:2311@10.50.32.10:5070;LINEID=1d5a67e38809">sip:2311@10.50.32.10:5070;LINEID=1d5a67e38809</a>&nbsp;&nbsp;
&lt;--- BYE referencing
originally dialed extension<br>
&nbsp;82.563999&nbsp; 10.50.32.10 -&gt; 10.1.39.10&nbsp;&nbsp; SIP Status: 404 SER says Not
Found<br>
  </tt><br>
I am guessing (not being an expert in SIP) that the line ID <tt>LINEID=1d5a67e38809
  </tt>allows SER to route the call to the correct extension despite
the
difference in SIP URI?<br>
  <br>
So I guess I need a bit of code that says that matches an existing
LINEID and forwards the SIP message to the end user?<br>
  <br>
Here is the current routing logic based on the textdb example but with
always forward ACK<br>
  <br>
  <tt><br>
# main routing logic<br>
  <br>
route{<br>
&nbsp;&nbsp;&nbsp; # initial sanity checks -- messages with<br>
&nbsp;&nbsp;&nbsp; # max_forwards==0, or excessively long requests<br>
  <br>
&nbsp;&nbsp;&nbsp; if (!mf_process_maxfwd_header("10")) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("483","SER says Too Many Hops");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; if (msg:len &gt;=&nbsp; max_len ) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("513", "SER says Message too big");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp; # we record-route all messages -- to make sure that<br>
&nbsp;&nbsp;&nbsp; # subsequent messages will go through our proxy; that's<br>
&nbsp;&nbsp;&nbsp; # particularly good if upstreami and downstreami entities<br>
&nbsp;&nbsp;&nbsp; # use different transport protocol<br>
  <br>
&nbsp;&nbsp;&nbsp; if (!method=="REGISTER") record_route();<br>
  <br>
&nbsp;&nbsp;&nbsp; # subsequent messages withing a dialogue should take the<br>
&nbsp;&nbsp;&nbsp; # path determined by record-routing<br>
  <br>
&nbsp;&nbsp;&nbsp; if (loose_route()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mark routing logic in request<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf("P-hint: rr-enforced\r\n");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp; if (!uri==myself) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # mark routing logic in request<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf("P-hint: outbound\r\n");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp; # if the request is for other domain use UsrLoc<br>
&nbsp;&nbsp;&nbsp; # (in case, it does not work, use the following command<br>
&nbsp;&nbsp;&nbsp; # with proper names and addresses in it)<br>
  <br>
&nbsp;&nbsp;&nbsp; if (uri==myself) {<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method=="REGISTER") {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # digest authentication<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!www_authorize("", "subscriber")) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; www_challenge("", "0");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; save("location");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (method=="ACK") {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lookup("aliases");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!uri==myself) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; append_hf("P-hint: outbound alias\r\n");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route(1);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # native SIP destinations are handled using our USRLOC DB<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!lookup("location")) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_send_reply("404", "SER says Not Found");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp; append_hf("P-hint: usrloc applied\r\n");<br>
&nbsp;&nbsp;&nbsp; route(1);<br>
}<br>
  <br>
route[1]<br>
{<br>
&nbsp;&nbsp;&nbsp; # send it out now; use stateful forwarding as it works reliably<br>
&nbsp;&nbsp;&nbsp; # even for UDP2TCP<br>
&nbsp;&nbsp;&nbsp; if (!t_relay()) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sl_reply_error();<br>
&nbsp;&nbsp;&nbsp; };<br>
}<br>
  </tt><br>
</blockquote>
</body>
</html>