Hi,
I believe this has been discussed before but I can't find a definitive answer. Using kamailio 4.2 with rtpengine.
My clients don't have natively any ICE relay candidates, just host and server reflexive from STUN. What is the correct syntax to have rtpengine only add itself as relay candidate with lowest priority?
The current basic kamailio config I'm testing has rtpengine_manage empty of flags, which is almost working except that rtpengine's default behaviour in my circumstance is to add itself as a host candidate.
Reading through http://kamailio.org/docs/modules/devel/modules/rtpengine.html I believe what I want (ie. rtpengine adding itself as relay candidate only with lowest priority - not touching the rest of the SDP or any other ICE candidates sent by the clients) is not an option. Is my interpretaion correct or am I missing something glaringly obvious?
Thanks, Peter
From the module's documentation:
"The default (if no “ICE=...” is given at all), new ICE data will only be generated if no ICE was present in the SDP originally; otherwise the RTP proxy will only insert itself as *additional* ICE candidate."
Relevant kamailio config snippet:
route[NATMANAGE] { #!ifdef WITH_NAT if (is_request()) { if(has_totag()) { if(check_route_param("nat=yes")) { setbflag(FLB_NATB); } } } if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;
rtpengine_manage("");
if (is_request()) { if (!has_totag()) { if(t_is_branch_route()) { add_rr_param(";nat=yes"); } } } if (is_reply()) { if(isbflagset(FLB_NATB)) { if(is_first_hop()) set_contact_alias(); } } #!endif return; }
Peter Villeneuve writes:
What is the correct syntax to have rtpengine only add itself as relay candidate with lowest priority?
i don't think that such an option (ICE=add-relay) currently exists. there is force-relay and force, both of which may touch existing ice attributes.
-- juha
Thanks Juha.
I have tried force-relay but I belive that only works when the clients already have ICE relay candidates, in that case rtpengine simply replaces them with its own.
I can't believe there's no option to just add itself as a low priority relay candidate instead of messing with the hosts candidates as it seems to do by default.
I'm gonna keep digging. Any input is welcome.
Cheers
On Mon, Oct 6, 2014 at 4:25 PM, Juha Heinanen jh@tutpro.com wrote:
Peter Villeneuve writes:
What is the correct syntax to have rtpengine only add itself as relay candidate with lowest priority?
i don't think that such an option (ICE=add-relay) currently exists. there is force-relay and force, both of which may touch existing ice attributes.
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Peter Villeneuve writes:
I have tried force-relay but I belive that only works when the clients already have ICE relay candidates, in that case rtpengine simply replaces them with its own.
are you sure that nothing is added if there is no existing relay candidates?
I can't believe there's no option to just add itself as a low priority relay candidate instead of messing with the hosts candidates as it seems to do by default.
force-relay is not messing with any other candidates than relay candidates.
-- juha
Peter Villeneuve writes:
I have tried force-relay but I belive that only works when the clients already have ICE relay candidates, in that case rtpengine simply replaces them with its own.
i tested and (as i thought) the above is not true.
incoming:
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10490 typ host. a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10491 typ host. a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10490 typ host. a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10491 typ host. a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10490 typ host. a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10491 typ host. a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10490 typ host. a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10491 typ host. a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10490 typ host. a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10491 typ host. a=candidate:5d6a04d2 1 UDP 1677721855 93.106.4.211 10490 typ srflx raddr 192.98.102.30 rport 10490. a=candidate:5d6a04d2 2 UDP 1677721854 93.106.4.211 10491 typ srflx raddr 192.98.102.30 rport 10491.
outgoing after force-relay:
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10490 typ host. a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10491 typ host. a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10490 typ host. a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10491 typ host. a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10490 typ host. a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10491 typ host. a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10490 typ host. a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10491 typ host. a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10490 typ host. a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10491 typ host. a=candidate:5d6a04d2 1 UDP 1677721855 93.106.4.211 10490 typ srflx raddr 192.98.102.30 rport 10490. a=candidate:5d6a04d2 2 UDP 1677721854 93.106.4.211 10491 typ srflx raddr 192.98.102.30 rport 10491. a=candidate:UrghmdNHD8slTr03 1 UDP 16777215 192.98.102.30 50350 typ relay. a=candidate:UrghmdNHD8slTr03 2 UDP 16777214 192.98.102.30 50351 typ relay.
-- juha
Hi Juha,
Thanks for your help and detailed testing. You beat me to it in your tests. Apparently the syntax force-relay in my config wasn't doing anything since my version of rtpengine and kamailio was expecting force_relay instead. I believe there's been a recent update to the code for this. I will update both rtpengine and kamailio 4.2 today and will test out the force-relay option.
Cheers, Peter
On Tue, Oct 7, 2014 at 7:12 AM, Juha Heinanen jh@tutpro.com wrote:
Peter Villeneuve writes:
I have tried force-relay but I belive that only works when the clients already have ICE relay candidates, in that case rtpengine simply replaces them with its own.
i tested and (as i thought) the above is not true.
incoming:
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10490 typ host. a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10491 typ host. a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10490 typ host. a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10491 typ host. a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10490 typ host. a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10491 typ host. a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10490 typ host. a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10491 typ host. a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10490 typ host. a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10491 typ host. a=candidate:5d6a04d2 1 UDP 1677721855 93.106.4.211 10490 typ srflx raddr 192.98.102.30 rport 10490. a=candidate:5d6a04d2 2 UDP 1677721854 93.106.4.211 10491 typ srflx raddr 192.98.102.30 rport 10491.
outgoing after force-relay:
a=candidate:c062661e 1 UDP 2113932031 192.98.102.30 10490 typ host. a=candidate:c062661e 2 UDP 2113932030 192.98.102.30 10491 typ host. a=candidate:c0a82b92 1 UDP 2113932031 192.168.43.146 10490 typ host. a=candidate:c0a82b92 2 UDP 2113932030 192.168.43.146 10491 typ host. a=candidate:c062671e 1 UDP 2113932031 192.98.103.30 10490 typ host. a=candidate:c062671e 2 UDP 2113932030 192.98.103.30 10491 typ host. a=candidate:63c01c46 1 UDP 2113932031 2002:c062:661e::1 10490 typ host. a=candidate:63c01c46 2 UDP 2113932030 2002:c062:661e::1 10491 typ host. a=candidate:1e6662c0 1 UDP 2113932031 ::192.98.102.30 10490 typ host. a=candidate:1e6662c0 2 UDP 2113932030 ::192.98.102.30 10491 typ host. a=candidate:5d6a04d2 1 UDP 1677721855 93.106.4.211 10490 typ srflx raddr 192.98.102.30 rport 10490. a=candidate:5d6a04d2 2 UDP 1677721854 93.106.4.211 10491 typ srflx raddr 192.98.102.30 rport 10491. a=candidate:UrghmdNHD8slTr03 1 UDP 16777215 192.98.102.30 50350 typ relay. a=candidate:UrghmdNHD8slTr03 2 UDP 16777214 192.98.102.30 50351 typ relay.
-- juha
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
Peter Villeneuve writes:
You beat me to it in your tests. Apparently the syntax force-relay in my config wasn't doing anything since my version of rtpengine and kamailio was expecting force_relay instead. I believe there's been a recent update to the code for this.
ok, that explains the difference in tests. force_relay was changed to force-relay few weeks ago.
-- juha