Hey all,
When using Kamailio at the edge - what's the best practice around how to advertise your Record-Route? I assume it's going to involve the use of a double-RR with both the public and private IPs. However, I'm running in AWS where the host doesn't have two interfaces with both a public and private IP. So, I set the host's public IP as the advertised address while Kamailio binds to the local IP.
But now how do I get Kamailio to know that it needs to double-RR in this case?
Thanks, Colin
Is this the AWS NAT scenario where the public IP is actually not homed on the host itself, or are you asking about a genuine two-interface scenario?
Either way, look up the "advertise" option to the "listen" core configuration directive.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Hey Alex,
Thanks for the response. This is the AWS scenario where there's a 1:1 NAT from the public to private IP.
I've got as far as figuring out how to advertise the public IP. But, when I forward the request to another node inside the cluster, I assume I want to double-RR that request so that my internal SIP application sees the private IP of the instance. Similarly, for outbound traffic, I want to double-RR so the remote party sees the public IP of the host.
That's the part I'm struggling with.
Best, Colin
On Sat, Jun 25, 2016 at 6:12 PM Alex Balashov abalashov@evaristesys.com wrote:
Is this the AWS NAT scenario where the public IP is actually not homed on the host itself, or are you asking about a genuine two-interface scenario?
Either way, look up the "advertise" option to the "listen" core configuration directive.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Understood. I went through this a while back.
As long as you're willing to bind to two different SIP ports (i.e. different SIP port on your internal signalling), this is the solution:
listen=udp:private.ip:5060 advertise public.ip:5060 listen=udp:private.ip:5080
Combine with enable_double_rr, shake well, et voila! :-)
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Thanks for the quick reply!
Binding to two SIP ports isn't out of the question (though I'd like to avoid it if possible).
However, with this approach, I assume somewhere I must have to instruct Kamailio which outbound interface to use (i.e. tell it to use 5080 for forwarded requests to internal hosts and 5060 for requests headed out?) How else would it know to cross over the interfaces?
Best, Colin
On Sat, Jun 25, 2016 at 6:43 PM Alex Balashov abalashov@evaristesys.com wrote:
Understood. I went through this a while back.
As long as you're willing to bind to two different SIP ports (i.e. different SIP port on your internal signalling), this is the solution:
listen=udp:private.ip:5060 advertise public.ip:5060 listen=udp:private.ip:5080
Combine with enable_double_rr, shake well, et voila! :-)
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Yep, you'll probably have to educate it as to which outbound interface to choose, since they're on the same subnet (otherwise mhomed=1 would do the trick).
That's what the (writable) $fs pseudovar is for.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Awesome, thank you.
If I were to try to avoid opening another point, would it be sensible to call record_route_advertised_address() with the advertised address twice manually (once for the inbound and outbound legs with the appropriate IPs for each)? Internally I assume Kamailio's loose_route() would consume both of those on subsequent messages since they'd both be aliases for the local machine.
Would that strategy be somewhat sensible as well?
Best, Colin
On Sat, Jun 25, 2016 at 6:54 PM Alex Balashov abalashov@evaristesys.com wrote:
Yep, you'll probably have to educate it as to which outbound interface to choose, since they're on the same subnet (otherwise mhomed=1 would do the trick).
That's what the (writable) $fs pseudovar is for.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
It can work, but it's more trouble than the other approach, which is essentially automagic.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
Alright, I'll give both approaches a shot and see what comes up.
Thanks for the fast response time, Alex!
Best, Colin
On Sat, Jun 25, 2016 at 7:07 PM Alex Balashov abalashov@evaristesys.com wrote:
It can work, but it's more trouble than the other approach, which is essentially automagic.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Happy to help! The advice comes from a fair bit of experience deploying Kamailio into somewhat complex AWS topologies. Wouldn't want to see you unnecessarily play life on hard mode.
On June 25, 2016 7:07:49 PM EDT, Colin Morelli colin.morelli@gmail.com wrote:
Alright, I'll give both approaches a shot and see what comes up.
Thanks for the fast response time, Alex!
Best, Colin
On Sat, Jun 25, 2016 at 7:07 PM Alex Balashov abalashov@evaristesys.com wrote:
It can work, but it's more trouble than the other approach, which is essentially automagic.
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list
sr-users@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Alex
-- Principal, Evariste Systems LLC (www.evaristesys.com)
Sent from my Google Nexus.