<!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 text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
I solved my problem by using msg_apply_changes() of the textopsx
module, now the Route header that I add manually is process by
loose_route().<br>
Again, thanks a lot&nbsp; for your help Daniel.<br>
<br>
<br>
Regards,<br>
<br>
Herv&eacute; <br>
<br>
On 03/30/2012 05:54 PM, Herv&eacute; Cochet wrote:
<blockquote cite="mid:4F75D752.4070308@technosens.fr" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
Hello,<br>
  <br>
I tryied to add the missing Route header by values store in htable
based on Call-Id as you mentionned Daniel but it seems that this Route
header is not taking into account when kamailio performs record_route
and loose_route.<br>
I use the insert_hf function prior to routing function but it doesn't
work, what did I missed ?<br>
  <br>
Example for an ACK:<br>
Frame Received from my SIP provider:<br>
  <i>ACK <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:sip:0974711672@96.57.249.78:6010">sip:0974711672@96.57.249.78:6010</a>
SIP/2.0
  <br>
Call-ID: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:03342-SZ-333e9b30-449a64cb5@my.sip.provider">03342-SZ-333e9b30-449a64cb5@my.sip.provider</a>
  <br>
Contact: &lt;sip:13.12.14.17:5060&gt;
  <br>
CSeq: 854802634 ACK
  <br>
From: "0033403135382"
  <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0476230240@my.sip.provider;user=phone">&lt;sip:0476230240@my.sip.provider;user=phone&gt;</a>;tag=03342-UJ-333e9b31-50487be93
  <br>
Max-Forwards: 28
  <br>
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0974711672@13.12.14.17;user=phone">&lt;sip:0974711672@13.12.14.17;user=phone&gt;</a>;tag=552107982
  <br>
Via: SIP/2.0/UDP 13.12.14.20:5060;branch=z9hG4bK-XWOP-14930cec-40c2dda0
  <br>
User-Agent: Cirpack/v4.42a (gw_sip)
  <br>
Content-Length: 0</i><br>
  <br>
Frame transmit by Kamailio:<br>
  <i>ACK <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:sip:0974711672@96.57.249.78:6010">sip:0974711672@96.57.249.78:6010</a>
SIP/2.0
  <br>
Route:
&lt;sip:130.120.140.131;r2=on;lr=on;ftag=03342-UJ-333e9b31-50487be93;mrt=yes;did=377.0f395d41&gt;,&lt;sip:130.120.140.131:6010;r2=on;lr=on;ftag=03342-UJ-333e9b31-50487be93;mrt=yes;did=377.0f395d41&gt;
  <br>
Record-Route:
&lt;sip:130.120.140.131;lr=on;ftag=03342-UJ-333e9b31-50487be93&gt;
  <br>
Call-ID: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:03342-SZ-333e9b30-449a64cb5@my.sip.provider">03342-SZ-333e9b30-449a64cb5@my.sip.provider</a>
  <br>
Contact: &lt;sip:13.12.14.20:5060&gt;
  <br>
CSeq: 854802634 ACK
  <br>
From: "0033403135382"
  <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0476230240@my.sip.provider;user=phone">&lt;sip:0476230240@my.sip.provider;user=phone&gt;</a>;tag=03342-UJ-333e9b31-50487be93
  <br>
Max-Forwards: 27
  <br>
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0974711672@13.12.14.17;user=phone">&lt;sip:0974711672@13.12.14.17;user=phone&gt;</a>;tag=552107982
  <br>
Via: SIP/2.0/UDP 130.120.140.131;branch=0
  <br>
Via: SIP/2.0/UDP
13.12.14.20:5060;rport=5060;branch=z9hG4bK-XWOP-14930cec-40c2dda0
  <br>
User-Agent: Cirpack/v4.42a (gw_sip)
  <br>
Content-Length: 0</i><br>
  <br>
I was expected an output frame with the Route header that I added
removed by Kamailio and replaced by the correct Record-Route and Via
header:<br>
  <i>ACK <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:sip:0974711672@96.57.249.78:6010">sip:0974711672@96.57.249.78:6010</a>
