<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<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.</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<br>
</p>
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<br>
<br>
<div class="moz-cite-prefix">On 10/05/16 18:01, Phil Lavin wrote:<br>
</div>
<blockquote
cite="mid:VI1PR03MB1840604F0758E6D44E924DD4F6710@VI1PR03MB1840.eurprd03.prod.outlook.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<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;}
/* 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:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
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;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
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-compose;
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]-->
<div class="WordSection1">
<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="color:black;mso-fareast-language:EN-GB">Phil Lavin<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:black;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="color:black;mso-fareast-language:EN-GB"><br>
<a moz-do-not-send="true" href="http://www.cloudcall.com/">www.cloudcall.com</a><b><o:p></o:p></b></span></p>
<p class="MsoNormal"><b><span
style="color:black;mso-fareast-language:EN-GB"><br>
</span></b><span
style="font-size:10.0pt;color:black;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;color:black;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;color:black;mso-fareast-language:EN-GB">SM:
<a moz-do-not-send="true"
href="https://uk.linkedin.com/pub/phil-lavin/25/422/750">LinkedIn</a>
</span><span style="color:black;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
moz-do-not-send="true"
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="color:black;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;color:black;mso-fareast-language:EN-GB"><br>
</span><b><span
style="font-size:7.5pt;color:black;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;color:black;mso-fareast-language:EN-GB">.<o:p></o:p></span></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
style="mso-fareast-language:EN-GB" lang="EN-US">From:</span></b><span
style="mso-fareast-language:EN-GB" lang="EN-US">
sr-users [<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>Nagorny, Dimitry<br>
<b>Sent:</b> 10 May 2016 15:35<br>
<b>To:</b> Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-rfc2396E" 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<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="DE">Hi Phil,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE">try using <o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="DE">force_send_socket(<i>protocol</i>:<i>your_sending_interface</i>:<i>your_sending_port</i>);<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="DE"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="DE">just before your
route(RELAY).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="mso-fareast-language:DE"
lang="DE">Best Regards<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="mso-fareast-language:DE"
lang="DE">Dimitry Nagorny<o:p></o:p></span></b></p>
<p class="MsoNormal"><span
style="font-size:8.0pt;mso-fareast-language:DE" lang="DE">Trainee</span><span
style="font-size:8.0pt;color:#7F7F7F;mso-fareast-language:DE"
lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></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
style="mso-fareast-language:DE" lang="DE">Von:</span></b><span
style="mso-fareast-language:DE" lang="DE"> sr-users [<a
moz-do-not-send="true"
href="mailto:sr-users-bounces@lists.sip-router.org"><a class="moz-txt-link-freetext" href="mailto:sr-users-bounces@lists.sip-router.org">mailto:sr-users-bounces@lists.sip-router.org</a></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
moz-do-not-send="true"
href="mailto:sr-users@lists.sip-router.org"><a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a></a>><br>
<b>Betreff:</b> [SR-Users] Setting source interface on
relay<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></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"">route[PHONEREBOOT] {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> # Only handle check-sync (Polycom)
NOTIFY<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> if (!is_method("NOTIFY") ||
$hdr(Event)!="check-sync")<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> return;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> # Look up ip:port combo in the agentloc
hash table<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> if ($sht(agentloc=>$rU)==$null)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> return;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> # Set SIP URI to point to the agent<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> $ru = "sip:" + $rU + "@" +
$sht(agentloc=>$rU);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> route(RELAY);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New""> exit;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New"">}<o:p></o:p></span></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="color:black;mso-fareast-language:EN-GB">Phil Lavin<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="color:black;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="color:black;mso-fareast-language:EN-GB"><br>
<a moz-do-not-send="true" href="http://www.cloudcall.com/">www.cloudcall.com</a><b><o:p></o:p></b></span></p>
<p class="MsoNormal"><b><span
style="color:black;mso-fareast-language:EN-GB"><br>
</span></b><span
style="font-size:10.0pt;color:black;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;color:black;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;color:black;mso-fareast-language:EN-GB">SM:
<a moz-do-not-send="true"
href="https://uk.linkedin.com/pub/phil-lavin/25/422/750">LinkedIn</a>
</span><span style="color:black;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
moz-do-not-send="true"
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="color:black;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;color:black;mso-fareast-language:EN-GB"><br>
</span><b><span
style="font-size:7.5pt;color:black;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;color:black;mso-fareast-language:EN-GB">.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<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://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 World Conference, Berlin, May 18-20, 2016 - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
</body>
</html>