<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    you should enforce specific routing only for initial INVITE. Along
    with that do record_route() and for requests within dialog use
    loose_route() + t_relay() in order to keep the same path of
    singaling for same dialog.<br>
    <br>
    If you look at the default kamailio.cfg, it uses the record routing
    mechanism, which is the standard for routing requests within dialog.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 11/02/16 10:19,
      <a class="moz-txt-link-abbreviated" href="mailto:alexandre.anconetti@orange.com">alexandre.anconetti@orange.com</a> wrote:<br>
    </div>
    <blockquote
cite="mid:19651_1455182346_56BC520A_19651_3346_1_B1AE528A91AD5948A6F47EB527A19F2F049F20@OPEXCLILM22.corporate.adroot.infra.ftgroup"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I would like some advice
            about a situation i have encountered  recently. I’m using
            Kamailio 4.3.4 as a “proxy” : I have a media server, and to
            reach this server all the requests have to pass through my
            Kamailio server. The Kamailio server does not have to handle
            authentification or registration, all of that stuff is done
            on the media server. To do that I’m using the following
            route :
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">route[REDIRECT] {<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                if($rU
            == "" ) {<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                       
            $ru = (<a class="moz-txt-link-rfc2396E" href="sip:1.2.3.4:xxxx">"sip:1.2.3.4:xxxx"</a>);<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                else {<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">                       
            $ru = ("sip:" + $rU + "@1.2.3.4:xxxx");<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">1.2.3.4 is my media
            server’s address. I have 2 users : an “internal” one
            registered on the media server, and an “external” one which
            is a random caller. It works fine for EXT -> Kamailio
            -> Media server requests but when I try to hang up with
            my internal user, the “BYE” request uses the following path
            : Internal user -> Media server -> Kamailio ->
            Media server instead of : Internal user -> Media server
            -> Kamailio -> External user. Obviously it is because
            of the REDIRECT route which send back the “BYE” request to
            the media server, when it should sends that request to the
            external user.
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">So, how should I modify
            that route to do what I want ? Maybe should I create a
            second route ? Any answer will be appreciated
          </span><span style="font-family:Wingdings" lang="EN-US">J</span><span
            lang="EN-US"><o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Best regards,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Alexandre<o:p></o:p></span></p>
      </div>
      <pre>_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://miconda.eu">http://miconda.eu</a></pre>
  </body>
</html>