Hi! We found that we need double Record-Route when we call from one SIP transport to another (let's say, TCP -> TLS), because without |transport=" hint in Record-Route, mobile Linphone app sends messages (INVITE reply, ACK, BYE) via UDP, even if configured for another transport.
record_route_advertised_address() is told to add double RR if needed, automatically, so we use it.
But the subscriber (the receiver of call) can have multiple registered locations, let's say, one connected via TCP, and another via TLS. So we need to handle each call branch added by lookup(). But adding record_route_advertised_address() ONLY to branch_route attached by t_on_branch() doesn't execute if there's only one location. Having record_route_advertised_address() just in routing script after lookup() seems wrong because it seems unable to edit it for other branches (I don't remember if I have tested this and have proven a failure, or this is just my speculation). So we have added it in both places - right under lookup(), and in branch_route. But in this case we have an error logged:
ERROR: rr [rr_mod.c:337]: w_record_route_advertised_address(): Double attempt to record-route
Could anyone explain what would be the most correct solution? What is intended behaviour of branch_route? Is it omitted from execution on "primary" branch of call? Is there any parameter which could help?
Thanks in advance.
Andrey,
Have you attempted to address this problem with the use of ordinary record_route() + the enable_double_rr option in the 'rr' module?
http://kamailio.org/docs/modules/4.3.x/modules/rr.html#idm10608
-- Alex
2015-07-15 21:37 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
Andrey,
Have you attempted to address this problem with the use of ordinary record_route() + the enable_double_rr option in the 'rr' module?
Alex.
enable_double_rr is enabled by default in our config. We use record_route_advertised_address() because other record_route functions put internal IP to the header (the server is behind Amazon firewall). We call record_route_advertised_address() just one time, but in two places, meant to handle different cases.
On 07/15/2015 02:57 PM, Andrey Utkin wrote:
enable_double_rr is enabled by default in our config. We use record_route_advertised_address() because other record_route functions put internal IP to the header (the server is behind Amazon firewall). We call record_route_advertised_address() just one time, but in two places, meant to handle different cases.
Oh, I see. Understood.
As far as I know, t_on_branch() should execute for every branch, including the first one. Do you have any other evidence that it doesn't, i.e. a simple xlog statement?
2015-07-15 21:59 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
As far as I know, t_on_branch() should execute for every branch, including the first one. Do you have any other evidence that it doesn't, i.e. a simple xlog statement?
I am unable to test this now in my local environment, but I believe we have tested this few days ago, and that was the reason why I added record_route_advertised_address() also after lookup(). I haven't looked into kamailio sources about this yet. If you are sure that t_on_branch route is supposed to be executed on each branch, then I should retest it and let you know the results.
There's new RR-related issue: now tested it in different setup, and record_route_advertised_address() doesn't write "transport=" attribute when the call goes from websocket to TLS. So Linphone sends BYE via UDP again.
Hello,
On 15/07/15 22:22, Andrey Utkin wrote:
2015-07-15 21:59 GMT+03:00 Alex Balashov abalashov@evaristesys.com:
As far as I know, t_on_branch() should execute for every branch, including the first one. Do you have any other evidence that it doesn't, i.e. a simple xlog statement?
I am unable to test this now in my local environment, but I believe we have tested this few days ago, and that was the reason why I added record_route_advertised_address() also after lookup(). I haven't looked into kamailio sources about this yet. If you are sure that t_on_branch route is supposed to be executed on each branch, then I should retest it and let you know the results.
There's new RR-related issue: now tested it in different setup, and record_route_advertised_address() doesn't write "transport=" attribute when the call goes from websocket to TLS. So Linphone sends BYE via UDP again.
if you run Kamailio behind NAT and want to advertise a different (public) IP address in SIP headers, then it is recommended to use:
listen=privateip advertise publicip
See:
http://www.kamailio.org/wiki/cookbooks/4.3.x/core#listen
Then you simply keep using record_route() (no need for manual address specification via record route preset or advertised address variants).
Cheers, Daniel
2015-07-16 12:26 GMT+03:00 Daniel-Constantin Mierla miconda@gmail.com:
if you run Kamailio behind NAT and want to advertise a different (public) IP address in SIP headers, then it is recommended to use:
listen=privateip advertise publicip
See:
http://www.kamailio.org/wiki/cookbooks/4.3.x/core#listen
Then you simply keep using record_route() (no need for manual address specification via record route preset or advertised address variants).
Thank you for this hint, but it seems to be broken for me (i use recent git master HEAD). I've tried such change (both with and without quotes around MY_DOMAIN),
include_file "modules.cfg" -listen=MY_IP_ADDR:5060 -listen=MY_WS_ADDR -listen=MY_WSS_ADDR +listen=MY_IP_ADDR:5060 advertise "MY_DOMAIN" +listen=MY_WS_ADDR advertise "MY_DOMAIN" +listen=MY_WSS_ADDR advertise "MY_DOMAIN" advertised_address = "MY_DOMAIN" alias = "MY_DOMAIN"
but it gives parse errors:
Jul 17 15:06:12 webrtcloadtest kamailio: : <core> [cfg.y:3432]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 29, column 1-6: syntax error Jul 17 15:06:12 webrtcloadtest kamailio: : <core> [cfg.y:3432]: yyerror_at(): parse error in config file /usr/local/etc/kamailio/kamailio.cfg, line 29, column 1-6: ip address, interface name or hostname expected
Please see that I already use advertised_address directive, but anyway I have that issue that it uses internal IP. MY_DOMAIN is set to symbolic FQDN, not numeric.
Have adopted doing record_route function call in t_on_branch()-installed branch_route, and nowhere else.
But there's still an issue with TLS & WS calls: double RR header is not added, but just single one, with no transport= attribute.
Here's how such problematic INVITEs look like (TLS -> kamailio -> WS):
INVITE sip:4vla69uq@vh5t9smqs0hi.invalid;transport=ws SIP/2.0 Record-Route: sip:webrtcloadtest.intersog.com;lr=on;did=9c6.883;nat=yes Via: SIP/2.0/WSS webrtcloadtest.intersog.com:10443;branch=z9hG4bK9432.dcd630362f4d26bf5b1bd6e96a9b8f99.0;i=c Via: SIP/2.0/TLS 192.168.7.142:32924;received=78.26.144.10;branch=z9hG4bK.4XlJuRMft;rport=32924 From: sip:666@webrtcloadtest.intersog.com;tag=zUKDUOuaO To: sip:999@webrtcloadtest.intersog.com CSeq: 21 INVITE Call-ID: Fv0UICI2wn Max-Forwards: 69 Supported: outbound Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE Content-Type: application/sdp Content-Length: 1714 Contact: sip:666@78.26.144.10:32924;transport=tls;alias=78.26.144.10~32924~3;+sip.instance="urn:uuid:a0668e48-be71-438c-85d5-750f422dfc55" User-Agent: LinphoneAndroid/2.4.1-19-g10566fa (belle-sip/1.4.1)
And this is how messages of inverse direction look like, when received, and they are good (TCP -> kamailio -> WS):
INVITE sip:4vla69uq@vh5t9smqs0hi.invalid;transport=ws SIP/2.0 Record-Route: sip:webrtcloadtest.intersog.com;transport=ws;r2=on;lr=on;did=575.b8e;nat=yes Record-Route: sip:webrtcloadtest.intersog.com;transport=tcp;r2=on;lr=on;did=575.b8e;nat=yes Via: SIP/2.0/WSS webrtcloadtest.intersog.com:10443;branch=z9hG4bK3f1b.39a33d9eb24136c53d32abbe70db654a.0;i=1 Via: SIP/2.0/TCP 192.168.7.142:41932;received=78.26.144.10;branch=z9hG4bK.uxsEm71or;rport=41932 From: sip:666@webrtcloadtest.intersog.com;tag=Xxq5fv9lC To: sip:999@webrtcloadtest.intersog.com CSeq: 21 INVITE Call-ID: RCYQTYzQlO Max-Forwards: 69 Supported: outbound Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE Content-Type: application/sdp Content-Length: 1714 Contact: sip:666@78.26.144.10:41932;transport=tcp;alias=78.26.144.10~41932~2;+sip.instance="urn:uuid:a0668e48-be71-438c-85d5-750f422dfc55" User-Agent: LinphoneAndroid/2.4.1-19-g10566fa (belle-sip/1.4.1)