[OpenSIPS-Users] opensips + rtpproxy bridge on loopback interfaces

Cédric ML cedric.bassaget.ml at gmail.com
Wed Oct 26 10:39:31 CEST 2016


Hello,
I'm trying to set up opensips (v2.2.2) and rtpproxy (2.0.beta.20150106) 
one the same server, using loopback interfaces.
------------------------------
network config :
     lo:2 : inet 111.122.100.18/32 (SIG address)
     lo:4 : inet 111.122.100.20/32 (MEDIA address)
     eth1 : 192.168.157.121/24
routing :
     222.251.208.61 via 192.168.157.1 dev eth1  src 111.122.100.18
     222.251.120.61 via 192.168.157.1 dev eth1  src 111.122.100.20

------------------------------
opensips setup :
listen=udp:0.0.0.0:5060
loadmodule "rtpproxy.so"

modparam("rtpproxy", "rtpproxy_sock", 
"unix:/var/run/rtpproxy/rtpproxy.sock")

#routing
...
if (is_method("INVITE")) {
                 t_on_reply("handle_nat");
                 $rd="192.168.157.141";
                 if (has_body("application/sdp"))
                 {
                     rtpproxy_offer("afeiroc");
                 }
         }
onreply_route[handle_nat] {
         if ( has_body("application/sdp") ){
             rtpproxy_answer("afieroc");
         }
}
...
------------------------------
rtpproxy setup :
     /usr/local/bin/rtpproxy -s unix:/var/run/rtpproxy/rtpproxy.sock -u 
rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -l 192.168.157.121 
111.122.100.20 -d DBUG LOG_LOCAL5 -m 10000 -M 20000 -w rw
------------------------------

When I'm making a call from 222.251.208.61 :
- INVITE arrives on the external side of opensips (111.122.100.18), SDP 
contains 222.251.208.61:18592
- INVITE is relayed on the internal side to 192.168.157.141, SDP is 
modified to 192.168.157.121:17226
- 200 OK : 192.168.157.141 replies with a 200 OK, SDP contains 
192.168.157.141:12704
- 200 OK : opensips relays 200 OK to 193.252.208.61, SDP is modified to 
111.122.100.20:17826

So everything looks good in the SDP.
Now looking to the rtp streams :

stream from 222.251.208.61:18592 to 111.122.100.20:17826 : OK
stream from 192.168.157.121:17226 to 192.168.157.141:12704 : MISSING
stream from 192.168.157.141:12704 to 192.168.157.121:17226 : OK
stream from 111.122.100.20:17826 to 222.251.208.61:18592 : OK

It seems that rtpproxy fails to bridge the "external -> internal" part 
of the media.


rtpproxy debug :
Oct 26 10:05:04 localhost rtpproxy[775]: DBUG:get_command:GLOBAL: 
received command "UAEIc8,101 
36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060 222.251.208.61 
18592 as5f5f1868;1"
Oct 26 10:05:04 localhost rtpproxy[775]: 
INFO:rtpp_command_ul_handle:GLOBAL: new session 
36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060, tag as5f5f1868;1 
requested, type strong
Oct 26 10:05:04 localhost rtpproxy[775]: 
INFO:rtpp_command_ul_handle:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
new session on a port 17226 created, tag as5f5f1868;1
Oct 26 10:05:04 localhost rtpproxy[775]: 
INFO:rtpp_command_ul_handle:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
pre-filling caller's address with 222.251.208.61:18592
Oct 26 10:05:04 localhost rtpproxy[775]: DBUG:rtpc_doreply:GLOBAL: 
sending reply "17226 192.168.157.121#012"
Oct 26 10:05:05 localhost rtpproxy[775]: DBUG:get_command:GLOBAL: 
received command "LAIEc8,101 
36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060 192.168.157.141 
12704 as5f5f1868;1 as200acccf;1"
Oct 26 10:05:05 localhost rtpproxy[775]: 
INFO:rtpp_command_ul_handle:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
lookup on ports 17226/17826, session timer restarted
Oct 26 10:05:05 localhost rtpproxy[775]: 
INFO:rtpp_command_ul_handle:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
pre-filling callee's address with 192.168.157.141:12704
Oct 26 10:05:05 localhost rtpproxy[775]: DBUG:rtpc_doreply:GLOBAL: 
sending reply "17826 111.122.100.20#012"
Oct 26 10:05:13 localhost rtpproxy[775]: DBUG:get_command:GLOBAL: 
received command "D 36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060 
as5f5f1868 as200acccf"
Oct 26 10:05:13 localhost rtpproxy[775]: 
INFO:handle_delete:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
forcefully deleting session 1 on ports 17226/17826
Oct 26 10:05:13 localhost rtpproxy[775]: 
INFO:remove_session:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
RTP stats: 410 in from callee, 0 in from caller, 410 relayed, 0 dropped
Oct 26 10:05:13 localhost rtpproxy[775]: 
INFO:remove_session:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
RTCP stats: 1 in from callee, 0 in from caller, 1 relayed, 0 dropped
Oct 26 10:05:13 localhost rtpproxy[775]: 
INFO:remove_session:36fe8745364f35b61411304154da2db3 at 222.251.208.61:5060: 
session on ports 17226/17826 is cleaned up
Oct 26 10:05:13 localhost rtpproxy[775]: DBUG:rtpc_doreply:GLOBAL: 
sending reply "0#012"


I can't figure out what's wrong in my config. Can you please help me ?
Should I post this message on rtpproxy mailing list too ?
Best regards,
Cédric



More information about the Users mailing list