<div dir="ltr">Dear list<div><br></div><div>I am quite new to Kamailio and i have been able to solve some NAT Traversal issues with symmetric SIP+RTP putting kamailio+rtpproxy behind NAT, i am also load balancing some asterisk boxes for transcoding and some other services like voicemail. Also i am using SIPp for load testing</div><div><br></div><div>Now the question is that, while everything is working great with NAT (even when i am using SIPp for testing with low load) when i am about to test it with more than 150 calls or something i am starting to get the following error:</div><div><br></div><div><div><i>kamailio[34549]: ERROR: rtpproxy [rtpproxy.c:2735]: force_rtp_proxy(): incorrect port 0 in reply from rtp proxy</i></div></div><div><br></div><div>I have been trying to look at some SIP packets when the error starts and i am not seeing anything out of the normal (while being quite difficult to debug when having so many concurrent calls at SIP level)</div><div><br></div><div>My configuration doesnt have anything new, the only thing is that, because Kamailio is behind NAT i used some ideas from some other users and debates from this same mailing list:</div><div><br></div><div><div><i># RTPProxy control</i></div><div><i>route[NATMANAGE] {</i></div><div><i>#!ifdef WITH_NAT</i></div><div><i> if(is_request()) {</i></div><div><i>  if(has_totag()) {</i></div><div><i>   if(check_route_param("nat=yes")) {</i></div><div><i>    setbflag(FLB_NATB);</i></div><div><i>   }</i></div><div><i>  }</i></div><div><i> }</i></div><div><i><br></i></div><div><i> if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))</i></div><div><i>   return;</i></div><div><i><br></i></div><div><i> if(!route(FROMASTERISK)){</i></div><div><i>        force_send_socket(10.0.1.207);</i></div><div><i>        rtpproxy_manage("rw","10.0.1.206");</i></div><div><i> }else{</i></div><div><i>        force_send_socket(10.0.1.206);</i></div><div><i>        rtpproxy_manage("rw","10.0.5.203");</i></div><div><i> }</i></div><div><i><br></i></div><div><i> if (is_request()) {</i></div><div><i>  if (!has_totag()) {</i></div><div><i>   add_rr_param(";nat=yes");</i></div><div><i>  }</i></div><div><i> }</i></div><div><i> if (is_reply()) {</i></div><div><i>  if(isbflagset(FLB_NATB)) {</i></div><div><i>        fix_nated_contact();</i></div><div><i>  }</i></div></div><div><div><i>#!endif</i></div><div><i> return;</i></div><div><i>}</i></div></div><div><br></div><div>This solution is based of someone's idea from this mailing list: <a href="http://lists.sip-router.org/pipermail/sr-users/2013-January/076254.html">http://lists.sip-router.org/pipermail/sr-users/2013-January/076254.html</a></div><div><br></div><div>As you can see in my configuration, my "public network" is really private network so i tweak the NATDETECT route to not include RFC1918 networks as part of the detection</div><div><br></div><div><div><i># Caller NAT detection route</i></div><div><i>route[NATDETECT] {</i></div><div><i>#!ifdef WITH_NAT</i></div><div><i>if (nat_uac_test("1")) {<br></i></div><div><i>        if (nat_uac_test("18")) {</i></div><div><i>                force_rport();</i></div><div><i>                if (is_method("REGISTER")) {</i></div><div><i>                        fix_nated_register();</i></div><div><i>                } else {</i></div><div><i>                        fix_nated_contact();</i></div><div><i>                }</i></div><div><i>                setflag(FLT_NATS);</i></div><div><i>                return;</i></div><div><i>        }</i></div><div><i> }</i></div><div><i>#!endif</i></div><div><i> return;</i></div><div><i>}</i></div></div><div><br></div><div>Also i would like to know how may i use RTPProxy logs?, i tried to configure it like this:</div><div><br></div><div>/etc/rsyslog.conf</div><div><br></div><div><div><i># Kamailio logging</i></div><div><i>local0.*                                                -/var/log/kamailio.log</i></div><div><i><br></i></div><div><i>#RTPProxy logging</i></div><div><i>local3.*                                                /var/log/rtpproxy.log</i></div></div><div><br></div><div>/etc/sysconfig/rtpproxy</div><div><br></div><div><div><i>OPTIONS="-l 10.0.1.206 -A 10.0.5.203 -s udp:<a href="http://127.0.0.1:7722">127.0.0.1:7722</a> -r /var/lib/rtpproxy/sessions -d DBUG:LOG_LOCAL3 -m 35000 -M 55000 -F"</i></div></div><div><br></div><div>I cannot see anyhing in the logs</div><div><br></div><div>Thank you very much</div><div><br></div><div>Alejandro</div></div>