I've been playing with sip load-balancer in EC2 but so far haven't been able to figure out how to insert Record-Route header with advertised_address.
AFAIK kamailio rr module adds 2 RR headers (one with the inbound address and one with the outbound address) when your transaction comes with one interface/port and leaves via another.
In EC2 the receive socket is the same as send socket and I've had no luck trying to get kamailio insert advertised address as inbound RR and then the outbound RR, by calling record_route_preset() several times in a row too. This is a problem if lb is in front of another proxy.
As I see this question has been raised on the mailing lists as far as 6 years ago - I would be surprised if no one has come up with a solution yet. So how to do record-routing in a draft-ietf-sip-record-route-fix AKA rfc5658 style on the machine with one physical interface?
Hi Andrew,
On 05/22/2011 03:40 PM, Andrew Pogrebennyk wrote:
AFAIK kamailio rr module adds 2 RR headers (one with the inbound address and one with the outbound address) when your transaction comes with one interface/port and leaves via another.
In EC2 the receive socket is the same as send socket and I've had no luck trying to get kamailio insert advertised address as inbound RR and then the outbound RR, by calling record_route_preset() several times in a row too. This is a problem if lb is in front of another proxy.
In the final SPCE v2.2 (to be released next week) we do it manually using insert_hf(). It's ugly, but it works. Note that this is not there yet in v2.2-rc1. Anyways, it looks like this (using template-toolkit, for those who don't know the SPCE):
[% IF networking.aaddress %] insert_hf("Record-Route: <sip:[% networking.aaddress %]:[% kamailio.lb.port %];lr;r2=on>,<sip:[% networking.iaddress %]:[% kamailio.lb.port %];lr;r2=on>\r\n"); [% ELSE %] record_route(); [% END %]
You need to check the direction of the message also to put the addresses into the right order.
In the latest Kamailio trunk, RR module supports adding two Record-Routes using record_route_preset(), see http://kamailio.org/docs/modules/devel/modules_k/rr.html#id2784744 .
Andreas
Hello Andrew,
A while ago I commit-ed an enhancement to the rr module to allow setting two rr headers: http://kamailio.org/docs/modules/devel/modules_k/rr.html#id2784744 Please test it and report back any issues.
Regards, Ovidiu Sas
On Sun, May 22, 2011 at 9:40 AM, Andrew Pogrebennyk andrew.pogrebennyk@portaone.com wrote:
I've been playing with sip load-balancer in EC2 but so far haven't been able to figure out how to insert Record-Route header with advertised_address.
AFAIK kamailio rr module adds 2 RR headers (one with the inbound address and one with the outbound address) when your transaction comes with one interface/port and leaves via another.
In EC2 the receive socket is the same as send socket and I've had no luck trying to get kamailio insert advertised address as inbound RR and then the outbound RR, by calling record_route_preset() several times in a row too. This is a problem if lb is in front of another proxy.
As I see this question has been raised on the mailing lists as far as 6 years ago - I would be surprised if no one has come up with a solution yet. So how to do record-routing in a draft-ietf-sip-record-route-fix AKA rfc5658 style on the machine with one physical interface?
-- Sincerely, Andrew Pogrebennyk
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