Hi,
I am working on configuring RTP Proxy. The problem I am having is that Openser will use rtp proxy to serve the rtp session even when both UAs and Openser are withing the same LAN.
Here is the openser.cfg I used:
if (nat_uac_test("19")) { if (method=="REGISTER") {
fix_nated_register(); } else { fix_nated_contact(); }; setflag(5); };
Hre is a INVITE SIP packet from one of the UA:
U 192.168.1.101:5062 -> 192.168.1.104:5060 INVITE sip:1006@192.168.1.104 sip%3A1006@192.168.1.104 SIP/2.0..Via: SIP/2.0/UDP 192.168.1.101:5062;branch=z9hG4b K-220120f9..From: "1005" <sip:1005@192.168.1.104sip%3A1005@192.168.1.104>;tag=490c5d623d5acbf5o0..To: "1006" <si p:1006@192.168.1.104 p%3A1006@192.168.1.104>..Call-ID: 3e5720e1-bf774681@192.168.1.101..CSeq: 102 INVITE..Max-F orwards: 70..Proxy-Authorization: Digest username="1005",realm=" 192.168.1.104",nonce="48 4b3b51ea052f45482ef4fd26f00a14239c3465",uri="sip:1006@192.168.1.104sip%3A1006@192.168.1.104 ",algorithm=MD5,respo
nse="d46ea7cd9781b9a1493e6eaf7b978086",qop=auth,nc=00000001,cnonce="676aa6d8"..Contact: "1005" sip:1005@192.168.1.101:5062..Expires: 240..User-Agent: Sipura/SPA921-4.1.10(b). .Content-Length: 401..Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER..Con tent-Type: application/sdp....v=0..o=- 26093424 26093424 IN IP4 192.168.1.101..s=-..c=IN IP4 192.168.1.101..t=0 0..m=audio 16474 RTP/AVP 0 2 4 8 18 96 97 98 101..a=rtpmap:0 PCM U/8000..a=rtpmap:2 G726-32/8000..a=rtpmap:4 G723/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 G729a/8000..a=rtpmap:96 G726-40/8000..a=rtpmap:97 G726-24/8000..a=rtpmap:98 G726-16/800 0..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..a=ptime:30..a=sendrecv.. #
I even tested with nat_uac_test("1") and nat_uac_test("2") and nat_uac_test("16") seperately and found that nat_uac_test("1") is return true, meaning that Openser detects a RFC1918 address in the Contact field.
If Openser is in the same LAN as the UA, then no rtp proxy should be utilized. Could someone please help me out to configure rtp proxy correctly?
I would appreciate any help in solving this problem.
Regards, Mark
El Sábado, 7 de Junio de 2008, mark morreny escribió:
If Openser is in the same LAN as the UA, then no rtp proxy should be utilized. Could someone please help me out to configure rtp proxy correctly?
Compare source IP of the request ($si during INVITE processing) with the source IP of each response ($si during ON_REPLY_ROUTE). But is very important:
- You must store INVITE source IP in an AVP and set: modparam("tm", "onreply_avp_mode", 1) and them compare the AVP with the $si in ON_REPLY_ROUTE, and only apply RtpProxy if they don't match.
I've it working perfectly.
Regards.
El Sábado, 7 de Junio de 2008, Iñaki Baz Castillo escribió:
El Sábado, 7 de Junio de 2008, mark morreny escribió:
If Openser is in the same LAN as the UA, then no rtp proxy should be utilized. Could someone please help me out to configure rtp proxy correctly?
Compare source IP of the request ($si during INVITE processing) with the source IP of each response ($si during ON_REPLY_ROUTE). But is very important:
- You must store INVITE source IP in an AVP and set: modparam("tm", "onreply_avp_mode", 1)
and them compare the AVP with the $si in ON_REPLY_ROUTE, and only apply RtpProxy if they don't match.
I've it working perfectly.
BTW **REMEMBER** that you must fix NAT for SIP signallig even if both users are behind the same NAT router since requests, responses and in-dialogs request must be routed through the proxy.
Hi Inaki,
Thank you very much for helping out. There is one thing I want to clearify from you.
Let's say I have UA 192.168.1.100 who wants to make call with UA 192.168.1.101
When the INVITE comes from 192.168.1.100, the $si is 192.168.1.100. When the ACK 200 comes from 192.168.1.101, the $si is 192.168.1.101.
How cane these two be matched? I am thinking maybe I am just confused on an issue that I still not yet understand.
Thanks, Mark
Compare source IP of the request ($si during INVITE processing) with the source IP of each response ($si during ON_REPLY_ROUTE). But is very important:
- You must store INVITE source IP in an AVP and set: modparam("tm", "onreply_avp_mode", 1)
and them compare the AVP with the $si in ON_REPLY_ROUTE, and only apply RtpProxy if they don't match.
El Domingo, 8 de Junio de 2008, mark morreny escribió:
Hi Inaki,
Thank you very much for helping out. There is one thing I want to clearify from you.
Let's say I have UA 192.168.1.100 who wants to make call with UA 192.168.1.101
When the INVITE comes from 192.168.1.100, the $si is 192.168.1.100. When the ACK 200 comes from 192.168.1.101, the $si is 192.168.1.101.
How cane these two be matched? I am thinking maybe I am just confused on an issue that I still not yet understand.
Ah, that is a different point. I tought you have an OpenSer with public IP and clients behind different LAN's, so $si will be the public IP of each router (and doing what I suggested you'd get direct RTP in calls inside a same LAN).
In your case I assume you have and OpenSer with public and private IP so to match 192.168.1.100 with 192.168.1.101 you must perform a regular expresion. It shouldn't be difficult with OpenSer "avpops" module.