[OpenSIPS-Users] Error for 408 timeout and P-hint: outbound for Realtime OpenSIPS - Asterisk Integration

toasterisk at gmail.com toasterisk at gmail.com
Tue May 27 09:32:25 CEST 2014


Hello,all:
I am trying to use asterisk and opensips and follow the link:
http://www.opensips.org/Documentation/Tutorials-OpenSIPSAsteriskIntegration-1-8. 
when i register my sip phone, I got the 408 timeout and P-hint:outbound from 
ngrep -d lo -qt -W byline port 5060. when i use the example CFG to startup the opensips, i got many errors due to 
the module compatebility. so i change some modules for opensips-1.8, therefore I suspect the modules i loaded is wrong. 
--------------------------------------------CFG---------------------------------
#
# $Id: opensips.cfg 8758 2012-02-29 11:59:26Z vladut-paiu $
#
# OpenSIPS residential configuration script
# by OpenSIPS Solutions <team at opensips-solutions.com>
#
# This script was generated via "make menuconfig", from
# the "Residential" scenario.
# You can enable / disable more features / functionalities by
# re-generating the scenario with different options.#
#
# Please refer to the Core CookBook at:
# http://www.opensips.org/Resources/DocsCookbooks
# for a explanation of possible statements, functions and parameters.
#


####### Global Parameters #########

debug=5
log_stderror=yes
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 enable the auto temporary blacklisting of 
not available destinations (default disabled) */
disable_dns_blacklist=yes

/* uncomment the next line to enable IPv6 lookup after IPv4 dns 
lookup failures (default disabled) */
#dns_try_ipv6=yes

/* comment the next line to enable the auto discovery of local aliases
based on revers DNS on IPs */
/* auto_aliases=yes */ 
/* alias=test.com */
# port = 5060
listen=udp:192.168.1.104:5060 # CUSTOMIZE ME 


disable_tcp=yes

# disable_tls=yes


####### Modules Section ########

#set module path
mpath="/usr/local/lib/opensips/modules/"

loadmodule "db_mysql.so"
loadmodule "signaling.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 "sipmsgops.so"
loadmodule "domain.so"



# ----------------- setting module-specific parameters ---------------


# ----- 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_double_rr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)

# ----- usrloc params -----
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips")

# ----- uri_db params -----
#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)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)

# ----- auth_db params -----
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips")
modparam("auth_db", "load_credentials", "")

# ----- domain params -----
modparam("domain", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips")
modparam("domain", "db_mode", 1) # Use caching

# ----- multi-module params -----
/* uncomment the following line if you want to enable multi-domain support
in the modules (dafault off) */
modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)


####### Routing Logic ########


# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
send_reply("483","Too Many Hops");
exit;
}

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 accounting ...
setflag(3); # ... even if the transaction fails
} else if (is_method("INVITE")) {
# even if in most of the cases is useless, do RR for
# re-INVITEs alos, as some buggy clients do change route set
# during the dialog.
record_route();
}
# route it out to whatever destination was set by loose_route()
# in $du (destination URI).
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
exit;
}
}
send_reply("404","Not here");
}
exit;
}

#initial requests

# CANCEL processing
if (is_method("CANCEL")) {
if (t_check_trans())
t_relay();
exit;
}

t_check_trans();

# authenticate if from local subscriber
if (!(method=="REGISTER") && is_from_local()) {
if (!proxy_authorize("", "subscriber")) {
proxy_challenge("", "0");
exit;
}
if (!db_check_from()) {
send_reply("403","Forbidden auth ID");
exit;
}

consume_credentials();
# caller authenticated
}

