<div dir="ltr">Dear Bogdan,<br><br>Kindly note that I did what you asked for...It seems that I still have the same issue...The OpenSIPS replied to INVITE packet where the IN field still the PSTN gateway IP instead of OpenSIPS IP....Please check my config file below:<br>
<br>#<br># $Id: openser.cfg 3284 2007-12-06 18:56:59Z bogdan_iancu $<br>#<br># OpenSER basic configuration script<br># by Anca Vamanu <<a href="mailto:anca@voice-system.ro">anca@voice-system.ro</a>><br>#<br># Please refer to the Core CookBook at <a href="http://www.openser.org/dokuwiki/doku.php">http://www.openser.org/dokuwiki/doku.php</a><br>
# for a explanation of possible statements, functions and parameters.<br>#<br><br><br>####### Global Parameters #########<br><br>debug=7<br>log_stderror=yes<br>log_facility=LOG_LOCAL7<br><br>#fork=yes<br>fork=yes<br>children=4<br>
<br>##NATING OPTIONS<br>check_via=yes<br>dns=no<br>rev_dns=no<br><br>/* uncomment the following lines to enable debugging */<br>#debug=6<br>#fork=no<br>#log_stderror=yes<br><br>/* uncomment the next line to disable TCP (default on) */<br>
#disable_tcp=no<br><br>/* uncomment the next line to enable the auto temporary blacklisting of<br> not available destinations (default disabled) */<br>#disable_dns_blacklist=no<br><br>/* uncomment the next line to enable IPv6 lookup after IPv4 dns<br>
lookup failures (default disabled) */<br>#dns_try_ipv6=yes<br><br>/* uncomment the next line to disable the auto discovery of local aliases<br> based on revers DNS on IPs (default on) */<br>#auto_aliases=no<br><br>#OpenSer Config<br>
alias=<a href="http://domain.net">domain.net</a><br><br>/<br><br>/* uncomment and configure the following line if you want openser to<br> bind on a specific interface/port/proto (default bind on all available) */<br>listen=udp:<a href="http://sip.domain.net:5060">sip.domain.net:5060</a><br>
<br><br><br>####### Modules Section ########<br><br>#set module path<br>mpath="/usr/local/lib/opensips/modules/"<br><br>/* uncomment next line for MySQL DB support */<br>loadmodule "db_mysql.so"<br>loadmodule "sl.so"<br>
loadmodule "tm.so"<br>loadmodule "rr.so"<br>loadmodule "maxfwd.so"<br>loadmodule "usrloc.so"<br>loadmodule "registrar.so"<br>loadmodule "textops.so"<br>loadmodule "mi_fifo.so"<br>
loadmodule "uri_db.so"<br>loadmodule "uri.so"<br>loadmodule "xlog.so"<br>loadmodule "acc.so"<br>loadmodule "group.so"<br>loadmodule "nathelper.so"<br>loadmodule "avpops.so"<br>
loadmodule "carrierroute.so"<br>#loadmodule "xcap_client.so"<br><br>/* uncomment next lines for MySQL based authentication support<br> NOTE: a DB (like mysql) module must be also loaded */<br>loadmodule "auth.so"<br>
loadmodule "auth_db.so"<br>/* uncomment next line for aliases support<br> NOTE: a DB (like mysql) module must be also loaded */<br>loadmodule "alias_db.so"<br>/* uncomment next line for multi-domain support<br>
NOTE: a DB (like mysql) module must be also loaded<br> NOTE: be sure and enable multi-domain support in all used modules<br> (see "multi-module params" section ) */<br><br><br><br># ----------------- setting module-specific parameters ---------------<br>
<br><br># ---- ACC params # CHANGE BACK ENABLE THE BELOW<br><br><br>modparam("acc", "db_url", "mysql://username:passwd@DB_IP/opensips")<br>modparam("acc", "acc_from_tag_column", "from_tag")<br>
modparam("acc", "acc_to_tag_column", "to_tag")<br>modparam("acc", "db_flag", 2)<br>modparam("acc", "db_missed_flag", 6)<br>modparam("acc", "failed_transaction_flag", 7)<br>
modparam("acc", "report_cancels", 0)<br>modparam("acc", "report_ack", 0)<br>modparam("acc", "early_media", 0)<br>modparam("acc", "log_level", 0)<br>
modparam("acc", "log_flag", 1)<br>modparam("acc", "log_missed_flag", 0)<br>modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;dst_user=$rU;dst_domain=$rd")<br>
modparam("acc", "db_extra", "src_user=$fU;src_domain=$fd;dst_user=$rU;dst_domain=$rd")<br><br><br><br><br><br><br># ----------------- setting module-specific parameters ---------------<br>#######Carrier Route<br>
modparam("carrierroute", "db_url", "mysql://username:passwd@DB_IP/opensips")<br>modparam("carrierroute", "config_source", "db")<br><br><br><br><br># ------- Group Module<br>
modparam("group", "db_url", "mysql://username:passwd@DB_IP/opensips")<br><br><br><br># ---- alias params<br><br>#modparam("alias_db", "db_url", "mysql://user:passwd@localhost/openser")<br>
modparam("alias_db", "db_url", "mysql://username:passwd@DB_IP/opensips")<br>modparam("alias_db", "use_domain", 0)<br><br><br># ----- mi_fifo params -----<br>modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")<br>
<br><br># ----- rr params -----<br># add value to ;lr param to cope with most of the UAs<br>modparam("rr", "enable_full_lr",1)<br># do not append from tag to the RR (no need for this script)<br>modparam("rr", "append_fromtag", 0)<br>
<br><br># ----- rr params -----<br>modparam("registrar", "method_filtering", 1)<br>modparam("registrar", "default_expires", 1800)<br><br>/* uncomment the next line to disable parallel forking via location */<br>
/* uncomment the next line not to allow more than 10 contacts per AOR */<br>modparam("registrar", "max_contacts", 10)<br><br><br># ----- uri_db params -----<br>/* by default we disable the DB support in the module as we do not need it<br>
in this configuration */<br>modparam("uri_db", "use_uri_table", 0)<br>modparam("uri_db", "db_url", "mysql://username:passwd@DB_IP/opensips")<br><br><br><br><br># ----- usrloc params -----<br>
modparam("usrloc", "timer_interval", 10)<br>modparam("usrloc", "db_mode", 2)<br>modparam("usrloc", "db_url","mysql://username:passwd@DB_IP/opensips")<br>
<br><br><br><br># ----- auth_db params -----<br>modparam("auth_db", "calculate_ha1", yes)<br>modparam("auth_db", "password_column", "password")<br>modparam("auth_db", "use_domain", 0)<br>
modparam("auth_db", "db_url","mysql://username:passwd@DB_IP/opensips")<br><br><br><br>modparam("usrloc", "db_url","mysql://username:passwd@DB_IP/opensips")<br><br>
<br><br>####### AVPOPS Section<br>modparam("avpops","avp_url","mysql://username:passwd@DB_IP/opensips")<br>modparam("avpops","avp_table","usr_preferences")<br><br>
<br><br><br>modparam("usrloc", "nat_bflag", 6)<br><br><br>modparam("nathelper", "rtpproxy_sock", "udp:<a href="http://127.0.0.1:7890">127.0.0.1:7890</a>")<br>modparam("nathelper", "natping_interval", 30)<br>
modparam("nathelper", "ping_nated_only", 1)<br>modparam("nathelper", "sipping_bflag", 7)<br>modparam("nathelper", "sipping_from", "sip:pinger@OpenSIPS_IP")<br>
<br><br><br><br>modparam("registrar", "received_avp", "$avp(i:42)")<br>modparam("nathelper", "received_avp", "$avp(i:42)")<br><br><br><br><br># ------------------------- request routing logic --------------#<br>
####### Routing Logic ########<br><br><br>route<br>{<br> if(!mf_process_maxfwd_header("10")){<br> sl_send_reply("486", "To Many Hops");<br> return;<br> }<br>
<br> if(msg:len >= max_len){<br> sl_send_reply("513", "Message To Big");<br> return;<br> }<br><br> # NAT detection<br> route(3);<br><br><br>
if(!is_method("REGISTER")){<br> record_route();<br> }<br><br><br>if (is_method("INVITE")) {<br> setflag(4); # do accounting<br> }<br><br><br> <br>
<br>if (is_method("OPTIONS") && uri==myself && $rU==NULL ) {<br> sl_send_reply("200","OK");<br> exit;<br> }<br><br>if( uri == myself )<br>{<br><br> if(is_method("REGISTER")){<br>
<br><br><br><br><br> if (is_user_in("From", "blocked")) {<br> sl_send_reply("403", "Unauthorized, account is disabled");<br> exit();<br>
}<br><br><br><br><br> if(!www_authorize("<a href="http://domain.net">domain.net</a>", "subscriber")){<br> www_challenge("<a href="http://domain.net">domain.net</a>", "1");<br>
return;<br> }<br><br> if (isflagset(5))<br> {<br> <br> setbflag(6);<br>
# if you want OPTIONS natpings uncomment next<br> # setbflag(7);<br> };<br><br> save("location");<br><br><br><br>
}<br><br>}<br><br><br> alias_db_lookup("dbaliases");<br><br><br> <br><br><br><br><br><br> if($rU =~ "^00.*")<br> {<br><br><br>if(!cr_route("default", "0", "$rU", "$rU", "call_id")){<br>
sl_send_reply("403", "Not allowed");<br> } else {<br> # In cas of failure, re-route the request<br> t_on_failure("1");<br> t_on_reply("1");<br>force_rtp_proxy();<br>
t_relay();<br> }<br><br><br><br><br> }<br><br><br><br> if(does_uri_exist()){<br> # local uri does exist, is probably a user.<br> xlog("L_INFO","User Exists");<br>
<br> # lookup location<br> if(lookup("location")){<br> xlog("L_INFO","User Online");<br> route(1);<br>
return;<br><br> }<br> else<br> {<br><br>if(src_ip!=OS2_IP)<br> {<br> #Diverting to Server 2<br>
xlog("L_INFO","REDIRECCTING TO SERVER 2");<br> rewritehost("OS2_IP");<br> route(1);<br> }<br> else<br>
{<br> sl_send_reply("404", "OK");<br> exit;<br><br> }<br><br> }<br>
}#end of URI Found IF<br> else<br> {<br><br> if(!is_method("REGISTER")){<br><br><br><br> return;<br> }<br><br> }<br>}<br><br><br><br><br>route[1] {<br><br><br><br>
<br> if (is_method("INVITE")) {<br> t_on_branch("2");<br> t_on_reply("2");<br> t_on_failure("1");<br> }<br><br><br> if (subst_uri('/(sip:.*);nat=yes/\1/')){<br>
setbflag(6);<br> };<br><br>if (method=="BYE" || method=="CANCEL") {<br>route(4);<br>};<br><br><br><br><br><br> if(isflagset(5)||isbflagset(6)) {<br> route(4);<br> }<br>
<br> if (!t_relay()) {<br> sl_reply_error();<br> };<br> exit;<br>}<br><br><br><br><br> <br><br><br><br>route[3]{<br> force_rport();<br> if (nat_uac_test("19")) {<br>
if (method=="REGISTER") {<br> fix_nated_register();<br> } else {<br> fix_nated_contact();<br> };<br> setflag(5);<br> };<br>}<br><br>
<br><br>route[4] {<br><br><br> if (is_method("BYE")) {<br> unforce_rtp_proxy();<br> } else if (is_method("INVITE")){<br> force_rtp_proxy();<br> t_on_failure("2");<br>
};<br><br> if (isflagset(5))<br> search_append('Contact:.*sip:[^>[:cntrl:]]*', ';nat=yes');<br> t_on_reply("1");<br> }<br><br><br><br> branch_route[2] {<br>
xlog("new branch at $ru\n");<br>}<br><br><br>onreply_route[2] {<br> xlog("incoming reply\n");<br>}<br><br><br>failure_route[1] {<br> if (t_was_cancelled()) {<br> exit;<br>
}<br><br><br>}<br><br>failure_route[2] {<br> if (isbflagset(6) || isflagset(5)) {<br> unforce_rtp_proxy();<br> }<br>}<br><br><br><br>onreply_route[1] {<br> if (t_check_status("2[0-9][0-9]")) {<br>
force_rtp_proxy();<br> }<br>exit;<br>}<br><br><br>I need advice please<br><br>Regards<br><br><div class="gmail_quote">On Fri, Feb 27, 2009 at 3:04 PM, michel freiha <span dir="ltr"><<a href="mailto:michofr@gmail.com">michofr@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Thanks Bogdan...I'll check this and get back to you<br><br>Regards<div><div>
</div><div class="h5"><br><br><div class="gmail_quote">On Fri, Feb 27, 2009 at 1:34 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi michel,<br>
<br>
Should do something like:<div><br>
<br>
if(!cr_route("default", "0", "$rU", "$rU", "call_id")){<br>
sl_send_reply("403", "Not allowed");<br>
} else {<br>
# In cas of failure, re-route the request<br>
t_on_failure("1");<br></div>
t_on_reply("1");<div><br>
force_rtp_proxy();<br>
t_relay();<br>
}<br>
<br>
<br></div>
onreply_route[1] {<br>
if (t_check_status("2[0-9][0-9]")) {<br>
force_rtp_proxy();<br>
}<br>
}<br>
<br>
See : <a href="http://www.opensips.org/index.php?n=Resources.DocsCoreRoutes#toc4" target="_blank">http://www.opensips.org/index.php?n=Resources.DocsCoreRoutes#toc4</a><div><br>
<br>
Regards,<br>
Bogdan<br>
<br>
michel freiha wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
Dear Bogdan,<br>
<br>
Do you mean doing something like that?<br>
<br>
if(!cr_route("default", "0", "$rU", "$rU", "call_id")){<br>
sl_send_reply("403", "Not allowed");<br>
} else {<br>
# In cas of failure, re-route the request<br>
t_on_failure("1");<br>
<br>
force_rtp_proxy();<br>
t_relay();<br>
route(2) ;<br>
}<br>
<br>
<br>
Please let me know how can I force it on route2 for the 200OK reply<br>
<br>
Thanks Bogdan<br>
<br>
<br></div><div>
On Fri, Feb 27, 2009 at 11:54 AM, Bogdan-Andrei Iancu <<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a> <mailto:<a href="mailto:bogdan@voice-system.ro" target="_blank">bogdan@voice-system.ro</a>>> wrote:<br>
<br>
Hi Michel,<br>
<br>
You have to call twice force_rtp_proxy() in order to complete the<br>
RTP session (and have RTP flowing). First for the INVITE (as you<br>
already do) and second for the 200 OK reply.<br>
<br>
So install a onreply_route and if the reply is 200 OK, call again<br>
force_rtp_proxy.<br>
<br>
Regards,<br>
Bogdan<br>
<br>
michel freiha wrote:<br>
<br>
Dear All,<br>
<br>
I need to make all my rtp traffic through OpenSips to pass<br>
through rtp proxy...I have the following route:<br>
<br>
<br>
if(!cr_route("default", "0", "$rU", "$rU", "call_id")){<br>
sl_send_reply("403", "Not allowed");<br>
} else {<br>
# In cas of failure, re-route the request<br>
t_on_failure("1");<br>
force_rtp_proxy();<br>
t_relay();<br>
}<br>
The call is working fine but with no audio...How can i fix<br>
this issue in order to have 2 way audio through rtpproxy?<br>
<br>
Regards<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br></div>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>><div><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>
<br>
<br>
</div></blockquote>
<br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>