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