Discussion:
[SR-Users] how to always use rtpproxy-ng and rtpengine to relay rtp packets
andrew
2014-10-13 07:36:56 UTC
Permalink
hi,


kamailio 4.1.5 is used with rtpengine, whose older counterpart is rtpproxy-ng. I made some changes based on the default configuration files(i.e. kamailio.cfg), so that rtpproxy-ng module is enabled. Kamailio.cfg has been uploaded. In kamailio.cfg, there is one route block related to rtpproxy, i.e. route[NATMANAGE], where rtpproxy_manage("co") is called. Sometimes, rtpproxy-ng can insert new ip:port candidates in SDP. But in some case, rtpproxy-ng doesn't rewrite SDP, so rtpengine doesn't relay rtp packets at all.


How to setup kamailio.cfg, so that rtpproxy-ng moudle can always rewritten new ip:port candidates, and rtpengine always relays rtp packets?


Looking foreward to your reply. Thanks!


B.R.


Andrew
Paul Smith
2014-10-13 08:38:47 UTC
Permalink
Hi Andrew
There is a condition in the NATMANAGE route which tests whether or not
to apply rtpproxy_manage() :

if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;

One way to force this is to make sure that FLT_NATS is always set. That
can be done in the NATDETECT route by moving setflag(FLT_NATS) outside
of the if(nat_uac_test) condition and putting it just before the return
statement, so the flag is always set.

Another way would be to remove or comment out the if
"!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;" line from
NATMANAGE so that the the rtp_manage() is always called.

It might be worth your while upgrading to the 4.2 branch which has
renamed the rtpproxy-ng module to rtpengine and made the options in the
call to rtpengine_manage() more readable.

Depending on why you always want to run the rtp proxy ... you might also
want to set :

rtpengine_manage(replace-session-sonnection replace-origin ICE=force-relay)

to ensure that media always goes through your media proxy and no other
connections are negotiated between the endpoints.
Post by andrew
hi,
kamailio 4.1.5 is used with rtpengine, whose older counterpart is
rtpproxy-ng. I made some changes based on the default configuration
files(i.e. kamailio.cfg), so that rtpproxy-ng module is enabled.
Kamailio.cfg has been uploaded. In kamailio.cfg, there is one route
block related to rtpproxy, i.e. route[NATMANAGE],
where rtpproxy_manage("co") is called. Sometimes, rtpproxy-ng can
insert new ip:port candidates in SDP. But in some case, rtpproxy-ng
doesn't rewrite SDP, so rtpengine doesn't relay rtp packets at all.
How to setup kamailio.cfg, so that rtpproxy-ng moudle can always
rewritten new ip:port candidates, and rtpengine always relays rtp packets?
Looking foreward to your reply. Thanks!
B.R.
Andrew
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Paul Smith
2014-10-14 08:38:56 UTC
Permalink
Hi Andrew,
I just use git... so not sure on the rpm stuff. However I believe 4.2 is
to be released as stable branch tomorrow (see other recent thread by
Daniel) so the packages probably aren't far behind.

The main reasons I see for using the 4.2 branch are:
1) its going to be stable release very soon
2) the options on rtpengine have been refactored ... makes sense to
develop on the new version so that you can move from development to
production without amending your kamailio.cfg
3) rtpengine seems to be getting quite alot of rapid progress at the
moment and gaining stability and features ... I'd rather be on the
latest version.

Having said all that the logic in the kamailio.cfg for version 4.1 is
the same and should work for you if you want to work from the current
stable packages.
hi,
thanks for your help.
rtpengine module is used only in kamalio 4.2.x ------ development
version. where to get its rpm packet?
B.R.
andrew
Hi Andrew
There is a condition in the NATMANAGE route which tests whether or
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;
One way to force this is to make sure that FLT_NATS is always set.
That can be done in the NATDETECT route by moving
setflag(FLT_NATS) outside of the if(nat_uac_test) condition and
putting it just before the return statement, so the flag is always
set.
Another way would be to remove or comment out the if
"!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;" line
from NATMANAGE so that the the rtp_manage() is always called.
It might be worth your while upgrading to the 4.2 branch which has
renamed the rtpproxy-ng module to rtpengine and made the options
in the call to rtpengine_manage() more readable.
Depending on why you always want to run the rtp proxy ... you
rtpengine_manage(replace-session-sonnection replace-origin ICE=force-relay)
to ensure that media always goes through your media proxy and no
other connections are negotiated between the endpoints.
Post by andrew
hi,
kamailio 4.1.5 is used with rtpengine, whose older counterpart is
rtpproxy-ng. I made some changes based on the default
configuration files(i.e. kamailio.cfg), so that rtpproxy-ng
module is enabled. Kamailio.cfg has been uploaded. In
kamailio.cfg, there is one route block related to rtpproxy, i.e.
route[NATMANAGE], where rtpproxy_manage("co") is called.
Sometimes, rtpproxy-ng can insert new ip:port candidates in SDP.
But in some case, rtpproxy-ng doesn't rewrite SDP, so rtpengine
doesn't relay rtp packets at all.
How to setup kamailio.cfg, so that rtpproxy-ng moudle can always
rewritten new ip:port candidates, and rtpengine always relays rtp packets?
Looking foreward to your reply. Thanks!
B.R.
Andrew
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Loading...