[SR-Users] Kamailio know which Interface Packet would route out

SamyGo govoiper at gmail.com
Wed Jul 13 17:57:48 CEST 2016


Thanks Loic,
Yes, thats correct Kernel decides the interface to take. That is why I want
to figure out if we have any way to foresee that decision !

I got to know a new thing: onsend_route:
http://www.kamailio.org/dokuwiki/doku.php/features:new-in-3.0.x#onsend_route

I will try and make use of this route and see if it helps me select the
rtp-proxy instance to use.

Here is how it looks like:
[image: Inline image 2]
For Inbound leg all is fine, but for outbound call leg, if I know which
Interface it is taking I can engage the rtpproxy instance for this.

Regards,
Sammy


On Wed, Jul 13, 2016 at 11:08 AM, Loic Chabert <chabert.loic.74 at gmail.com>
wrote:

> Hi,
> Interface selection is done by kernel when routing lookup is done, no ?
> If you have the same destination and multiple interface to reach it,
> kernel will chose the best one (according metric values).
>
> If you want to force trafic to go through an interface, interface must be
> attached to different routing table (rt_table), and with ip rule command,
> you can select  routing table for this packet (using packet marking).
>
> Another recent kernel feature is VRF:
> https://www.kernel.org/doc/Documentation/networking/vrf.txt
>
> Regards.
>
> Le 12 juil. 2016 19:45, "SamyGo" <govoiper at gmail.com> a écrit :
>
>> Hi,
>>
>> Question:
>> Is there a function in kamailio to get the interface/listen IP kamailio
>> would use to route a packet out for a domain / ip ?
>>
>> Example:
>>
>> $avp(interface_ip) = find_interface_for_request("192.168.12.123");
>>
>> And it gives me the Kamailio's Listen address that would be used for
>> sending call out to this IP/Domain !
>>
>> I've a weird situation where a multi-homed kamailio with about 7
>> different interfaces needs to send call out, I've so many RTProxy instances
>> to engage but I can't decide which instance to engage since I do not know
>> which Interface the Packet would route out from.
>>
>> Regards,
>> Sammy
>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>> sr-users at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160713/44937e30/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 48523 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160713/44937e30/attachment-0001.png>


More information about the sr-users mailing list