<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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:Consolas;
        panose-1:2 11 6 9 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;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;
        color:black;
        mso-fareast-language:EN-GB;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;
        mso-fareast-language:EN-GB;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
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:windowtext;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle25
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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 bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">Hi Daniel,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Thanks for the extra info. The problem arose after mhomed was turned off earlier today. mhomed had the side-effect that when 2 public IP addresses exist on the server, in the same subnet (e.g. a primary address
 and a VRRP VIP), Kamailio will change the source IP at some point in the dialog and thus traffic across a stateful network (e.g. to a NAT phone) is broken.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:13.2pt;background:white"><span style="mso-fareast-language:EN-GB">Phil Lavin<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Telecoms Systems Manager<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#86579E;mso-fareast-language:EN-GB">CloudCall by SYNETY</span></b><span style="mso-fareast-language:EN-GB"><br>
<a href="http://www.cloudcall.com/">www.cloudcall.com</a><b><o:p></o:p></b></span></p>
<p class="MsoNormal"><b><span style="mso-fareast-language:EN-GB"><br>
</span></b><span style="font-size:10.0pt;mso-fareast-language:EN-GB">T: +44 (0) 330 335 0000 / +1 617 982 1600<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">D: +44 (0) 116 424 4790 / +1 716 242 6604<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">SM:
<a href="https://uk.linkedin.com/pub/phil-lavin/25/422/750">LinkedIn</a> </span><span style="mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><b><u><span style="color:#0563C1;mso-fareast-language:EN-GB"><a href="http://t.sidekickopen03.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43M2cMvVRrZGW2zq9tRVd0tpR56dKNHf2gJW-W02?t=http%3a%2f%2fwww.synety.com%2fblog&si=4668581662425088&pi=98b5dc7b-6a3f-4319-9221-c422f106ebf9">READ
 OUR BLOG FOR SMARTER COMMUNICATIONS</a></span></u></b><span style="mso-fareast-language:EN-GB"> <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;mso-fareast-language:EN-GB"><br>
</span><b><span style="font-size:7.5pt;mso-fareast-language:EN-GB">Confidentiality: This e-mail transmission, including any attachments, is intended only for the named recipient(s) and may contain information that is privileged, confidential and/or exempt from
 disclosure under applicable law. If you have received this transmission in error, or are not the named recipient(s), please notify the sender immediately by return e-mail and permanently delete this transmission, including any attachments.<br>
Security: This e-mail and any attachments are believed to be free from any virus but it is the responsibility of the recipient to ensure this is so. E-mail is not a 100% secure communication</span></b><span style="font-size:7.5pt;mso-fareast-language:EN-GB">.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB"> sr-users [mailto:sr-users-bounces@lists.sip-router.org]
<b>On Behalf Of </b>Daniel-Constantin Mierla<br>
<b>Sent:</b> 10 May 2016 17:07<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <sr-users@lists.sip-router.org><br>
<b>Subject:</b> Re: [SR-Users] Setting source interface on relay<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Just to complete with a bit more details that should be useful for people not familiar with the topic -- as force_send_socket() takes only static string parameter (perhaps we need to change that), you can do assignment to $fs variable for getting the same
 feature.<span style="font-size:12.0pt;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p>Also, in most of the deployments where the linux doesn't have routes for bridging the network interface, you may get along with setting core parameter mhomed=1<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">When Kamailio acts as a presence server, NOTIFY requests are generated by kamailio and don't get in request_route, for that you have to use event_route[tm:local-request].<br>
<br>
Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 10/05/16 18:01, Phil Lavin wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Thanks, Dimitry. That’s done it. Clearly my Google foo is bad today.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="line-height:13.2pt;background:white"><span style="mso-fareast-language:EN-GB">Phil Lavin</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Telecoms Systems Manager</span><o:p></o:p></p>
<p class="MsoNormal"><b><span style="color:#86579E;mso-fareast-language:EN-GB">CloudCall by SYNETY</span></b><span style="mso-fareast-language:EN-GB"><br>
<a href="http://www.cloudcall.com/">www.cloudcall.com</a></span><o:p></o:p></p>
<p class="MsoNormal"><b><span style="mso-fareast-language:EN-GB"><br>
</span></b><span style="font-size:10.0pt;mso-fareast-language:EN-GB">T: +44 (0) 330 335 0000 / +1 617 982 1600</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">D: +44 (0) 116 424 4790 / +1 716 242 6604</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">SM:
<a href="https://uk.linkedin.com/pub/phil-lavin/25/422/750">LinkedIn</a> </span><o:p></o:p></p>
<p class="MsoNormal"><b><u><span style="color:#0563C1;mso-fareast-language:EN-GB"><a href="http://t.sidekickopen03.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43M2cMvVRrZGW2zq9tRVd0tpR56dKNHf2gJW-W02?t=http%3a%2f%2fwww.synety.com%2fblog&si=4668581662425088&pi=98b5dc7b-6a3f-4319-9221-c422f106ebf9">READ
 OUR BLOG FOR SMARTER COMMUNICATIONS</a></span></u></b><span style="mso-fareast-language:EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;mso-fareast-language:EN-GB"><br>
</span><b><span style="font-size:7.5pt;mso-fareast-language:EN-GB">Confidentiality: This e-mail transmission, including any attachments, is intended only for the named recipient(s) and may contain information that is privileged, confidential and/or exempt from
 disclosure under applicable law. If you have received this transmission in error, or are not the named recipient(s), please notify the sender immediately by return e-mail and permanently delete this transmission, including any attachments.<br>