SIP/2.0
  <br>
  </i><b><i>Record-Route:
&lt;sip:130.120.140.131:6010;lr=on;ftag=03342-UJ-333e9b31-50487be93&gt;
  </i></b><br>
  <i>Record-Route:
&lt;sip:130.120.140.131;lr=on;ftag=03342-UJ-333e9b31-50487be93&gt;
  <br>
Call-ID: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:03342-SZ-333e9b30-449a64cb5@my.sip.provider">03342-SZ-333e9b30-449a64cb5@my.sip.provider</a>
  <br>
Contact: &lt;sip:13.12.14.20:5060&gt;
  <br>
CSeq: 854802634 ACK
  <br>
From: "0033403135382"
  <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0476230240@my.sip.provider;user=phone">&lt;sip:0476230240@my.sip.provider;user=phone&gt;</a>;tag=03342-UJ-333e9b31-50487be93
  <br>
Max-Forwards: 27
  <br>
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0974711672@13.12.14.17;user=phone">&lt;sip:0974711672@13.12.14.17;user=phone&gt;</a>;tag=552107982
  <br>
  <b>Via: SIP/2.0/UDP 130.120.140.131:6010;branch=0
  </b><br>
Via: SIP/2.0/UDP
13.12.14.20:5060;rport=5060;branch=z9hG4bK-XWOP-14930cec-40c2dda0
  <br>
User-Agent: Cirpack/v4.42a (gw_sip)
  <br>
Content-Length: 0</i><br>
  <br>
  <br>
Regards,<br>
  <br>
Herv&eacute;<br>
  <br>
  <br>
On 03/29/2012 04:40 PM, Daniel-Constantin Mierla wrote:
  <blockquote cite="mid:4F747458.40204@gmail.com" type="cite">
    <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
Hello,<br>
    <br>
On 3/29/12 11:17 AM, Herv&eacute; Cochet wrote:
    <blockquote cite="mid:4F7428AC.10408@technosens.fr" type="cite">
      <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
Hello,<br>
      <br>
I used kamailio to handle SIP line from a provider using uacreg table.<br>
Everything was working fine till they add a proxy which do not set (or
not propagate) route header in ACK or BYE request.<br>
      <br>
So my routing logic is broken in the "in-dialog" transaction mode,
since the loose_route return FALSE.<br>
      <br>
If I try to force a t_relay after the loose_route, my message may not
be routing properly if for example my UAC was not connected with the
standard 5060 port or use a different protocol like TCP (It works if
both are in UDP and use 5060 port).<br>
Is there a way to retrieve the record-route previously sets for this
session in order to route this message properly ?<br>
    </blockquote>
    <br>
is the Record-Route set mirrored in the 200ok?<br>
    <br>
If the device is not supporting record-routing, then ACK/BYE should not
get to your proxy. Can you post a full sip trace for such a call (from
invite to bye)? It will help to understand how the message flow is and
maybe we can help more.<br>
    <br>
As a generic hint for storing/retrieving data, look at htable module,
or if you prefer to use database storage, sqlops may be an alternative.
You can keep the values based on callid.<br>
    <br>
    <blockquote cite="mid:4F7428AC.10408@technosens.fr" type="cite"> <br>
      <br>
      <br>
Another problem is that the dialog module do not match the BYE
transaction, the "did" variable is missing since the route is not there
but it should match the request with SIP matching (dlg_match_mode is
set to 1).<br>
      <br>
For example my dialog parameters are:<br>
      <br>
dialog::&nbsp; hash=1214:1340198900<br>
      <i>&nbsp;&nbsp;&nbsp; state:: 3<br>
