<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 15 (filtered medium)"><base href="https://e-aj.my.com/" target="_self"><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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
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;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
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]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Thank you for your reply.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I tried the config file shared by Alex below , but I noticed that kamailio is not dealing with CANCEL requests.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>the scenario in my case is that I’m using Kamailio behind a switch to alter some packets (precisely 183 packets) , so I need to forward all packets coming from my customer to the switch , which will deal with it (send it to appropriate supplier).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So what I need is the config file that will forward all requests coming to Kamailio from my customer , to forward them to my switch , then reply back to customer the reply coming from the switch. 9after altering 183 packet to 180) , handling the in-dialog invites sent by my switch , which needs to be sent to the customer by kamailio.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks<o:p></o:p></p><p class=MsoNormal>Ali Taher<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> <b>On Behalf Of </b>yu@yu-boot.ru<br><b>Sent:</b> Tuesday, July 17, 2018 9:41 PM<br><b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org><br><b>Cc:</b> sr-users@lists.sip-router.org<br><b>Subject:</b> Re: [SR-Users] SIP re-invite Packets<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p style='margin-top:0in'>ReInvites like all in-dialog requests are processed in has_totag()/loose_route part. Default kamailio.cfg has almost identical part for this purpose.<o:p></o:p></p><p>Main idea is that an initial request (non in-dialog) hasn't To tag already. It appears only when your request "hits" remote side (called or callee, as you wish) and goes back to you. Simplified, but I hope you got an idea :)<o:p></o:p></p><div id=mail-app-auto-default-signature><p>--<br>sent from myMail for Android<o:p></o:p></p></div><p class=MsoNormal>вторник, 17 июля 2018г., 17:16 +03:00 от Ali Taher <a href="mailto:ataher@vanrise.com">ataher@vanrise.com</a>:<br><br><br><o:p></o:p></p><blockquote style='border:none;border-left:solid #FC2C38 1.0pt;padding:0in 0in 0in 8.0pt;margin-left:7.5pt;margin-right:0in'><div><div><div id="style_15318370050000004317_BODY"><p class=MsoNormal>Hi Alex,<br><br>Thank you for your reply.<br><br>Does below config forward all sip requests coming from the customer to the supplier , and relay sip replies back to customer ?<br><br>Where re-invite packets are handled in the below config file?<br><br>Thank you <br>Ali Taher<br><br>-----Original Message-----<br>From: sr-users <<a href="mailto:sr-users-bounces@lists.kamailio.org">sr-users-bounces@lists.kamailio.org</a>> On Behalf Of Alex Balashov<br>Sent: Tuesday, July 17, 2018 4:25 PM<br>To: Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>><br>Cc: <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>Subject: Re: [SR-Users] SIP re-invite Packets<br><br>On Tue, Jul 17, 2018 at 04:21:25PM +0300, Ali Taher wrote:<br><br>> Can you please send me a simplified config that suit my case ?<br><br>Try this for a main request route:<br><br>---<br><br>route {<br>if(!mf_process_maxfwd_header("10")) {<br>sl_send_reply("483", "Too Many Hops");<br>exit;<br>}<br><br># Maybe some sanity_check() here. <br><br>if(has_totag()) {<br>if(loose_route()) {<br>if(!t_relay())<br>sl_reply_error();<br><br>exit;<br>} else {<br>if(is_method("ACK")) {<br>if(t_check_trans())<br>t_relay();<br>} else<br>sl_send_reply("403", "Forbidden");<br>}<br><br>exit;<br>}<br><br># CANCELs / branches.<br><br>if(is_method("CANCEL")) {<br>if(!t_relay_cancel()) {<br>sl_send_reply("500", "Server Internal Error");<br>exit;<br>}<br><br>exit;<br>}<br><br>t_check_trans();<br><br>if(is_method("OPTIONS")) {<br>sl_send_reply("200", "OK");<br>exit;<br>} <br><br>else if(is_method("INVITE")) {<br># Route your calls.<br><br>exit;<br>}<br><br>sl_send_reply("403", "Method unsupported");<br>exit;<br>}<br><br><br>-- <br>Alex Balashov | Principal | Evariste Systems LLC<br><br>Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br>Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" target="_blank">http://www.csrpswitch.com/</a><br><br>_______________________________________________<br>Kamailio (SER) - Users Mailing List<br><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br><br><br>_______________________________________________<br>Kamailio (SER) - Users Mailing List<br><a href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></p></div></div></div></blockquote></div></body></html>