<div>Hi,</div><div><br></div>You may not want to tell your rtpproxy module to use DB as well as a socket connection at the same time: I wonder if it will work this way.<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:localhost:9999&quot;)<br>
</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">modparam(&quot;rtpproxy&quot;, &quot;nortpproxy_str&quot;, &quot;a=sdpmangled:yes\r\n&quot;)<br>
</span><font color="#ff6666"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">modparam(&quot;rtpproxy&quot;, &quot;db_url&quot;,<br></span><span style="font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">&quot;mysql://opensips:opensipsrw@</span></font><span style="font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)"><font color="#ff6666">localhost/opensips&quot;)</font><br>
</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">#modparam(&quot;rtpproxy&quot;, &quot;db_table&quot;, &quot;nh_rtpp&quot;)<br></span><font color="#ff6666"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px;background-color:rgb(255,255,255)">modparam(&quot;rtpproxy&quot;, &quot;rtpp_socket_col&quot;, &quot;rtpproxy_sock&quot;)</span> </font></blockquote>
<div><br></div><div>Comment out the red lines as well.</div><div>Once commented restart opensips and verify that your RTPproxy is indeed listening on the port 9999</div><div><b><br></b></div><div><b>#netstat -pln | grep 9999</b></div>
<div><br></div><div>If you get an output then its fine, next you should make a call and see if the error changes or not. </div><div><br></div><div>Regards,</div><div>Sammy.</div><div> </div><br><div class="gmail_quote">On Fri, Aug 3, 2012 at 2:38 AM, siponcloud user <span dir="ltr">&lt;<a href="mailto:kash906@gmail.com" target="_blank">kash906@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Opensips is a great product, but I have been having problem in configuring<br>
the nat traversal + rtpproxy with opensips and have spent about a week on<br>
this.  I am a novice in this... when opensips runs with the following<br>
opensips.cfg relevant portions -- it raises the following rtpproxy problem:<br>
<br>
&quot;ERROR:rtpproxy:select_rtpp_node: script error -no valid set selected&quot;<br>
&quot;ERROR:rtpproxy:force_rtp_proxy: no available proxies&quot;<br>
<br>
#-------- nat_traversal params -----<br>
modparam(&quot;nat_traversal&quot;, &quot;keepalive_interval&quot;, 30)<br>
modparam(&quot;nat_traversal&quot;, &quot;keepalive_method&quot;, &quot;OPTIONS&quot;)<br>
modparam(&quot;nat_traversal&quot;, &quot;keepalive_from&quot;, &quot;sip:[hidden email]&quot;)<br>
modparam(&quot;nat_traversal&quot;, &quot;keepalive_state_file&quot;,<br>
&quot;/var/run/opensips/keepalive_state&quot;)<br>
<br>
#ak# --- rtpproxy -----<br>
# single rtproxy with specific weight<br>
modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:localhost:9999&quot;)<br>
modparam(&quot;rtpproxy&quot;, &quot;nortpproxy_str&quot;, &quot;a=sdpmangled:yes\r\n&quot;)<br>
modparam(&quot;rtpproxy&quot;, &quot;db_url&quot;,<br>
&quot;mysql://opensips:opensipsrw@localhost/opensips&quot;)<br>
#modparam(&quot;rtpproxy&quot;, &quot;db_table&quot;, &quot;nh_rtpp&quot;)<br>
modparam(&quot;rtpproxy&quot;, &quot;rtpp_socket_col&quot;, &quot;rtpproxy_sock&quot;)<br>
<br>
<br>
####### Routing Logic ########<br>
<br>
<br>
# main request routing logic<br>
<br>
route{<br>
        ####nat_traversal info<br>
        force_rport();<br>
        if (client_nat_test(&quot;7&quot;)) {<br>
                fix_contact();<br>
                setflag(5);<br>
        }<br>
<br>
        if ((method==&quot;REGISTER&quot; || method==&quot;SUBSCRIBE&quot; ||<br>
                (method==&quot;INVITE&quot; &amp;&amp; !has_totag())) &amp;&amp; client_nat_test(&quot;7&quot;))<br>
        {<br>
                nat_keepalive();<br>
        }<br>
        ####nat_traversal info ends<br>
<br>
        if (!mf_process_maxfwd_header(&quot;10&quot;)) {<br>
                sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>
                exit;<br>
        }<br>
<br>
        ##ak#<br>
        if ((is_method(&quot;INVITE&quot;)) &amp;&amp; has_totag()) {<br>
#(has_body(&quot;application/sdp&quot;))) {<br>
                engage_rtp_proxy();<br>
        }<br>
<br>
        if (has_totag()) {<br>
                # sequential request withing a dialog should<br>
                # take the path determined by record-routing<br>
                if (loose_route()) {<br>
                        if (is_method(&quot;BYE&quot;)) {<br>
                                setflag(1); # do accounting ...<br>
                                setflag(3); # ... even if the transaction<br>
fails<br>
                        } else if (is_method(&quot;INVITE&quot;)) {<br>
                                # even if in most of the cases is useless,<br>
do RR for<br>
                                # re-INVITEs alos, as some buggy clients do<br>
change route set<br>
                                # during the dialog.<br>
                                record_route();<br>
                        }<br>
                        # route it out to whatever destination was set by<br>
loose_route()<br>
                        # in $du (destination URI).<br>
                        route(1);<br>
                } else {<br>
                        /* uncomment the following lines if you want to<br>
enable presence */<br>
##if (is_method(&quot;SUBSCRIBE&quot;) &amp;&amp; $rd == &quot;your.server.ip.address&quot;) {<br>
                        ##      # in-dialog subscribe requests<br>
                        ##      route(2);<br>
                        ##      exit;<br>
                        ##}<br>
                        if ( is_method(&quot;ACK&quot;) ) {<br>
                                if ( t_check_trans() ) {<br>
                                        # non loose-route, but stateful ACK;<br>
must be an ACK after<br>
                                        # a 487 or e.g. 404 from upstream<br>
server<br>
                                        t_relay();<br>
                                        exit;<br>
                                } else {<br>
                                        # ACK without matching transaction<br>
-&gt;<br>
                                        # ignore and discard<br>
                                        exit;<br>
                                }<br>
                        }<br>
                        sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);<br>
                }<br>
                exit;<br>
        }<br>
<br>
        #initial requests<br>
<br>
        # CANCEL processing<br>
        if (is_method(&quot;CANCEL&quot;))<br>
        {<br>
                if (t_check_trans())<br>
                        t_relay();<br>
                #unforce_rtpproxy();<br>
                exit;<br>
        }<br>
<br>
        t_check_trans();<br>
<br>
# preloaded route checking<br>
        if (loose_route()) {<br>
                xlog(&quot;L_ERR&quot;,<br>
                &quot;Attempt to route with preloaded Route&#39;s<br>
[$fu/$tu/$ru/$ci]&quot;);<br>
                if (!is_method(&quot;ACK&quot;))<br>
                        sl_send_reply(&quot;403&quot;,&quot;Preload Route denied&quot;);<br>
                exit;<br>
        }<br>
<br>
        # record routing<br>
        if (!is_method(&quot;REGISTER|MESSAGE&quot;))<br>
                record_route();<br>
<br>
        # account only INVITEs<br>
        if (is_method(&quot;INVITE&quot;)) {<br>
                setflag(1); # do accounting<br>
        }<br>
        if (!uri==myself)<br>
        ## replace with following line if multi-domain support is used<br>
        ##if (!is_uri_host_local())<br>
        {<br>
                append_hf(&quot;P-hint: outbound\r\n&quot;);<br>
                # if you have some interdomain connections via TLS<br>
                ##if($rd==&quot;<a href="http://tls_domain1.net" target="_blank">tls_domain1.net</a>&quot;) {<br>
                ##      t_relay(&quot;tls:<a href="http://domain1.net" target="_blank">domain1.net</a>&quot;);<br>
                ##      exit;<br>
                ##} else if($rd==&quot;<a href="http://tls_domain2.net" target="_blank">tls_domain2.net</a>&quot;) {<br>
                ##      t_relay(&quot;tls:<a href="http://domain2.net" target="_blank">domain2.net</a>&quot;);<br>
                ##      exit;<br>
                ##}<br>
                route(1);<br>
        }<br>
<br>
        # requests for my domain<br>
<br>
        ## uncomment this if you want to enable presence server<br>
        ##   and comment the next &#39;if&#39; block<br>
        ##   NOTE: uncomment also the definition of route[2] from  below<br>
        ##if( is_method(&quot;PUBLISH|SUBSCRIBE&quot;))<br>
        ##              route(2);<br>
<br>
        if (is_method(&quot;PUBLISH&quot;))<br>
        {<br>
                sl_send_reply(&quot;503&quot;, &quot;Service Unavailable&quot;);<br>
                exit;<br>
        }<br>
<br>
<br>
        if (is_method(&quot;REGISTER&quot;))<br>
        {<br>
                # authenticate the REGISTER requests (uncomment to enable<br>
auth)<br>
                ##if (!www_authorize(&quot;&quot;, &quot;subscriber&quot;))<br>
##{<br>
                ##      www_challenge(&quot;&quot;, &quot;0&quot;);<br>
                ##      exit;<br>
                ##}<br>
                ##<br>
                ##if (!db_check_to())<br>
                ##{<br>
                ##      sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);<br>
                ##      exit;<br>
                ##}<br>
<br>
                #---- Request is behind NAT(flag5) save with bflag 6 ----#<br>
                #---- Use bflag 7 to start SIP pinging (Options)     ----#<br>
                if (isflagset(5)) {<br>
                        setbflag(6);<br>
                        setbflag(7);<br>
                };<br>
<br>
                if (!save(&quot;location&quot;))<br>
                        sl_reply_error();<br>
<br>
                exit;<br>
        }<br>