&nbsp;&nbsp;&nbsp; timestart:: 1333006717<br>
&nbsp;&nbsp;&nbsp; timeout:: 80537132<br>
&nbsp;&nbsp;&nbsp; callid:: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:16260-CI-30dd2867-797784ae0@my.sip.provider">16260-CI-30dd2867-797784ae0@my.sip.provider</a><br>
&nbsp;&nbsp;&nbsp; from_uri:: <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:sip:0367023024@my.sip.provider;user=phone">sip:0367023024@my.sip.provider;user=phone</a><br>
&nbsp;&nbsp;&nbsp; from_tag:: 16260-GI-30dd2868-17bb342c3<br>
&nbsp;&nbsp;&nbsp; caller_contact:: <a moz-do-not-send="true"
 class="moz-txt-link-freetext" href="sip:13.12.14.20:5060">sip:13.12.14.20:5060</a><br>
&nbsp;&nbsp;&nbsp; caller_cseq:: 815264875<br>
&nbsp;&nbsp;&nbsp; caller_route_set:: <a moz-do-not-send="true"
 class="moz-txt-link-rfc2396E" href="sip:13.12.14.20:5060;lr">&lt;sip:13.12.14.20:5060;lr&gt;</a><br>
&nbsp;&nbsp;&nbsp; caller_bind_addr:: udp:130.120.140.131:5060<br>
&nbsp;&nbsp;&nbsp; to_uri:: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:sip:0974711672@13.12.14.17;user=phone">sip:0974711672@13.12.14.17;user=phone</a><br>
&nbsp;&nbsp;&nbsp; to_tag:: 1878467993<br>
&nbsp;&nbsp;&nbsp; callee_contact:: <a moz-do-not-send="true"
 class="moz-txt-link-abbreviated"
 href="mailto:sip:0974711672@96.57.249.78:1024">sip:0974711672@96.57.249.78:1024</a><br>
&nbsp;&nbsp;&nbsp; callee_cseq:: 815264875<br>
&nbsp;&nbsp;&nbsp; callee_route_set:: <br>
&nbsp;&nbsp;&nbsp; callee_bind_addr:: udp:130.120.140.131:5060</i><br>
      <br>
The BYE request:<br>
      <i>BYE <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:sip:0974711672@96.57.249.78:1024">sip:0974711672@96.57.249.78:1024</a>
SIP/2.0 <br>
Call-ID: <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:16260-CI-30dd2867-797784ae0@my.sip.provider">16260-CI-30dd2867-797784ae0@my.sip.provider</a>
      <br>
CSeq: 815264876 BYE <br>
From: "0033403135382" <a moz-do-not-send="true"
 class="moz-txt-link-rfc2396E"
 href="mailto:sip:0367023024@my.sip.provider;user=phone">&lt;sip:0367023024@my.sip.provider;user=phone&gt;</a>;tag=16260-GI-30dd2868-17bb342c3


      <br>
Max-Forwards: 28 <br>
Record-Route: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="sip:13.12.14.20:5060;lr">&lt;sip:13.12.14.20:5060;lr&gt;</a> <br>
To: <a moz-do-not-send="true" class="moz-txt-link-rfc2396E"
 href="mailto:sip:0974711672@13.12.14.17;user=phone">&lt;sip:0974711672@13.12.14.17;user=phone&gt;</a>;tag=1878467993


      <br>
Via: SIP/2.0/UDP 13.12.14.20:5060;branch=z9hG4bK-LNVP-1196a924-5f1f495a
      <br>
Reason: q.850;cause=16 <br>
User-Agent: Cirpack/v4.42a (gw_sip) <br>
Content-Length: 0</i><br>
      <br>
Why does this BYE request is not matched by the dialog modules using
SIP parameters (Call-ID, uri, tag seems correct) ?<br>
    </blockquote>
    <br>
Can you try to execute dlg_manage()? If Route header is missing, then
there is nothing that triggers automatically dialog matching.<br>
    <br>
Cheers,<br>
Daniel<br>
    <blockquote cite="mid:4F7428AC.10408@technosens.fr" type="cite"> <br>
      <br>
