[SR-Users] Setting source interface on relay

Phil Lavin phil.lavin at synety.com
Tue May 10 18:17:51 CEST 2016


Hi Daniel,

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.


Cheers

Phil Lavin
Telecoms Systems Manager
CloudCall by SYNETY
www.cloudcall.com<http://www.cloudcall.com/>

T: +44 (0) 330 335 0000 / +1 617 982 1600
D: +44 (0) 116 424 4790 / +1 716 242 6604
SM: LinkedIn<https://uk.linkedin.com/pub/phil-lavin/25/422/750>
READ OUR BLOG FOR SMARTER COMMUNICATIONS<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>

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.
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.

From: sr-users [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla
Sent: 10 May 2016 17:07
To: Kamailio (SER) - Users Mailing List <sr-users at lists.sip-router.org>
Subject: Re: [SR-Users] Setting source interface on relay


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.

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
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].

Cheers,
Daniel
On 10/05/16 18:01, Phil Lavin wrote:
Thanks, Dimitry. That's done it. Clearly my Google foo is bad today.



Phil Lavin
Telecoms Systems Manager
CloudCall by SYNETY
www.cloudcall.com<http://www.cloudcall.com/>

T: +44 (0) 330 335 0000 / +1 617 982 1600
D: +44 (0) 116 424 4790 / +1 716 242 6604
SM: LinkedIn<https://uk.linkedin.com/pub/phil-lavin/25/422/750>
READ OUR BLOG FOR SMARTER COMMUNICATIONS<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>

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.
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.

From: sr-users [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Nagorny, Dimitry
Sent: 10 May 2016 15:35
To: Kamailio (SER) - Users Mailing List <sr-users at lists.sip-router.org><mailto:sr-users at lists.sip-router.org>
Subject: Re: [SR-Users] Setting source interface on relay

Hi Phil,

try using
force_send_socket(protocol:your_sending_interface:your_sending_port);

just before your route(RELAY).

Best Regards
Dimitry Nagorny
Trainee

Von: sr-users [mailto:sr-users-bounces at lists.sip-router.org] Im Auftrag von Phil Lavin
Gesendet: Dienstag, 10. Mai 2016 16:19
An: Kamailio (SER) - Users Mailing List <sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>>
Betreff: [SR-Users] Setting source interface on relay

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.

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.

route[PHONEREBOOT] {
        # Only handle check-sync (Polycom) NOTIFY
        if (!is_method("NOTIFY") || $hdr(Event)!="check-sync")
                return;

        # Look up ip:port combo in the agentloc hash table
        if ($sht(agentloc=>$rU)==$null)
                return;

        # Set SIP URI to point to the agent
        $ru = "sip:" + $rU + "@" + $sht(agentloc=>$rU);

        route(RELAY);
        exit;
}

Is there a way to explicitly set the source interface to relay on?


Thanks

Phil Lavin
Telecoms Systems Manager
CloudCall by SYNETY
www.cloudcall.com<http://www.cloudcall.com/>

T: +44 (0) 330 335 0000 / +1 617 982 1600
D: +44 (0) 116 424 4790 / +1 716 242 6604
SM: LinkedIn<https://uk.linkedin.com/pub/phil-lavin/25/422/750>
READ OUR BLOG FOR SMARTER COMMUNICATIONS<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>

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.
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.





_______________________________________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



--

Daniel-Constantin Mierla

http://www.asipto.com

http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda

Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160510/e3ce7f1b/attachment.html>


More information about the sr-users mailing list