# preloaded route checking
if (loose_route()) {
xlog("L_ERR",
"Attempt to route with preloaded Route's [$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
send_reply("403","Preload Route denied");
exit;
}

# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();

# account only INVITEs
if (is_method("INVITE")) {
setflag(1); # do accounting
}

# if not a targetting a local SIP domain, just send it out
# based on DNS (calls to foreign SIP domains)
if (!is_uri_host_local()) {
append_hf("P-hint: outbound\r\n"); 
route(1);
}

# requests for my domain

if (is_method("REGISTER")) {
# authenticate the REGISTER requests
if (!www_authorize("", "subscriber")) {
www_challenge("", "0");
exit;
}
if (!db_check_to()) {
send_reply("403","Forbidden auth ID");
exit;
}

if (!save("location"))
sl_reply_error();

exit;
}

if ($rU==NULL) {
# request with no Username in RURI
send_reply("484","Address Incomplete");
exit;
}

# ASTERISK HOOK - BEGIN
# media service number? (digits starting with *)
if ($rU=~"^\*[1-9]+") {
# we do provide access to media services only to our
# subscribers, who were previously authenticated 
if (!is_from_local()) {
send_reply("403","Forbidden access to media service");
exit;
}
#identify the services and translate to Asterisk extensions
if ($rU=="*1111") {
# access to own voicemail IVR
seturi("sip:VM_pickup at 192.168.1.104:5090");
} else
if ($rU=="*2111") {
# access to the "say time" announcement 
seturi("sip:AN_time at 192.168.1.104:5090");
} else
if ($rU=="*2112") {
# access to the "say date" announcement 
seturi("sip:AN_date at 192.168.1.104:5090");
} else
if ($rU=="*2113") {
# access to the "echo" service
seturi("sip:AN_echo at 192.168.1.104:5090");
} else
if ($rU=~"\*3[0-9]{3}") {
# access to the conference service 
# remove the "*3" prefix and place the "CR_" prefix
strip(2);
prefix("CR_");
rewritehostport("192.168.1.104:5090");
} else {
# unknown service
seturi("sip:AN_notavailable at 192.168.1.104:5090");
}
# after setting the proper RURI (to point to corresponding ASTERISK extension),
# simply forward the call
t_relay();
exit;
}
# ASTERISK HOOK - END

# do lookup
if (!lookup("location")) {
# ASTERISK HOOK - BEGIN
# callee is not registered, so different to Voicemail
# First add the VM recording prefix to the RURI
prefix("VMR_");
# forward to the call to Asterisk (replace below with real IP and port)
rewritehostport("192.168.1.104:5090");
route(1);
# ASTERISK HOOK - END
exit;
}

# when routing via usrloc, log the missed calls also
setflag(2);

# arm a failure route in order to catch failed calls
# targeting local subscribers; if we fail to deliver
# the call to the user, we send the call to voicemail
t_on_failure("1");

route(1);
}


route[1] {
if (!t_relay()) {
sl_reply_error();
};
exit;
}


failure_route[1] {
if (t_was_cancelled()) {
exit;
}

# if the failure code is "408 - timeout" or "486 - busy",
# forward the calls to voicemail recording
if (t_check_status("486|408")) {
# ASTERISK HOOK - BEGIN
# First revert the RURI to get the original user in RURI
# Then add the VM recording prefix to the RURI
revert_uri();
prefix("VMR_");
# forward to the call to Asterisk (replace below with real IP and port)
rewritehostport("192.168.1.104:5090");
t_relay();
# ASTERISK HOOK - END
exit;
}
}


============================ngrep debug======================================================== 

Via: SIP/2.0/UDP 192.168.1.200:16377;received=192.168.1.200;branch=z9hG4bK-d87543-e92fd965fb6c5113-1--d87543-;rport=16377. 
Max-Forwards: 29. 
Contact: <sip:101 at 192.168.1.200:16377;rinstance=624d83088d4ed92e>. 
To: "101"<sip:101 at 192.168.1.104>. 
From: "101"<sip:101 at 192.168.1.104>;tag=de6d7016. 
Call-ID: ODMyNTg1MmU2YTQzN2Q5MzAyNDJiYjY2Njk3NWE0MWI.. 
CSeq: 2 REGISTER. 
Expires: 3600. 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO. 
User-Agent: X-Lite release 1011s stamp 41150. 
Content-Length: 0. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
. 


U 2014/05/27 15:20:54.894213 192.168.1.104:5060 -> 192.168.1.104:5060 
REGISTER sip:192.168.1.104 SIP/2.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.a2d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.92d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.82d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.72d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.62d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.52d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.42d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.32d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.22d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.12d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.02d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.f1d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.e1d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.d1d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.c1d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.b1d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.a1d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.91d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.81d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.71d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.61d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.51d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.41d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.31d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.21d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.11d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.01d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.f0d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.e0d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.d0d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.c0d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.b0d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.a0d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.90d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.80d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.70d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.60d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.50d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.40d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.30d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.20d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.10d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.00d88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.ffc88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.efc88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.dfc88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.cfc88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.104;branch=z9hG4bK6ed.bfc88ec4.0. 
Via: SIP/2.0/UDP 192.168.1.103:5060;received=192.168.1.103;branch=z9hG4bK112230595;rport=5060. 
From: <sip:bob at 192.168.1.104>;tag=1244885899. 
To: <sip:bob at 192.168.1.104>. 
Call-ID: 1761427266-5060-1 at BJC.BGI.B.BAD. 
CSeq: 2045 REGISTER. 
Contact: <sip:bob at 192.168.1.103:5060>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000B824017A0>". 
X-Grandstream-PBX: true. 
Max-Forwards: 22. 
User-Agent: Grandstream GXP2124 1.0.4.10. 
Supported: path. 
Expires: 480. 
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE. 
Content-Length: 0. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 
P-hint: outbound. 





Cheers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140527/486c3039/attachment-0001.htm>


More information about the Users mailing list