<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    this is a static string: ”<a class="moz-txt-link-freetext" href="sip:.*@192.168.111.138">sip:.*@192.168.111.138</a>"<br>
    <br>
    It means you redirect any number to '.*'.<br>
    <br>
    To preserve the incoming number, use:<br>
    <br>
    $ru = "sip:" + $rU + "@192.168.111.138";<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 9/6/12 3:40 PM, Fatima
      Chahrour~Vanrise Support wrote:<br>
    </div>
    <blockquote cite="mid:005a01cd8c35$2c631a20$85294e60$@com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 12 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \, serif";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
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;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle24
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle26
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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 style="color:#1F497D">Dear Daniel,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Attached is my
            config file.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Is it correct
            to set $ru=”</span><span style="color:#1F497D"><a class="moz-txt-link-freetext" href="sip:.*@192.168.111.138">sip:.*@192.168.111.138</a>";
            in case I need any number to be redirected to
            192.168.111.138.</span><span style="color:#1F497D"><o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thanks.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">
                <a class="moz-txt-link-abbreviated" href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
                [<a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>] <b>On
                  Behalf Of </b>Fatima Chahrour~Vanrise Support<br>
                <b>Sent:</b> Wednesday, September 05, 2012 5:19 PM<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
                <b>Cc:</b> 'SIP Router - Kamailio (OpenSER) and SIP
                Express Router (SER) - Users Mailing List'<br>
                <b>Subject:</b> Re: [SR-Users] FW: Kamailio as
                sipRedirect<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal"><span style="color:#1F497D">Hi Daniel,<o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        </div>
        <p class="MsoNormal"><span style="color:#1F497D">The call is not
            redirected to 1<sup>st</sup> kamailio, below is the call
            trace where 2<sup>nd</sup>  kamailio(192.168.111.139) send
            request to 192.168.111.15 which is the gateway in the lcr
            rule instead of sending this invite to 192.168.111.138.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">U 192.168.111.139:5060 -&gt;
            192.168.111.15:5060 </span><span style="color:red">(shouldn’t
            this be 192.168.111.138:5060 instead??)<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">INVITE <a class="moz-txt-link-freetext" href="sip:22#96135050@192.168.111.15">sip:22#96135050@192.168.111.15</a>
            SIP/2.0.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Record-Route:
            <a class="moz-txt-link-rfc2396E" href="sip:192.168.111.139;lr=on">&lt;sip:192.168.111.139;lr=on&gt;</a>.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Record-Route:
            <a class="moz-txt-link-rfc2396E" href="sip:192.168.111.138;lr=on">&lt;sip:192.168.111.138;lr=on&gt;</a>.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Via: SIP/2.0/UDP
            192.168.111.139;branch=z9hG4bK5757.5b3b1975.0.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Via: SIP/2.0/UDP
            192.168.111.138;branch=z9hG4bK5757.50ff9264.0.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Via: SIP/2.0/UDP
