<div>Hi Carsten,</div><div><br></div>no is not about just rewriting the SDP.<div>i need my UACs media to relay on my rtpproxy</div><div>currently my UACs are sending the media to a private ip.</div><div>my rtpproxy is in behind nat and UACs behind another nat.</div>
<div><br></div><div><br><div class="gmail_quote">On Wed, Jul 6, 2011 at 3:15 PM, Carsten Bock <span dir="ltr"><<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi MingHon,<br>
<br>
what do you want to achieve? If it is only about rewritibng the SDP,<br>
then this will help you:<br>
<br>
fix_nated_sdp("10", "<your-ip-here>");<br>
=> 0x02 rewrite media IP address (c=) with the provided IP address<br>
=> 0x08 rewrite IP from origin description (o=) with the provided IP address<br>
<br>
Kind regards,<br>
Carsten<br>
<br>
2011/7/6 MingHon <<a href="mailto:gminghon@gmail.com">gminghon@gmail.com</a>>:<br>
<div><div></div><div class="h5">> hello List,<br>
> anyone could give some hints??<br>
> im still unable to rewrite the sdp body.<br>
> hope to hear from you all.<br>
> thanks<br>
> --<br>
> Regards,<br>
><br>
> MingHon<br>
><br>
><br>
> On Tue, Jul 5, 2011 at 3:49 PM, MingHon <<a href="mailto:gminghon@gmail.com">gminghon@gmail.com</a>> wrote:<br>
>><br>
>> Hi List,<br>
>> im facing an issue that my kamailio proxy did not replace the ip address<br>
>> in the invite and 200OK sdp body.<br>
>> my rtpproxy is running: rtpproxy -l 192.168.1.3 -u:*:7722 -u user<br>
>> my kamailio is listening on 192.168.1.3, also<br>
>> define: advertised_address="175.136.223.112"; & advertised_port=5060;<br>
>> and my asterisk is on 192.168.1.23.<br>
>> sip signalling and rtp port forwarded to kamailio.<br>
>> uacs from another nat register successfully.<br>
>> if i put 2 lines of force_rtp_proxy("fcow","175.136.223.112");<br>
>> i will get double ip addr in c and o but kamailio ignore my ip addr.<br>
>> example i will get<br>
>> c=IN IP4 192.168.1.3192.168.1.3<br>
>> here is part of my simple script.<br>
>> hope you can help.<br>
>> thank you very much.<br>
>> ---------------cfg-------------------<br>
>> route[RTPPROXY] {<br>
>> #!ifdef WITH_NAT<br>
>> if (is_method("BYE")) {<br>
>> unforce_rtp_proxy();<br>
>> } else if (is_method("INVITE")){<br>
>> force_rtp_proxy("fcow","175.136.223.112");<br>
>> #force_rtp_proxy("fcow","175.136.223.112");<br>
>> xlog("L_INFO","offer");<br>
>> }<br>
>> if (!has_totag()) add_rr_param(";nat=yes");<br>
>> #!endif<br>
>> return;<br>
>> }<br>
>> --------------------------------------<br>
>> and here is the wireshark for uac INVITE and OK.<br>
>> -----------INVITE-----------------<br>
>> ve0<br>
>> EE;p9INVITE <a href="http://sip:102@192.168.2.132:5062" target="_blank">sip:102@192.168.2.132:5062</a> SIP/2.0<br>
>> Record-Route: <sip:192.168.1.3;lr=on;ftag=as032358a3;nat=yes><br>
>> Via: SIP/2.0/UDP 192.168.1.3;branch=z9hG4bK09d5.c5e9e8d2.0<br>
>> Via: SIP/2.0/UDP 192.168.1.23:5080;branch=z9hG4bK71c27189;rport=5080<br>
>> Max-Forwards: 69<br>
>> From: "101" <<a href="mailto:sip%3A102@aextddns.dyndns.info">sip:102@aextddns.dyndns.info</a>>;tag=as032358a3<br>
>> To: <<a href="http://sip:102@192.168.1.3:5060" target="_blank">sip:102@192.168.1.3:5060</a>><br>
>> Contact: <<a href="http://sip:102@192.168.1.23:5080" target="_blank">sip:102@192.168.1.23:5080</a>><br>
>> Call-ID: <a href="mailto:416f6e09674ae9671bb7144a1cb11137@aextddns.dyndns.info">416f6e09674ae9671bb7144a1cb11137@aextddns.dyndns.info</a><br>
>> CSeq: 102 INVITE<br>
>> User-Agent: Asterisk PBX 1.6.2.18<br>
>> Date: Tue, 05 Jul 2011 07:20:53 GMT<br>
>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO<br>
>> Supported: replaces, timer<br>
>> Content-Type: application/sdp<br>
>> Content-Length: 327<br>
>> v=0<br>
>> o=root 1639709788 1639709788 IN IP4 192.168.1.3<br>
>> s=Asterisk PBX 1.6.2.18<br>
>> c=IN IP4 192.168.1.3<br>
>> t=0 0<br>
>> m=audio 10072 RTP/AVP 0 3 8 101<br>
>> a=rtpmap:0 PCMU/8000<br>
>> a=rtpmap:3 GSM/8000<br>
>> a=rtpmap:8 PCMA/8000<br>
>> a=rtpmap:101 telephone-event/8000<br>
>> a=fmtp:101 0-16<br>
>> a=silenceSupp:off - - - -<br>
>> a=ptime:20<br>
>> a=sendrecv<br>
>> a=nortpproxy:yes<br>
>> -----------200OK---------------<br>
>> e90<br>
>> ElE;pX4tSIP/2.0 200 OK<br>
>> Via: SIP/2.0/UDP<br>
>> 192.168.2.200:5062;rport=2788;received=175.138.21.31;branch=z9hG4bK2086380416<br>
>> Record-Route: <sip:192.168.1.3;lr=on;ftag=1796959074;nat=yes><br>
>> From: "101" <<a href="mailto:sip%3A101@aextddns.dyndns.info">sip:101@aextddns.dyndns.info</a>>;tag=1796959074<br>
>> To: <<a href="mailto:sip%3A102@aextddns.dyndns.info">sip:102@aextddns.dyndns.info</a>>;tag=as2e4c0125<br>
>> Call-ID: <a href="mailto:1985782590@192.168.2.200">1985782590@192.168.2.200</a><br>
>> CSeq: 21 INVITE<br>
>> Server: Asterisk PBX 1.6.2.18<br>
>> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO<br>
>> Supported: replaces, timer<br>
>> Contact: <<a href="http://sip:102@192.168.1.23:5080" target="_blank">sip:102@192.168.1.23:5080</a>><br>
>> Content-Type: application/sdp<br>
>> Content-Length: 286<br>
>> v=0<br>
>> o=root 403900934 403900934 IN IP4 192.168.1.23<br>
>> s=Asterisk PBX 1.6.2.18<br>
>> c=IN IP4 192.168.1.23<br>
>> t=0 0<br>
>> m=audio 14420 RTP/AVP 0 8 101<br>
>> a=rtpmap:0 PCMU/8000<br>
>> a=rtpmap:8 PCMA/8000<br>
>> a=rtpmap:101 telephone-event/8000<br>
>> a=fmtp:101 0-16<br>
>> a=silenceSupp:off - - - -<br>
>> a=ptime:20<br>
>> a=sendrecv<br>
>> ------------------------------------<br>
>> My kamailio log.<br>
>> -----------LOG------------------<br>
>> DEBUG: rtpproxy [rtpproxy_funcs.c:148]: type <application/sdp> found valid<br>
>> DEBUG: rtpproxy [rtpproxy.c:2188]: proxy reply: <a href="tel:10070%20192.168.1.3" value="+17019216813">10070 192.168.1.3</a><br>
>> INFO: <script>: offer<br>
>> -------------------------------------<br>
>> double force_rtp_proxy<br>
>> --------kamailio -> asterisk [INVITE]---------<br>
>> Pyi-}E7V@:#pINVITE <a href="mailto:sip%3A102@aextddns.dyndns.info">sip:102@aextddns.dyndns.info</a> SIP/2.0<br>
>> Record-Route: <sip:192.168.1.3;lr=on;ftag=640933430;nat=yes><br>
>> Via: SIP/2.0/UDP 192.168.1.3;branch=z9hG4bK89a5.53e9f766.0<br>
>> Via: SIP/2.0/UDP<br>
>> 192.168.2.200:5062;rport=2788;received=175.138.21.31;branch=z9hG4bK1673765648<br>
>> From: "101" <<a href="mailto:sip%3A101@aextddns.dyndns.info">sip:101@aextddns.dyndns.info</a>>;tag=640933430<br>
>> To: <<a href="mailto:sip%3A102@aextddns.dyndns.info">sip:102@aextddns.dyndns.info</a>><br>
>> Call-ID: <a href="mailto:1909950509@192.168.2.200">1909950509@192.168.2.200</a><br>
>> CSeq: 21 INVITE<br>
>> Contact: <<a href="http://sip:101@175.138.21.31:2788" target="_blank">sip:101@175.138.21.31:2788</a>><br>
>> Content-Type: application/sdp<br>
>> Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER,<br>
>> SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE<br>
>> Max-Forwards: 69<br>
>> User-Agent: T20 9.41.0.80<br>
>> Allow-Events: talk,hold,conference,refer,check-sync<br>
>> Content-Length: 334<br>
>> v=0<br>
>> o=20073 20073 IN IP4 192.168.1.3192.168.1.3<br>
>> s=SDP data<br>
>> c=IN IP4 192.168.1.3192.168.1.3<br>
>> t=0 0<br>
>> m=audio 1006410064 RTP/AVP 0 8 18 9 101<br>
>> a=rtpmap:0 PCMU/8000<br>
>> a=rtpmap:8 PCMA/8000<br>
>> a=rtpmap:18 G729/8000<br>
>> a=rtpmap:9 G722/8000<br>
>> a=fmtp:101 0-15<br>
>> a=rtpmap:101 telephone-event/8000<br>
>> a=sendrecv<br>
>> a=nortpproxy:yes<br>
>> a=nortpproxy:yes<br>
>> -----------LOG------------------<br>
>> DEBUG: rtpproxy [rtpproxy_funcs.c:148]: type <application/sdp> found valid<br>
>> DEBUG: rtpproxy [rtpproxy.c:2188]: proxy reply: <a href="tel:10068%20192.168.1.3" value="+16819216813">10068 192.168.1.3</a><br>
>> DEBUG: rtpproxy [rtpproxy_funcs.c:148]: type <application/sdp> found valid<br>
>> DEBUG: rtpproxy [rtpproxy.c:2188]: proxy reply: <a href="tel:10068%20192.168.1.3" value="+16819216813">10068 192.168.1.3</a><br>
>> INFO: <script>: offer<br>
>> -----------LOG------------------<br>
>><br>
>> --<br>
>> Regards,<br>
>><br>
>> MingHon<br>
<br>
<br>
<br>
</div></div>--<br>
Carsten Bock<br>
<a href="http://www.ng-voice.com" target="_blank">http://www.ng-voice.com</a><br>
mailto:<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a><br>
<br>
Schomburgstr. 80<br>
22767 Hamburg<br>
Germany<br>
<br>
Mobile <a href="tel:%2B49%20179%202021244" value="+491792021244">+49 179 2021244</a><br>
Office <a href="tel:%2B49%2040%2034927219" value="+494034927219">+49 40 34927219</a><br>
Fax <a href="tel:%2B49%2040%2034927220" value="+494034927220">+49 40 34927220</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>MingHon<br>
</div>