Hi Carsten,<div><br></div><div>i tried before putting external address but once i put external address i will get error on my /var/log/messages</div><div><br></div><div><div>Jul 6 18:06:56 c5 /usr/local/sbin/kamailio[20025]: ERROR: rtpproxy [rtpproxy.c:2211]: incorrect port 0 in reply from rtpproxy</div>
<div>Jul 6 18:06:56 c5 /usr/local/sbin/kamailio[20024]: ERROR: rtpproxy [rtpproxy.c:2211]: incorrect port 0 in reply from rtp proxy</div><div>Jul 6 18:06:57 c5 /usr/local/sbin/kamailio[20025]: ERROR: rtpproxy [rtpproxy.c:2211]: incorrect port 0 in reply from rtp proxy</div>
</div><div><br></div><div>both kamailio and rtpproxy is in one box and behind nat with one interface ip address 192.168.1.3</div><div><br></div><div>in the router i already port forward 5060 udp and 10000-20000 udp to 192.168.1.3.</div>
<div><br></div><div>Please adv.</div><div><br></div><div>Thank you very much. :)</div><div><br></div><div><div><br><div class="gmail_quote">On Wed, Jul 6, 2011 at 6:01 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>
you should start your RTPProxy with "-l <external address>" (instead<br>
of the internal address). The address provided will be used in the<br>
signalling / replacement in the SDP.<br>
<div><div></div><div class="h5"><br>
Carsten<br>
<br>
2011/7/6 MingHon <<a href="mailto:gminghon@gmail.com">gminghon@gmail.com</a>>:<br>
> Hi,<br>
> Thanks for your reply..<br>
> RTPProxy and kamailio is running on the same centos box.<br>
> below is the command how i connect both RTPProxy and Kamailio<br>
> /----Kamailio----/<br>
> #!ifdef WITH_NAT<br>
> modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:7722")<br>
> #!endif<br>
> /----RTPProxy----/<br>
> rtpproxy -l 192.168.1.3 -s udp:*:7722 -m 10000 -M 20000 -u user<br>
> /----kamctl fifo nh_show_rtpp----/<br>
> udp:localhost:7722:: set=0<br>
> index:: 0<br>
> disabled:: 0<br>
> weight:: 1<br>
> recheck_ticks:: 0<br>
> /--------/<br>
> im using kamailio ver. 3.1.4 and rtpproxy ver. 1.2.1<br>
><br>
> Please advice..<br>
> Thank you very much for your help.<br>
><br>
><br>
> On Wed, Jul 6, 2011 at 4:16 PM, Carsten Bock <<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> Note:<br>
>> The methods of rtpproxy-module will only replace the IP, if the<br>
>> Kamailio can access the RTPProxy.<br>
>><br>
>> How is your RTPProxy connected to your Kamailio? Socket or TCP? Do you<br>
>> have the Kamailio FIFO enabeld?<br>
>> If you have the fifo enabled, you should check the following:<br>
>><br>
>> kamctl fifo nh_show_rtpp<br>
>><br>
>> You should see, that the Kamailio is connected to the RTPProxy. If no,<br>
>> then that is your problem.<br>
>> If the RTPProxy is connected and is listening on the TCP socket, then<br>
>> you can do an ngrep to see the communication between Kamailio and<br>
>> RTPProxy, which might help you further with your investigation.<br>
>><br>
>> Carsten<br>
>><br>
>> 2011/7/6 MingHon <<a href="mailto:gminghon@gmail.com">gminghon@gmail.com</a>>:<br>
>> > Hi Carsten,<br>
>> > no is not about just rewriting the SDP.<br>
>> > i need my UACs media to relay on my rtpproxy<br>
>> > currently my UACs are sending the media to a private ip.<br>
>> > my rtpproxy is in behind nat and UACs behind another nat.<br>
>> ><br>
>> > On Wed, Jul 6, 2011 at 3:15 PM, Carsten Bock <<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> 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<br>
>> >> address<br>
>> >><br>
>> >> Kind regards,<br>
>> >> Carsten<br>
>> >><br>
>> >> 2011/7/6 MingHon <<a href="mailto:gminghon@gmail.com">gminghon@gmail.com</a>>:<br>
>> >> > 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<br>
>> >> >> 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";<br>
>> >> >> & 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,<br>
>> >> >> 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>
>> >> >><br>
>> >> >><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,<br>
>> >> >> 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<br>
>> >> >> 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>
>> >> >><br>
>> >> >><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,<br>
>> >> >> 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<br>
>> >> >> 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<br>
>> >> >> 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>
>> >> --<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>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Regards,<br>
>> ><br>
>> > MingHon<br>
>> ><br>
>><br>
>><br>
>><br>
>> --<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>
>><br>
>> ~~~~~<br>
>> Checkout SIP-Provider CE:<br>
>> <a href="http://www.sipwise.com/products/spce/overview/" target="_blank">http://www.sipwise.com/products/spce/overview/</a><br>
><br>
><br>
><br>
> --<br>
> Regards,<br>
><br>
> MingHon<br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">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>
<br>
~~~~~<br>
Checkout SIP-Provider CE:<br>
<a href="http://www.sipwise.com/products/spce/overview/" target="_blank">http://www.sipwise.com/products/spce/overview/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br><br>MingHon<br>
</div></div>