<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><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:"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;}
/* 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.apple-style-span
        {mso-style-name:apple-style-span;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle24
        {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="1041" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
<o:rules v:ext="edit">
<o:r id="V:Rule2" type="connector" idref="#_x0000_s1026" />
<o:r id="V:Rule3" type="connector" idref="#_x0000_s1028" />
<o:r id="V:Rule4" type="connector" idref="#_x0000_s1031" />
<o:r id="V:Rule5" type="connector" idref="#_x0000_s1032" />
<o:r id="V:Rule6" type="connector" idref="#_x0000_s1034" />
<o:r id="V:Rule7" type="connector" idref="#_x0000_s1036" />
<o:r id="V:Rule8" type="connector" idref="#_x0000_s1038" />
<o:r id="V:Rule9" type="connector" idref="#_x0000_s1039" />
</o:rules>
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Hello,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></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.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><!--[if gte vml 1]><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe">
<v:stroke joinstyle="miter" />
<v:path gradientshapeok="t" o:connecttype="rect" />
</v:shapetype><v:shape id="_x0000_s1037" type="#_x0000_t202" style='position:absolute;margin-left:364.5pt;margin-top:8.25pt;width:95.25pt;height:37.5pt;z-index:251663360'>
<v:textbox style='mso-next-textbox:#_x0000_s1037' />
</v:shape><v:shapetype id="_x0000_t32" coordsize="21600,21600" o:spt="32" o:oned="t" path="m,l21600,21600e" filled="f">
<v:path arrowok="t" fillok="f" o:connecttype="none" />
<o:lock v:ext="edit" shapetype="t" />
</v:shapetype><v:shape id="_x0000_s1034" type="#_x0000_t32" style='position:absolute;margin-left:131.25pt;margin-top:19.5pt;width:30.75pt;height:0;z-index:251660288' o:connectortype="straight">
<v:stroke endarrow="block" />
</v:shape><v:shape id="_x0000_s1035" type="#_x0000_t202" style='position:absolute;margin-left:163.5pt;margin-top:8.25pt;width:123pt;height:53.25pt;z-index:251661312'>
<v:textbox style='mso-next-textbox:#_x0000_s1035'>
<![if !mso]><table cellpadding=0 cellspacing=0 width="100%"><tr><td><![endif]><div><p class=MsoNormal><span style='color:#1F497D'>Kamailio instead of 3CX<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>192.168.111.138<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p></div><![if !mso]></td></tr></table><![endif]></v:textbox>
</v:shape><v:shape id="_x0000_s1039" type="#_x0000_t32" style='position:absolute;margin-left:131.25pt;margin-top:39.1pt;width:30.75pt;height:.05pt;flip:x;z-index:251665408' o:connectortype="straight">
<v:stroke endarrow="block" />
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout'><table cellpadding=0 cellspacing=0 align=left><tr><td width=173 height=10></td><td width=212></td><td width=98></td><td width=133></td></tr><tr><td height=56></td><td rowspan=2 align=left valign=top><img width=212 height=77 src="cid:image001.png@01CD8ACA.75D98930" v:shapes="_x0000_s1034 _x0000_s1035 _x0000_s1039"></td><td></td><td width=133 height=56 bgcolor=white style='border:.75pt solid black;vertical-align:top;background:white'><![endif]><![if !mso]><span style='position:absolute;mso-ignore:vglayout;z-index:251663360'><table cellpadding=0 cellspacing=0 width="100%"><tr><td><![endif]><div v:shape="_x0000_s1037" style='padding:4.35pt 7.95pt 4.35pt 7.95pt' class=shape><p class=MsoNormal><span style='color:#1F497D'>Kamailio <o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>192.168.111.139<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p></div><![if !mso]></td></tr></table></span><![endif]><![if !mso & !vml]>&nbsp;<![endif]><![if !vml]></td></tr><tr><td height=21></td></tr></table></span><![endif]><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><br style='mso-ignore:vglayout' clear=ALL><p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_s1036" type="#_x0000_t32" style='position:absolute;margin-left:312.75pt;margin-top:5.95pt;width:30.75pt;height:0;z-index:251662336' o:connectortype="straight">
<v:stroke endarrow="block" />
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:absolute;z-index:251662336;margin-left:416px;margin-top:2px;width:44px;height:12px'><img width=44 height=12 src="cid:image005.png@01CD8ACA.75D98930" v:shapes="_x0000_s1036"></span><![endif]><!--[if gte vml 1]><v:shape id="_x0000_s1038" type="#_x0000_t32" style='position:absolute;margin-left:312.75pt;margin-top:25.5pt;width:30.75pt;height:.05pt;flip:x;z-index:251664384' o:connectortype="straight">
<v:stroke endarrow="block" />
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:absolute;z-index:251664384;margin-left:415px;margin-top:28px;width:44px;height:12px'><img width=44 height=12 src="cid:image006.png@01CD8ACA.75D98930" v:shapes="_x0000_s1038"></span><![endif]><span style='color:#1F497D'>Phone A  (192.168.111.11)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><!--[if gte vml 1]><v:shape id="_x0000_s1040" type="#_x0000_t202" style='position:absolute;margin-left:312.75pt;margin-top:9pt;width:34.5pt;height:15.75pt;z-index:251666432'>
<v:textbox style='mso-next-textbox:#_x0000_s1040' />
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:absolute;z-index:251666432;margin-left:416px;margin-top:11px;width:52px;height:27px'><table cellpadding=0 cellspacing=0><tr><td width=52 height=27 bgcolor=white style='border:.75pt solid black;vertical-align:top;background:white'><![endif]><![if !mso]><span style='position:absolute;mso-ignore:vglayout;z-index:251666432'><table cellpadding=0 cellspacing=0 width="100%"><tr><td><![endif]><div v:shape="_x0000_s1040" style='padding:4.35pt 7.95pt 4.35pt 7.95pt' class=shape><p class=MsoNormal><span style='font-size:9.0pt;color:#1F497D'>302<o:p></o:p></span></p></div><![if !mso]></td></tr></table></span><![endif]><![if !mso & !vml]>&nbsp;<![endif]><![if !vml]></td></tr></table></span><![endif]><span style='color:#1F497D'>Phone B (192.168.111.10)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Herby what am putting in my routing:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal>If (is_method(&quot;INVITE&quot;))<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>{ if(!load_gateway(&quot;1&quot;)) {<o:p></o:p></p><p class=MsoNormal>sl_send_reply(&quot;503&quot;, &quot;unable to load gateways&quot;);<o:p></o:p></p><p class=MsoNormal>Exit; &nbsp;}<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>{ if(! next_gateway()) {<o:p></o:p></p><p class=MsoNormal>sl_send_reply(&quot;503&quot;, &quot;unable to find gateways&quot;);<o:p></o:p></p><p class=MsoNormal>Exit; &nbsp;}<o:p></o:p></p><p class=MsoNormal>Route(1);<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>$ru = <a href="%22sip:.*@192.168.111.138%22">&quot;192.168.111.138&quot;</a>;<br>send_reply(&quot;302&quot;, &quot;Redirected&quot;;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Km_append_branch(“uri”);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Exit;<br><br></span><span style='color:#1F497D'><o:p></o:p></span></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.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Your help is highly appreciated.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Kind Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>F Chahrour<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:"Tahoma","sans-serif";color:windowtext'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'> sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] <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<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</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>&nbsp; # 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>&nbsp;</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>&nbsp;</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>&nbsp;</o:p></p></div><div><p class=MsoNormal>...<o:p></o:p></p></div><div><p class=MsoNormal>If (is_method(&quot;INVITE&quot;))<o:p></o:p></p></div><div><p class=MsoNormal>{ if(!load_gateway(&quot;1&quot;)) {<o:p></o:p></p></div><div><p class=MsoNormal>sl_send_reply(&quot;503&quot;, &quot;unable to load gateways&quot;);<o:p></o:p></p></div><div><p class=MsoNormal>Exit; &nbsp;}<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>{ if(! next_gateway()) {<o:p></o:p></p></div><div><p class=MsoNormal>sl_send_reply(&quot;503&quot;, &quot;unable to find gateways&quot;);<o:p></o:p></p></div><div><p class=MsoNormal>Exit; &nbsp;}<o:p></o:p></p></div><div><p class=MsoNormal>&nbsp;Route(1);<o:p></o:p></p></div><div><p class=MsoNormal>....<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</o:p></p></div><div><p class=MsoNormal>Much appreciated.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Thanks in advance.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>F Chahrour<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</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 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>&nbsp;<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>&nbsp;<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>&nbsp;<o:p></o:p></p></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>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 href="sip:newnumber@newdomain.com">&quot;sip:newnumber@newdomain.com&quot;</a>;<br>send_reply(&quot;302&quot;, &quot;Redirected&quot;;<br><br>If you need to put more contacts in the redirect reply, then add:<br><br>km_append_branch(&quot;uri&quot;);<br><br>uri parameter can contain variables.<br><br>Cheers,<br>Daniel<br><br><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla - <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre><pre><a href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a 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 href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></pre></div></blockquote></div></blockquote><p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br><br><o:p></o:p></span></p><pre>-- <o:p></o:p></pre><pre>Daniel-Constantin Mierla - <a href="http://www.asipto.com">http://www.asipto.com</a><o:p></o:p></pre><pre><a href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a 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 href="http://asipto.com/u/kat">http://asipto.com/u/kat</a><o:p></o:p></pre></div></body></html>