Thanks, that really helped. <div><br></div><div>I am still having problem with the following: when user x calls user y, audio is one-way, and when audio y calls x, audio is two-way. Why is it so? What could be the possible reasons?</div>
<div><br></div><div>Also would like to add that -- iptables has to be appropriate rules on opensips to get clients connecting to it or even rtpproxy connecting to it.</div><div><br></div><div>--</div><div>sip user.<br><br>
<div class="gmail_quote">On Fri, Aug 3, 2012 at 4:49 AM, SamyGo <span dir="ltr"><<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<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><div class="im"><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-size:13.333333969116211px;font-family:arial,sans-serif">modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:9999")<br>
</span><span style="color:rgb(34,34,34);font-size:13.333333969116211px;font-family:arial,sans-serif">modparam("rtpproxy", "nortpproxy_str", "a=sdpmangled:yes\r\n")<br>
</span><font color="#ff6666"><span style="font-size:13.333333969116211px;font-family:arial,sans-serif">modparam("rtpproxy", "db_url",<br></span><span style="font-size:13.333333969116211px;font-family:arial,sans-serif">"mysql://opensips:opensipsrw@</span></font><span style="font-size:13.333333969116211px;font-family:arial,sans-serif"><font color="#ff6666">localhost/opensips")</font><br>
</span><span style="color:rgb(34,34,34);font-size:13.333333969116211px;font-family:arial,sans-serif">#modparam("rtpproxy", "db_table", "nh_rtpp")<br></span><font color="#ff6666"><span style="font-size:13.333333969116211px;font-family:arial,sans-serif">modparam("rtpproxy", "rtpp_socket_col", "rtpproxy_sock")</span> </font></blockquote>
<div><br></div></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 class="h5"><div> </div><br><div class="gmail_quote">
On Fri, Aug 3, 2012 at 2:38 AM, siponcloud user <span dir="ltr"><<a href="mailto:kash906@gmail.com" target="_blank">kash906@gmail.com</a>></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>
"ERROR:rtpproxy:select_rtpp_node: script error -no valid set selected"<br>
"ERROR:rtpproxy:force_rtp_proxy: no available proxies"<br>
<br>
#-------- nat_traversal params -----<br>
modparam("nat_traversal", "keepalive_interval", 30)<br>
modparam("nat_traversal", "keepalive_method", "OPTIONS")<br>
modparam("nat_traversal", "keepalive_from", "sip:[hidden email]")<br>
modparam("nat_traversal", "keepalive_state_file",<br>
"/var/run/opensips/keepalive_state")<br>
<br>
#ak# --- rtpproxy -----<br>
# single rtproxy with specific weight<br>
modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:9999")<br>
modparam("rtpproxy", "nortpproxy_str", "a=sdpmangled:yes\r\n")<br>
modparam("rtpproxy", "db_url",<br>
"mysql://opensips:opensipsrw@localhost/opensips")<br>
#modparam("rtpproxy", "db_table", "nh_rtpp")<br>
modparam("rtpproxy", "rtpp_socket_col", "rtpproxy_sock")<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("7")) {<br>
fix_contact();<br>
setflag(5);<br>
}<br>
<br>
if ((method=="REGISTER" || method=="SUBSCRIBE" ||<br>
(method=="INVITE" && !has_totag())) && client_nat_test("7"))<br>
{<br>
nat_keepalive();<br>
}<br>
####nat_traversal info ends<br>
<br>
if (!mf_process_maxfwd_header("10")) {<br>
sl_send_reply("483","Too Many Hops");<br>
exit;<br>
}<br>
<br>
##ak#<br>
if ((is_method("INVITE")) && has_totag()) {<br>
#(has_body("application/sdp"))) {<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("BYE")) {<br>
setflag(1); # do accounting ...<br>
setflag(3); # ... even if the transaction<br>
fails<br>
} else if (is_method("INVITE")) {<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("SUBSCRIBE") && $rd == "your.server.ip.address") {<br>
## # in-dialog subscribe requests<br>
## route(2);<br>
## exit;<br>
##}<br>
if ( is_method("ACK") ) {<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>
-><br>
# ignore and discard<br>
exit;<br>
}<br>
}<br>
sl_send_reply("404","Not here");<br>
}<br>
exit;<br>
}<br>
<br>
#initial requests<br>
<br>
# CANCEL processing<br>
if (is_method("CANCEL"))<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("L_ERR",<br>
"Attempt to route with preloaded Route's<br>
[$fu/$tu/$ru/$ci]");<br>
if (!is_method("ACK"))<br>
sl_send_reply("403","Preload Route denied");<br>
exit;<br>
}<br>
<br>
# record routing<br>
if (!is_method("REGISTER|MESSAGE"))<br>
record_route();<br>
<br>
# account only INVITEs<br>
if (is_method("INVITE")) {<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("P-hint: outbound\r\n");<br>
# if you have some interdomain connections via TLS<br>
##if($rd=="<a href="http://tls_domain1.net" target="_blank">tls_domain1.net</a>") {<br>
## t_relay("tls:<a href="http://domain1.net" target="_blank">domain1.net</a>");<br>
## exit;<br>
##} else if($rd=="<a href="http://tls_domain2.net" target="_blank">tls_domain2.net</a>") {<br>
## t_relay("tls:<a href="http://domain2.net" target="_blank">domain2.net</a>");<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 'if' block<br>
## NOTE: uncomment also the definition of route[2] from below<br>
##if( is_method("PUBLISH|SUBSCRIBE"))<br>
## route(2);<br>
<br>
if (is_method("PUBLISH"))<br>
{<br>
sl_send_reply("503", "Service Unavailable");<br>
exit;<br>
}<br>
<br>
<br>
if (is_method("REGISTER"))<br>
{<br>
# authenticate the REGISTER requests (uncomment to enable<br>
auth)<br>
##if (!www_authorize("", "subscriber"))<br>
##{<br>
## www_challenge("", "0");<br>
## exit;<br>
##}<br>
##<br>
##if (!db_check_to())<br>
##{<br>
## sl_send_reply("403","Forbidden auth ID");<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("location"))<br>
sl_reply_error();<br>
<br>
exit;<br>
}<br>
<br>
if ($rU==NULL) {<br>
# request with no Username in RURI<br>
sl_send_reply("484","Address Incomplete");<br>
exit;<br>
}<br>
<br>
# apply DB based aliases (uncomment to enable)<br>
##alias_db_lookup("dbaliases");<br>
if (!lookup("location","m")) {<br>
switch ($retcode) {<br>
case -1:<br>
case -3:<br>
t_newtran();<br>
t_reply("404", "Not Found");<br>
exit;<br>
case -2:<br>
sl_send_reply("405", "Method Not Allowed");<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("BYE|CANCEL")) {<br>
unforce_rtp_proxy();<br>
} else if (is_method("INVITE")){<br>
#---- Activates the RTP Proxy for the CALLEE ---#<br>
rtpproxy_offer();<br>
};<br>
#ak## catch and fix replies<br>
#ak#t_on_reply("2");<br>
<br>
if (is_method("INVITE")) {<br>
t_on_branch("2");<br>
t_on_reply("2");<br>
t_on_failure("1");<br>
}<br>
<br>
if (!t_relay()) {<br>
sl_reply_error();<br>
};<br>
exit;<br>
}<br>
<br>
branch_route[2] {<br>
if (client_nat_test("3")) {<br>
fix_contact();<br>
}<br>
<br>
xlog("new branch at $ru\n");<br>
}<br>
<br>
<br>
onreply_route[2] {<br>
if (client_nat_test("7")) {<br>
fix_contact();<br>
if ( is_method("INVITE") && has_body("application/sdp") ){<br>
######ak# (isflagset(5) || isbflagset(6)) &&<br>
rtpproxy_answer();<br>
}<br>
}<br>
xlog("incoming reply\n");<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("3[0-9][0-9]")) {<br>
##t_reply("404","Not found");<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("486|408")) {<br>
## sethostport("<a href="http://192.168.2.100:5060" target="_blank">192.168.2.100:5060</a>");<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" target="_blank">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></div></div>
<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>
<br></blockquote></div><br></div>