Herv&eacute;<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
    </pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
  </blockquote>
  <br>
  <div class="moz-signature">-- <br>
  <meta http-equiv="CONTENT-TYPE"
 content="text/html; charset=ISO-8859-1">
  <title></title>
  <meta name="GENERATOR" content="OpenOffice.org 3.1  (Linux)">
  <meta name="CREATED" content="20100825;9583200">
  <meta name="CHANGED" content="20100825;10080600">
  <style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
                A:link { so-language: zxx }
        -->
        </style>
  <p style="margin-bottom: 0cm;"><br>
  </p>
  <p style="margin-bottom: 0cm;">Herv&eacute; COCHET.</p>
  <br>
  <p style="margin-bottom: 0cm;">
Ing&eacute;nieur en d&eacute;veloppement logiciel.<br>
Tel Direct:<br>
+33(0)482 531 303<br>
  </p>
  <p style="margin-bottom: 0cm;">
  <b>TECHNOSENS SAS<br>
  <i>Donnons du sens &agrave; la Technologie</i></b><br>
31, rue Gustave Eiffel<br>
F-38000 Grenoble<br>
+33(0)476 230 240<br>
  <a moz-do-not-send="true" href="http://www.technosens.fr"><span
 lang="en-US">www.technosens.fr</span></a>
  </p>
  <p style="margin-bottom: 0cm;"><font style="font-size: 8pt;" size="1">--------------------------------------------------------------------------------</font></p>
  <p style="margin-bottom: 0cm;"><font style="font-size: 8pt;" size="1">Ce
message
et
les documents l'accompagnant sont confidentiels. Ils
contiennent des informations qui sont destin&eacute;es uniquement &agrave; la
personne ou l'entit&eacute; dont le nom est indiqu&eacute; ci-dessus. Toute
reproduction, divulgation ou autre utilisation de ces informations,
m&ecirc;me partiellement, par un autre destinataire est strictement
interdite. Si ce message vous est parvenu par erreur, veuillez le
d&eacute;truire imm&eacute;diatement et nous le faire savoir par t&eacute;l&eacute;phone, Fax
ou e-mail.</font></p>
  </div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
  </pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=ISO-8859-1">
<title></title>
<meta name="GENERATOR" content="OpenOffice.org 3.1  (Linux)">
<meta name="CREATED" content="20100825;9583200">
<meta name="CHANGED" content="20100825;10080600">
<style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
                A:link { so-language: zxx }
        -->
        </style>
<p style="margin-bottom: 0cm;"><br>
</p>
<p style="margin-bottom: 0cm;">Herv&eacute; COCHET.</p>
<br>
<p style="margin-bottom: 0cm;">
Ing&eacute;nieur en d&eacute;veloppement logiciel.<br>
Tel Direct:<br>
+33(0)482 531 303<br>
</p>
<p style="margin-bottom: 0cm;">
<b>TECHNOSENS SAS<br>
<i>Donnons du sens &agrave; la Technologie</i></b><br>
31, rue Gustave Eiffel<br>
F-38000 Grenoble<br>
+33(0)476 230 240<br>
<a href="http://www.technosens.fr"><span lang="en-US">www.technosens.fr</span></a>
</p>
<p style="margin-bottom: 0cm;"><font style="font-size: 8pt;" size="1">--------------------------------------------------------------------------------</font></p>
<p style="margin-bottom: 0cm;"><font style="font-size: 8pt;" size="1">Ce
message
et les documents l'accompagnant sont confidentiels. Ils
contiennent des informations qui sont destin&eacute;es uniquement &agrave; la
personne ou l'entit&eacute; dont le nom est indiqu&eacute; ci-dessus. Toute
reproduction, divulgation ou autre utilisation de ces informations,
m&ecirc;me partiellement, par un autre destinataire est strictement
interdite. Si ce message vous est parvenu par erreur, veuillez le
d&eacute;truire imm&eacute;diatement et nous le faire savoir par t&eacute;l&eacute;phone, Fax
ou e-mail.</font></p>
</div>
</body>
</html>