<br>
        if ($rU==NULL) {<br>
                # request with no Username in RURI<br>
                sl_send_reply(&quot;484&quot;,&quot;Address Incomplete&quot;);<br>
                exit;<br>
        }<br>
<br>
        # apply DB based aliases (uncomment to enable)<br>
        ##alias_db_lookup(&quot;dbaliases&quot;);<br>
if (!lookup(&quot;location&quot;,&quot;m&quot;)) {<br>
                switch ($retcode) {<br>
                        case -1:<br>
                        case -3:<br>
                                t_newtran();<br>
                                t_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>
                                exit;<br>
                        case -2:<br>
                                sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;);<br>
                                exit;<br>
                }<br>
        }<br>
<br>
        # when routing via usrloc, log the missed calls also<br>
        setflag(2);<br>
<br>
        route(1);<br>
}<br>
<br>
<br>
route[1] {<br>
        # for INVITEs enable some additional helper routes<br>
<br>
         #---- RTP Proxy handling ---#<br>
        if (is_method(&quot;BYE|CANCEL&quot;)) {<br>
                unforce_rtp_proxy();<br>
        } else if (is_method(&quot;INVITE&quot;)){<br>
                #---- Activates the RTP Proxy for the CALLEE ---#<br>
                rtpproxy_offer();<br>
        };<br>
        #ak## catch and fix replies<br>
        #ak#t_on_reply(&quot;2&quot;);<br>
<br>
        if (is_method(&quot;INVITE&quot;)) {<br>
                t_on_branch(&quot;2&quot;);<br>
                t_on_reply(&quot;2&quot;);<br>
                t_on_failure(&quot;1&quot;);<br>
        }<br>
<br>
        if (!t_relay()) {<br>
                sl_reply_error();<br>
        };<br>
        exit;<br>
}<br>
<br>
branch_route[2] {<br>
        if (client_nat_test(&quot;3&quot;)) {<br>
                fix_contact();<br>
        }<br>
<br>
        xlog(&quot;new branch at $ru\n&quot;);<br>
}<br>
<br>
<br>
onreply_route[2] {<br>
        if (client_nat_test(&quot;7&quot;)) {<br>
                fix_contact();<br>
                if ( is_method(&quot;INVITE&quot;) &amp;&amp; has_body(&quot;application/sdp&quot;) ){<br>
                        ######ak# (isflagset(5) || isbflagset(6)) &amp;&amp;<br>
                        rtpproxy_answer();<br>
                }<br>
        }<br>
        xlog(&quot;incoming reply\n&quot;);<br>
}<br>
<br>
<br>
failure_route[1] {<br>
<br>
        if (t_was_cancelled()) {<br>
                exit;<br>
        }<br>
<br>
        # uncomment the following lines if you want to block client<br>
        # redirect based on 3xx replies.<br>
        ##if (t_check_status(&quot;3[0-9][0-9]&quot;)) {<br>
        ##t_reply(&quot;404&quot;,&quot;Not found&quot;);<br>
        ##      exit;<br>
        ##}<br>
<br>
        # uncomment the following lines if you want to redirect the failed<br>
        # calls to a different new destination<br>
        ##if (t_check_status(&quot;486|408&quot;)) {<br>
        ##      sethostport(&quot;<a href="http://192.168.2.100:5060" target="_blank">192.168.2.100:5060</a>&quot;);<br>
        ##      # do not set the missed call flag again<br>
        ##      t_relay();<br>
        ##}<br>
}<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://opensips-open-sip-server.1449251.n2.nabble.com/Problem-with-OpenSIPS-1-7-NAT-and-RTPProxy-tp7581021.html" target="_blank">http://opensips-open-sip-server.1449251.n2.nabble.com/Problem-with-OpenSIPS-1-7-NAT-and-RTPProxy-tp7581021.html</a><br>

Sent from the OpenSIPS - Users mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br></div>