The auto_aliases default is "on" according to the core cookbook for 1.3.x so I did not add that to my configuration. I did add alias=8.17.32.184:5060 per your suggestion and the ACK still continues in the infinite loop until the max hops is reached. I am using loose_route() if (has_totag() == true). I am pasting a copy of my openser config below for additional information on my specific configuration.
Thank You Stagg Shelton
# # $Id: openser.cfg 3542 2008-01-16 15:00:34Z miconda $ # # OpenSER basic configuration script # by Anca Vamanu anca@voice-system.ro # # 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=3 log_stderror=no log_facility=LOG_LOCAL0
fork=yes children=4
/* 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=yes
port=5060
alias=8.17.32.184:5060
####### Modules Section ########
#set module path mpath="//lib/openser/modules/"
loadmodule "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 "auth.so" loadmodule "auth_db.so" loadmodule "avpops.so" loadmodule "alias_db.so" loadmodule "permissions.so" loadmodule "carrierroute.so" loadmodule "snmpstats.so" loadmodule "dialog.so" loadmodule "group.so" loadmodule "options.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 ) */ #loadmodule "domain.so"
# ----------------- setting module-specific parameters ---------------
# ----- mi_fifo params ----- modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")
# ----- rr params ----- # add value to ;lr param to cope with most of the UAs modparam("rr", "enable_full_lr", 1) modparam("rr", "append_fromtag", 0)
# ----- rr params ----- modparam("registrar", "method_filtering", 1) /* uncomment the next line to disable parallel forking via location */ # modparam("registrar", "append_branches", 0) /* 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", "")
# ----- acc params ----- /* what sepcial events should be accounted ? */ modparam("acc", "early_media", 1) modparam("acc", "report_ack", 1) modparam("acc", "report_cancels", 1) /* by default ww do not adjust the direct of the sequential requests. if you enable this parameter, be sure the enable "append_fromtag" in "rr" module */ modparam("acc", "detect_direction", 0)
/* account triggers (flags) */ modparam("acc", "failed_transaction_flag", 3) modparam("acc", "log_flag", 1) modparam("acc", "log_missed_flag", 2) modparam("acc", "db_flag", 1) modparam("acc", "db_missed_flag", 2) #modparam("acc","db_extra", "acc_extra=$var(accounting); acc_to= $var(numdialed)") modparam("acc","db_extra", "acc_extra=$var(accounting); acc_to= $var(numdialed); acc_direction=$var(direction)") #modparam("acc","db_extra", "acc_extra=$au; email=$avp(s:email)") modparam("acc", "db_url", "mysql://openser:oserdbpass@localhost/ openser")
# ----- usrloc params ----- modparam("usrloc", "db_mode", 2) modparam("usrloc", "db_url","mysql://openser:oserdbpass@localhost/ openser")
# ----- auth_db params ----- modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") modparam("auth_db", "db_url","mysql://openser:oserdbpass@localhost/ openser") modparam("auth_db", "load_credentials", "")
# ----- alias_db params ----- modparam("alias_db", "db_url","mysql://openser:oserdbpass@localhost/ openser")
# ----- permissions params ----- modparam("permissions", "db_url","mysql://openser:oserdbpass@localhost/ openser")
# ----- carrierroute params ----- modparam("carrierroute", "config_source", "db") modparam("carrierroute", "db_url", "mysql:// openser:oserdbpass@localhost/openser")
# ----- smpstats params ----- modparam("snmpstats", "sipEntityType", "registrarServer") modparam("snmpstats", "sipEntityType", "proxyServer") modparam("snmpstats", "snmpCommunity", "snmppass") modparam("snmpstats", "snmpgetPath", "/usr/bin/")
# ----- dialog params ----- modparam("dialog", "enable_stats", 1) modparam("dialog", "dlg_flag", 4) modparam("dialog", "db_mode", 1) modparam("dialog", "db_url", "mysql://openser:oserdbpass@localhost/ openser")
# ----- group params ----- modparam("group", "db_url", "mysql://openser:oserdbpass@localhost/ openser")
####### Routing Logic ########
# main request routing logic
route{ $var(accounting) = ""; $var(numdialed) = ""; $var(direction) = "";
if (!mf_process_maxfwd_header("10")) { sl_send_reply("483","Too Many Hops"); exit; }
# Options responder if (uri==myself) { if ((method==OPTIONS) && (! uri=~"sip:.*[@]+.*")) { options_reply(); } }
if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method("BYE")) { setflag(1); # do accouting ... setflag(3); # ... even if the transaction fails } route(1); } else { if ( is_method("ACK") ) { if ( t_check_trans() ) { # non loose-route, but stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction ... ignore and discard.\n"); exit; } } sl_send_reply("404","Not here"); } exit; }
#initial requests
# CANCEL processing if (is_method("CANCEL")) { if (t_check_trans()) setflag(1); setflag(2); t_relay(); exit; }
t_check_trans();
if (!(method=="REGISTER")) { if (!allow_trusted()) { if (!proxy_authorize("", "subscriber")) { $var(debug) = proxy_authorize("", "subscriber"); xlog("L_INFO", "Proxy authentication failed - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n"); xlog("Not Proxy Authorize: $var(debug)"); proxy_challenge("", "0"); exit; }
consume_credentials(); # caller authenticated } }
# record routing if (!is_method("REGISTER|MESSAGE")) record_route();
if (method=="INVITE"||method=="BYE"||method=="CANCEL") { setflag(4); }
if (!uri==myself) { append_hf("P-hint: outbound\r\n"); route(1); }
# requests for my domain
if (is_method("PUBLISH")) { sl_send_reply("503", "Service Unavailable"); exit; }
if (is_method("REGISTER")) { if (!www_authorize("", "subscriber")) { www_challenge("", "0"); exit; } if (!check_to()) { sl_send_reply("403","Forbidden auth ID"); exit; }
if (!save("location")) sl_reply_error();
exit; }
if ($rU==NULL) { # request with no Username in RURI sl_send_reply("484","Address Incomplete"); exit; }
alias_db_lookup("dbaliases"); $var(accounting) = $rU; xlog ("After alias db lookup: $rU"); remove_hf("Diversion"); if (!lookup("location")) { switch ($retcode) { case -1: case -3: if (uri=~"^sip:[0-9]{10}@") # Domestic PSTN { route(4); exit; } else if (uri=~"^sip:1[0-9]{10}@") # Domestic PSTN { route(4); exit; } else if (uri=~"^sip:011[0-9][0-9]+@") # International PSTN { route(3); exit; };
t_reply("404", "User Not Found"); exit; case -2: sl_send_reply("405", "Method Not Allowed"); exit; } } else { $rU = $oU; $var(numdialed) = $rU; $var(direction)="inbound"; } # when routing via usrloc, log the missed calls also setflag(2);
route(1); }
route[1] { # for INVITEs enable some additional helper routes if (is_method("INVITE")) { xlog("aubrey direction $var(direction)"); setflag(1); setflag(4); t_on_branch("2"); t_on_reply("2"); t_on_failure("1"); } if (!t_relay()) { sl_reply_error(); }; exit; }
route[3] {
# ----------------------------------------------------------------- # PSTN International Handler # ----------------------------------------------------------------- $var(accounting) = $au; $var(numdialed) = $rU; $var(direction)="outbound";
if(!is_user_in("Credentials", "international")){ sl_send_reply("403", "Forbidden: No Intl Service"); exit; }
cr_user_rewrite_uri("sip:$au@.*","mydomain.net"); $avp(s:inv_timeout) = 45;
route(1); }
route[4] {
# ----------------------------------------------------------------- # PSTN Handler # ----------------------------------------------------------------- $var(accounting) = $au; $var(numdialed) = $rU; $var(direction)="outbound";
cr_user_rewrite_uri("sip:$au@.*","mydomain.net"); $avp(s:inv_timeout) = 45;
route(1); }
branch_route[2] { xlog("new branch at $ru\n"); }
onreply_route[2] { xlog("incoming reply $rm\n"); xlog("$rb\n"); }
failure_route[1] { if (t_was_cancelled()) { exit; } }
On Aug 25, 2008, at 5:04 AM, Iñaki Baz Castillo wrote:
El Saturday 23 August 2008 16:57:42 Stagg Shelton escribió:
Thanks again Iñaki. I am attaching siptrace.txt file. I can see that there appears to be something odd with the ACKs in that they appear to be sent from my openser back to my openser in a loop until the max forwards is reached.
Hi, just to clarify: is it your nre carrier an Asterisk? It's not the problem anyway.
The problem is in your OpenSer ACK handling. Note that:
U +0.072541 phone:5060 -> OpenSer:5060 ACK sip:+16783832765@OpenSer SIP/2.0* Via: SIP/2.0/UDP phone:5060;branch=z9hG4bK-8922-48b022e5- dcaa5757-3884948f* Contact: sip:restricted@phone:5060;transport=udp* Route: sip:OpenSer;lr;did=952.4d684275*
# U +0.002367 OpenSer:5060 -> OpenSer:5060 ACK sip:OpenSer;lr;did=952.4d684275 SIP/2.0* Via: SIP/2.0/UDP OpenSer;branch=z9hG4bKc29c.498b5a5.2* Via: SIP/2.0/UDP phone:5060;branch=z9hG4bK-8922-48b022e5- dcaa5757-3884948f* Contact: sip:restricted@phone:5060;transport=udp*
# U +0.000072 OpenSer:5060 -> OpenSer:5060 ACK sip:OpenSer;lr;did=952.4d684275 SIP/2.0* Via: SIP/2.0/UDP OpenSer;branch=z9hG4bKc29c.498b5a5.2* Via: SIP/2.0/UDP OpenSer;branch=z9hG4bKc29c.498b5a5.2* Via: SIP/2.0/UDP phone:5060;branch=z9hG4bK-8922-48b022e5- dcaa5757-3884948f* Contact: sip:restricted@phone:5060;transport=udp*
The problem is that your OpenSer receives an ACK (a new request in- dialog since it's an ACK for a 200 OK) with a "Route: sip:OpenSer". This is correct of course. So your OpenSer should do loose_route() and detect "OpenSer" IP as an own ip/domain so it would remove the Route and route the ACK to the RURI (Asterisk IP). But OpenSer doesn't realiza the OpenSer IP is itself so it doesn't remove the Route and routes the ACK according to that Route, this is, doing INFINITE loops to itself.
So you must fix it by adding you OpenSer IP as an alias in the top of your OpenSer script:
alias = OpenSer_IP:5060
or maybe it's enough with:
auto_aliases=yes
Hope you understood me. If not see me.
-- Iñaki Baz Castillo ibc@in.ilimit.es
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users