192.168.52.139:12650;received=192.168.111.11;branch=z9hG4bK-d8754z-85008205ba3ea607-1---d8754z-;rport=12650.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Max-Forwards: 68.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Contact:
            <a class="moz-txt-link-rfc2396E" href="sip:106@192.168.111.11:12650">&lt;sip:106@192.168.111.11:12650&gt;</a>.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">To:
            "96135050"<a class="moz-txt-link-rfc2396E" href="sip:96135050@192.168.111.138">&lt;sip:96135050@192.168.111.138&gt;</a>.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">From:
            "106"<a class="moz-txt-link-rfc2396E" href="sip:106@192.168.111.138">&lt;sip:106@192.168.111.138&gt;</a>;tag=56645478.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Call-ID:
            ZjJlYWYzZmJmYmJlMGE0MmYxYWUwYjYwZmY5MmJkMjg..<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">CSeq: 1 INVITE.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Allow: INVITE, ACK, CANCEL, OPTIONS,
            BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Content-Type: application/sdp.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">User-Agent: X-Lite release 1100l stamp
            47546.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:1.0in"><span
            style="color:#1F497D">Content-Length: 477.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">This is my
            Kamailio routing logic configured on the 1st Kamailio to
            forward any call from 1<sup>st</sup> kamialio to 2<sup>nd</sup>
            kamailio:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">if
            (is_method("INVITE"))<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">{<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Sethostport(“192.168.111.139:5060”);<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Append_branch();<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">My problem is
            here</span><span style="font-family:Wingdings;color:#1F497D">à</span><span
            style="color:#1F497D"> This is my Kamailio routing
            configured on 2<sup>nd</sup> kamailio which I want from it
            to send back the call, with lcr_gateway already defined, to
            1<sup>st</sup> Kamailio:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">if
            (is_method("INVITE"))<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
            {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              if (!load_gws("1")) {<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              sl_send_reply("503", "Unable to load gateways");<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              exit;<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">                                               
               }<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              if(!next_gw()){<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              sl_send_reply("503", "Unable to find a gateway");<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              exit;}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">                               
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              route(1);<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              $ru=<a class="moz-txt-link-rfc2396E" href="sip:.*@192.168.111.138">"sip:.*@192.168.111.138"</a>;<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
              send_reply("302","rEdIrEcTeD");<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">               
               km_append_branch("uri");<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Am looking
            through many documents but can’t achieve my target, I want
            the 2<sup>nd</sup> Kamailio, which has LCR configured on it,
            to send back to 1<sup>st</sup> Kamailio the gateway from
            lcr_gateways with 302 redirect message.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">My questions
            are:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">How to achieve
            this? <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Do you suggest
            any document that help?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Do I need to
            load any specific module?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">F Chahrour<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">
                Daniel-Constantin Mierla [<a class="moz-txt-link-freetext" href="mailto:miconda@gmail.com">mailto:miconda@gmail.com</a>] <br>
                <b>Sent:</b> Wednesday, September 05, 2012 9:38 AM<br>
                <b>To:</b> Fatima Chahrour~Vanrise Support<br>
                <b>Cc:</b> 'SIP Router - Kamailio (OpenSER) and SIP
                Express Router (SER) - Users Mailing List'<br>
                <b>Subject:</b> Re: [SR-Users] FW: Kamailio as
                sipRedirect<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<br>
          You set r-uri ($ru) to an IP address only -- it has to be a
          full SIP URI.<br>
          <br>
          Cheers,<br>
          Daniel<o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 9/4/12 5:34 PM, Fatima
            Chahrour~Vanrise Support wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:#1F497D">Hello,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Thanks for
              your reply.. am able to make the call reach from 3CX to
              Kamailio using the src_ip, thank you, but still not able
              to redirect the call invite from Kamailio to 3CX and send
              the 302 message.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <div>
            <p class="MsoNormal"><span style="color:#1F497D">Kamailio
                instead of 3CX</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="color:#1F497D">192.168.111.138</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          </div>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,&quot;serif&quot;"><br>
              <br>
              <br>
              <br>
              <br>
              <img id="_x0000_i1040"
                src="cid:part1.03060607.07080805@gmail.com" height="77"
                width="212"><o:p></o:p></span></p>
          <div>
            <p class="MsoNormal"><span style="color:#1F497D">Kamailio</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="color:#1F497D">192.168.111.139</span><o:p></o:p></p>
            <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          </div>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,&quot;serif&quot;"><br>
            </span><span style="font-size:12.0pt;font-family:&quot;Times
              New Roman&quot;,&quot;serif&quot;;color:#1F497D"> </span><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,&quot;serif&quot;"><o:p></o:p></span></p>
          <p class="MsoNormal"><img id="_x0000_i1041"
              src="cid:part2.07060804.05030204@gmail.com" height="12"
              width="44"><img id="_x0000_i1042"
              src="cid:part3.08040600.06080005@gmail.com" height="12"
              width="44"><span style="color:#1F497D">Phone A
               (192.168.111.11)</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <div>
            <p class="MsoNormal" style="margin-left:312.0pt"><span
                style="font-size:9.0pt;color:#1F497D">302</span><o:p></o:p></p>
          </div>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,&quot;serif&quot;;color:#1F497D">Phone B
              (192.168.111.10)</span><span
              style="font-size:12.0pt;font-family:&quot;Times New
              Roman&quot;,&quot;serif&quot;"><o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Herby what am
              putting in my routing:</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal">If (is_method("INVITE"))<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">{ if(!load_gateway("1")) {<o:p></o:p></p>
          <p class="MsoNormal">sl_send_reply("503", "unable to load
            gateways");<o:p></o:p></p>
          <p class="MsoNormal">Exit;  }<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal">{ if(! next_gateway()) {<o:p></o:p></p>
          <p class="MsoNormal">sl_send_reply("503", "unable to find
            gateways");<o:p></o:p></p>
          <p class="MsoNormal">Exit;  }<o:p></o:p></p>
          <p class="MsoNormal">Route(1);<o:p></o:p></p>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:&quot;Times New Roman
              \, serif&quot;">$ru = <a moz-do-not-send="true"
                href="%22sip:.*@192.168.111.138%22">"192.168.111.138"</a>;<br>
              send_reply("302", "Redirected";</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:&quot;Times New Roman
              \, serif&quot;">Km_append_branch(“uri”);</span><o:p></o:p></p>
          <p class="MsoNormal" style="margin-bottom:12.0pt"><span
              style="font-size:12.0pt;font-family:&quot;Times New Roman
              \, serif&quot;">Exit;<br>
              <br>
            </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">What am I
              doing is wrong in the above script? And causing “call
              failed”! attached ‘test.txt’ the ngrep capture if needed.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Your help is
              highly appreciated.</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Kind Regards,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">F Chahrour</span><o:p></o:p></p>
          <div>
            <div style="border:none;border-top:solid #B5C4DF
              1.0pt;padding:3.0pt 0in 0in 0in">
              <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">
                  <a moz-do-not-send="true"
                    href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>
                  [<a moz-do-not-send="true"
                    href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
                  <b>On Behalf Of </b>Daniel-Constantin Mierla<br>
                  <b>Sent:</b> Thursday, August 30, 2012 10:56 AM<br>
                  <b>To:</b> Fatima Chahrour<br>
                  <b>Cc:</b> SIP Router - Kamailio (OpenSER) and SIP
                  Express Router (SER) - Users Mailing List<br>
                  <b>Subject:</b> Re: [SR-Users] FW: Kamailio as
                  sipRedirect</span><o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<br>
            <br>
            if you know the IP address of 3CX, then you can skip
            authentication for that, like:<br>
            <br>
            if(src_ip==__3cx_ip__) {<br>
              # don't do authentication for the traffic coming here<br>
            <br>
            }<br>
            <br>
            You can use permission module to store the a list of ip
            addresses and then use functions from that module to match
            against source ip of requests, as alternative to above,
            providing more flexibility when dealing with lot of trusted
            ip addresses.<br>
            <br>
            Cheers,<br>
            Daniel<o:p></o:p></p>
          <div>
            <p class="MsoNormal">On 8/29/12 9:15 PM, Fatima Chahrour
              wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <div>
              <div>
                <p class="MsoNormal">Hello Danial,<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Hereby details:<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">My current working 1st scenario is
                  a call generated from A-party x-lite registered on
                  kamalio, this call is routed based on kamailio lcr
                  routing module which add prefix and send prefix to 3CX
                  then 3CX forward the call to B-party x-lite,
                  registered on 3CX, successfully.<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">In kamailio.cfg routing logic I
                  only used :<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">...<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">If (is_method("INVITE"))<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">{ if(!load_gateway("1")) {<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">sl_send_reply("503", "unable to
                  load gateways");<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Exit;  }<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">{ if(! next_gateway()) {<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">sl_send_reply("503", "unable to
                  find gateways");<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Exit;  }<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> Route(1);<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">....<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Now, my target is to register also
                  the A-party x-lite to 3CX where I added a rule in 3CX
                  to forward the call comming to kamailio to take the
                  route desicion and act.<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">So, here I need to know how can I
                  tell kamailio to accept the call from 3CX? this is
                  what I meant by configuring 3CX on kamailio.<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">I have weakness in the routing
                  logic configuration, could you please help in this
                  too! What is the required replacement on the above to
                  be done?<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Moreover, I appreciate if you
                  provide with docs or tutorials that can help me
                  understand more kamailio's routing logic functions!<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Much appreciated.<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Thanks in advance.<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">F Chahrour<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal"> <o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal">Sent from iPhone<o:p></o:p></p>
              </div>
              <div>
                <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
                  On Aug 29, 2012, at 9:21 PM, Daniel-Constantin Mierla
                  &lt;<a moz-do-not-send="true"
                    href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;
                  wrote:<o:p></o:p></p>
              </div>
              <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                <div>
                  <p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<o:p></o:p></p>
                  <div>
                    <p class="MsoNormal">On 8/29/12 3:31 PM, Fatima
                      Chahrour~Vanrise Support wrote:<o:p></o:p></p>
                  </div>
                  <blockquote
                    style="margin-top:5.0pt;margin-bottom:5.0pt">
                    <p class="MsoNormal">Dears,<o:p></o:p></p>
                    <p class="MsoNormal"> <o:p></o:p></p>
                    <p class="MsoNormal">I have an installed 3CX where I
                      want to generate a call from it to the Kamailo to
                      get a list of suppliers to terminate the call to.<o:p></o:p></p>
                    <p class="MsoNormal">Thus, the Kamailio should act
                      as a sip redirect to the 3CX (for routing
                      decision).<o:p></o:p></p>
                    <p class="MsoNormal"> <o:p></o:p></p>
                    <p class="MsoNormal">Have you tried such
                      configuration before? And how do I configure the
                      3CX on the Kamailio?<o:p></o:p></p>
                    <p class="MsoNormal"> <o:p></o:p></p>
                  </blockquote>
                  <p class="MsoNormal" style="margin-bottom:12.0pt"><span
                      style="font-size:12.0pt;font-family:&quot;Times
                      New Roman \, serif&quot;">I don't understand what
                      you expect from 'configure the 3CX on the
                      Kamailio', can you add more details ?<br>
                      <br>
                      For sending a redirect, practically you have to
                      update request uri and then send the 3xx reply,
                      like:<br>
                      <br>
                      $ru = <a moz-do-not-send="true"
                        href="sip:newnumber@newdomain.com">"sip:newnumber@newdomain.com"</a>;<br>
                      send_reply("302", "Redirected";<br>
                      <br>
                      If you need to put more contacts in the redirect
                      reply, then add:<br>
                      <br>
                      km_append_branch("uri");<br>
                      <br>
                      uri parameter can contain variables.<br>
                      <br>
                      Cheers,<br>
                      Daniel<br>
                      <br>
                    </span><o:p></o:p></p>
                  <p class="MsoNormal" style="margin-bottom:12.0pt"><span
                      style="font-size:12.0pt;font-family:&quot;Times
                      New Roman \, serif&quot;"><br>
                      <br>
                    </span><o:p></o:p></p>
                  <pre>-- <o:p></o:p></pre>
                  <pre>Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
                  <pre><a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
                  <pre>Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a moz-do-not-send="true" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></pre>
                </div>
              </blockquote>
            </div>
          </blockquote>
          <p class="MsoNormal" style="margin-bottom:12.0pt"><span
              style="font-size:12.0pt;font-family:&quot;Times New Roman
              \, serif&quot;"><br>
              <br>
            </span><o:p></o:p></p>
          <pre>-- <o:p></o:p></pre>
          <pre>Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
          <pre>Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a moz-do-not-send="true" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><span
            style="font-size:12.0pt;font-family:&quot;Times New
            Roman&quot;,&quot;serif&quot;"><o:p> </o:p></span></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Daniel-Constantin Mierla - <a moz-do-not-send="true" href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a><o:p></o:p></pre>
        <pre>Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a moz-do-not-send="true" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></pre>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<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>
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - <a class="moz-txt-link-freetext" href="http://asipto.com/u/katu">http://asipto.com/u/katu</a></pre>
  </body>
</html>