Hi,
my plan is to give the possibility for multiple VoIP users within the same LAN to call each other using OpenSER as the SIP server. I found that if there is a NATed LAN, two different VoIP users inside the NATed LAN cannot talk to each other properly, because IP parts of the RTP packets are of the form of the local network and it is not acceptable by the VoIP software which is prepared for the IP of the router instead. (I hope I understand clearly what is going on here.)
As a workaround, I found a suggestion in the internet: using rtpproxy with OpenSER. As I can understand, all RTP packets are sent to the rtpproxy process via OpenSER (nathelper module). rtpproxy will behave as a bridge between the two NATed VoIP clients lying in the same LAN. Both clients will initiate their RTP/UDP traffic on their own side and answers will come from the rtpproxy process just for the same UDP pipe. Using this method the clients do not need to allow incoming UDP traffic, only outgoing traffic should be enabled (which is usually allowed by default in most LANs).
Here comes my question. I successfully set up OpenSER (version 1.1.x, but I will migrate to 1.2.x soon). I think I also successfully set up rtpproxy, but it seems that there is no real traffic between OpenSER and rtpproxy. Here I attach my command line for running rtpproxy (
200.200.200.200 is my public IP of the OpenSER server host; I run rtpproxy on the same server).
-------------------------8X snip here-------------------------------
# rtpproxy -f -l
200.200.200.200 -s unix:/var/run/rtpproxy.sock -r /home/rtpproxy -S /home/rtpproxy.work
rtpproxy started, pid 24568
received command "V"
sending reply "20040107
"
received command "VF 20050322"
sending reply "1
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "VF 20050322"
sending reply "1
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "V"
sending reply "20040107
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "VF 20050322"
sending reply "1
"
received command "U
3331228473621-29341876517920@160.114.144.65 160.114.144.65 10004 196215176;1"
new session
3331228473621-29341876517920@160.114.144.65
, tag 196215176;1 requested, type strong
new session on a port 35000 created, tag 196215176;1
pre-filling caller's address with
160.114.144.65:10004
sending reply "35000
212.92.3.218
"
session timeout
RTP stats: 0 in from callee, 0 in from caller, 0 relayed, 0 dropped
RTCP stats: 0 in from callee, 0 in from caller, 0 relayed, 0 dropped
session on ports 35000/0 is cleaned up
-------------------------8X snip here-------------------------------
My debug=7 output for OpenSER, filtered for the string "rtp" comes here (I had to chown
openser.openser /var/run/rtpproxy* for OpenSER to make it possible to communicate with rtpproxy at all):
-------------------------8X snip here-------------------------------
# tail -f daemon.log | grep rtp
Jan 15 00:27:39 firewall openser: set_mod_param_regex: found <rtpproxy_sock> in module nathelper [/usr/lib/openser/modules/]
Jan 15 00:27:39 firewall openser: set_mod_param_regex: found <rtpproxy_disable> in module nathelper [/usr/lib/openser/modules/]
Jan 15 00:27:39 firewall openser: set_mod_param_regex: found <rtpproxy_disable_tout> in module nathelper [/usr/lib/openser/modules/]
Jan 15 00:27:39 firewall openser: set_mod_param_regex: found <rtpproxy_tout> in module nathelper [/usr/lib/openser/modules/]
Jan 15 00:27:39 firewall openser: set_mod_param_regex: found <rtpproxy_retr> in module nathelper [/usr/lib/openser/modules/]
Jan 15 00:27:39 firewall openser: find_cmd_export_t: found <force_rtp_proxy>(0) in module nathelper [/usr/lib/openser/modules/]
Jan 15 00:27:39 firewall openser: f<force_rtp_proxy>
Jan 15 00:27:39 firewall /usr/sbin/openser[25093]: fixing force_rtp_proxy, line 443
Jan 15 00:27:39 firewall /usr/sbin/openser[25095]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25096]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25098]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25100]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25106]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25105]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25117]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25103]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25108]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25104]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25112]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25094]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25113]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25093]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25111]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25122]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25118]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25123]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25097]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25107]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25125]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25120]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25115]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25110]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25119]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25116]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25124]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25114]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25121]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25099]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25102]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25109]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:27:40 firewall /usr/sbin/openser[25101]: rtpp_test: RTP proxy <unix:/var/run/rtpproxy.sock> found, support for it enabled
Jan 15 00:28:21 firewall /usr/sbin/openser[25112]: force_rtp_proxy2: proxy reply: 35000
212.92.3.218
Jan 15 00:28:27 firewall /usr/sbin/openser[25114]: build_res_from_sip_res: copied size: orig:77, new: 16, rest: 780 msg= SIP/2.0 200 Ok^M Via: SIP/2.0/UDP
160.114.144.65:1024;branch=z9hG4bK27994379851422672^M From: 06212527755 <sip:06212527755@sip.ephone.hu:5060
>;tag=196215176^M To: 06212527722 <
sip:06212527722@sip.ephone.hu:5060>;tag=7816428^M Contact: <sip:06212527722@160.114.144.65:5060>^M Record-Route: <sip:
200.200.200.200;lr;ftag=196215176>^M Call-ID:
3331228473621-29341876517920@160.114.144.65^M CSeq: 1 INVITE^M Content-Type: application/sdp^M Server: X-Lite release 1105d^M Content-Length: 320^M ^M v=0^M o=06212527722 2057424946 2057430520 IN IP4
160.114.144.65^M s=X-Lite^M c=IN IP4 160.114.144.65^M t=0 0^M m=audio 8000 RTP/AVP 0 8 3 98 97 101^M a=rtpmap:0 pcmu/8000^M a=rtpmap:8 pcma/8000^M a=rtpmap:3 gsm/8000^M a=rtpmap:98 iLBC/8000^M a=rtpmap:97 speex/8000^M a=rtpmap:101 telephone-event/8000^M a=fmtp:101 0-15^M a=sendrecv^M
-------------------------8X snip here-------------------------------
My nathelper related part of openser.cfg comes here:
-------------------------8X snip here-------------------------------
loadmodule "
nathelper.so"
modparam("nathelper", "natping_interval", 60)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "received_avp", 42)
modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")
modparam("nathelper", "rtpproxy_disable", 0)
modparam("nathelper", "rtpproxy_disable_tout", 60)
modparam("nathelper", "rtpproxy_tout", 1)
modparam("nathelper", "rtpproxy_retr", 5)
modparam("nathelper", "sipping_method", "OPTIONS")
-------------------------8X snip here-------------------------------
Of course, directories /home/rtpproxy* are empty.
Could somebody please help me why there is no media stream between OpenSER and rtpproxy?
Your help is greatly appreciated in advance. I am using Debian Etch.
Best regards, Zoltan