Security: This e-mail and any attachments are believed to be free from any virus but it is the responsibility of the recipient to ensure this is so. E-mail is not a 100% secure communication</span></b><span style="font-size:7.5pt;mso-fareast-language:EN-GB">.</span><o:p></o:p></p>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-GB"> sr-users [<a href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
<b>On Behalf Of </b>Nagorny, Dimitry<br>
<b>Sent:</b> 10 May 2016 15:35<br>
<b>To:</b> Kamailio (SER) - Users Mailing List <a href="mailto:sr-users@lists.sip-router.org">
<sr-users@lists.sip-router.org></a><br>
<b>Subject:</b> Re: [SR-Users] Setting source interface on relay</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="DE">Hi Phil,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="DE"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="DE">try using </span><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="DE">force_send_socket(<i>protocol</i>:<i>your_sending_interface</i>:<i>your_sending_port</i>);</span></b><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="DE"> </span></b><o:p></o:p></p>
<p class="MsoNormal"><span lang="DE">just before your route(RELAY).</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="DE"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal"><span lang="DE" style="mso-fareast-language:DE">Best Regards</span><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="DE" style="mso-fareast-language:DE">Dimitry Nagorny</span></b><o:p></o:p></p>
<p class="MsoNormal"><span lang="DE" style="font-size:8.0pt;mso-fareast-language:DE">Trainee</span><o:p></o:p></p>
</div>
<p class="MsoNormal"><span lang="DE"> </span><o:p></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE" style="mso-fareast-language:DE">Von:</span></b><span lang="DE" style="mso-fareast-language:DE"> sr-users [<a href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a>]
<b>Im Auftrag von </b>Phil Lavin<br>
<b>Gesendet:</b> Dienstag, 10. Mai 2016 16:19<br>
<b>An:</b> Kamailio (SER) - Users Mailing List <<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>><br>
<b>Betreff:</b> [SR-Users] Setting source interface on relay</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="DE"> </span><o:p></o:p></p>
<p class="MsoNormal">Kamailio receives a fairly arbitrary out of dialog NOTIFY on an interface with a private IP address (eth1). It runs it through the following code which relays it to an IP/port combo pulled from a hash table.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">The IP that it is relaying to is a public address and should be addressed out of the interface with a public IP address (eth0). It is, however, sent on the private interface (eth1) and thus never reaches its target.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">route[PHONEREBOOT] {</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        # Only handle check-sync (Polycom) NOTIFY</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        if (!is_method("NOTIFY") || $hdr(Event)!="check-sync")</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">                return;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        # Look up ip:port combo in the agentloc hash table</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        if ($sht(agentloc=>$rU)==$null)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">                return;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        # Set SIP URI to point to the agent</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        $ru = "sip:" + $rU + "@" + $sht(agentloc=>$rU);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        route(RELAY);</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">        exit;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Courier New",serif">}</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Is there a way to explicitly set the source interface to relay on?<o:p></o:p></p>
<p class="MsoNormal"> <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"> <o:p></o:p></p>
<p class="MsoNormal" style="line-height:13.2pt;background:white"><span style="mso-fareast-language:EN-GB">Phil Lavin</span><o:p></o:p></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB">Telecoms Systems Manager</span><o:p></o:p></p>
<p class="MsoNormal"><b><span style="color:#86579E;mso-fareast-language:EN-GB">CloudCall by SYNETY</span></b><span style="mso-fareast-language:EN-GB"><br>
<a href="http://www.cloudcall.com/">www.cloudcall.com</a></span><o:p></o:p></p>
<p class="MsoNormal"><b><span style="mso-fareast-language:EN-GB"><br>
</span></b><span style="font-size:10.0pt;mso-fareast-language:EN-GB">T: +44 (0) 330 335 0000 / +1 617 982 1600</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">D: +44 (0) 116 424 4790 / +1 716 242 6604</span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;mso-fareast-language:EN-GB">SM:
<a href="https://uk.linkedin.com/pub/phil-lavin/25/422/750">LinkedIn</a> </span><o:p></o:p></p>
<p class="MsoNormal"><b><u><span style="color:#0563C1;mso-fareast-language:EN-GB"><a href="http://t.sidekickopen03.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43M2cMvVRrZGW2zq9tRVd0tpR56dKNHf2gJW-W02?t=http%3a%2f%2fwww.synety.com%2fblog&si=4668581662425088&pi=98b5dc7b-6a3f-4319-9221-c422f106ebf9">READ
 OUR BLOG FOR SMARTER COMMUNICATIONS</a></span></u></b><span style="mso-fareast-language:EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;mso-fareast-language:EN-GB"><br>
</span><b><span style="font-size:7.5pt;mso-fareast-language:EN-GB">Confidentiality: This e-mail transmission, including any attachments, is intended only for the named recipient(s) and may contain information that is privileged, confidential and/or exempt from
 disclosure under applicable law. If you have received this transmission in error, or are not the named recipient(s), please notify the sender immediately by return e-mail and permanently delete this transmission, including any attachments.<br>
Security: This e-mail and any attachments are believed to be free from any virus but it is the responsibility of the recipient to ensure this is so. E-mail is not a 100% secure communication</span></b><span style="font-size:7.5pt;mso-fareast-language:EN-GB">.</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><o:p></o:p></pre>
<pre><a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>Daniel-Constantin Mierla<o:p></o:p></pre>
<pre><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 World Conference, Berlin, May 18-20, 2016 - <a href="http://www.kamailioworld.com">http://www.kamailioworld.com</a><o:p></o:p></pre>
</div>
</body>
</html>