Hello,

On 2/2/11 5:51 PM, Thomas Baumann wrote:
Dear sr-users,

I use this straight forward dispatcher config.  In the failure route I am calling this 
function: ds_mark_dst("i");

Also this action is logged:

Feb 2 17:20:31 node5 /openser/sbin/kamailio[15945]: INFO: : FAIL_ONE:time [Wed 
Feb 2 17:20:31 2011] destination sip:10.12.19.31:5060 marked as inactive

The gateway is inactive:

[root@node5 ~]# kamctl 'fifo' ds_list
URI:: sip:10.12.19.31:5060 flag=I priority=0 attrs=test1=123;test2=456
URI:: sip:10.12.19.21:5060 flag=A priority=0 attrs=test1=123;test2=456

Few seconds later the gateway is active again (there is still now response to 
SIP-OPTIONS)
[root@node5 ~]# kamctl 'fifo' ds_list
URI:: sip:10.12.19.31:5060 flag=A priority=0 attrs=test1=123;test2=456
URI:: sip:10.12.19.21:5060 flag=A priority=0 attrs=test1=123;test2=456

Does anybody have a idea why ?
The next parameter will make all the addresses from dispatcher to be pinged periodically:

modparam("dispatcher", "ds_probing_mode", 1)

Are you sure the OPTIONS keepalive wasn't sent and replied? With the latest 
version I added a new state per gateway, that can disable it and no keepalive 
will be sent when in that state.

What you can do is to run it with high debug value and watch the logs:
log_stderror=yes
debug=3

You can send me the output if it needs to be analyzed.

Cheers,
Daniel


regards,

Thomas

DB:

mysql>  select * from dispatcher
->  ;
+----+-------+----------------------+-------+----------+---------------------+-------------+
| id | setid | destination | flags | priority | attrs | description |
+----+-------+----------------------+-------+----------+---------------------+-------------+
| 1 | 1 | sip:10.12.19.21:5060 | 0 | 0 | test1=123;test2=456 | AS 1 |
| 2 | 1 | sip:10.12.19.31:5060 | 0 | 0 | test1=123;test2=456 | AS 2 |
+----+-------+----------------------+-------+----------+---------------------+-------------+

CONFIG:

#!KAMAILIO

####### Defined Values #########
#!define WITH_MYSQL
#!define WITH_IPAUTH
# *** Value defines - IDs used later in config
#!ifdef WITH_MYSQL
# - database URL - used to connect to database server by modules such
# as: auth_db, acc, usrloc, a.s.o.
#!define DBURL "mysql://openser:openserrw@10.12.18.51/openser"
#!endif

debug=2
log_stderror=no

memdbg=5
memlog=5

log_facility=LOG_LOCAL0

fork=yes
children=4

/* uncomment the next line to disable TCP (default on) */
#disable_tcp=yes

/* uncomment the next line to disable the auto discovery of local aliases
based on reverse DNS on IPs (default on) */
auto_aliases=no

/* add local domain aliases */
alias="m-lab-ca805-sig.kd-lab.de:5060"
alias="m-lab-ca805-sig.kd-lab.de"
alias="10.12.19.51"

/* uncomment and configure the following line if you want Kamailio to
bind on a specific interface/port/proto (default bind on all available) */
listen=udp:10.12.19.51:5060
listen=tcp:10.12.19.51:5060

/* port to listen to
* - can be specified more than once if needed to listen on many ports */
port=5060

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

# set paths to location of modules
mpath="/usr/local/kamailio-3.1/lib/kamailio/modules_k/:/usr/local/kamailio-3.1/lib/kamailio/modules/"

# ------------------ module loading ----------------------------------

loadmodule "mi_fifo.so"
loadmodule "kex.so"
loadmodule "tm.so"
loadmodule "tmx.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "pv.so"
loadmodule "maxfwd.so"
loadmodule "textops.so"
loadmodule "siputils.so"
loadmodule "xlog.so"
loadmodule "sanity.so"
loadmodule "ctl.so"
loadmodule "mi_rpc.so"
loadmodule "acc.so"
loadmodule "dialplan.so"
loadmodule "avpops.so"
loadmodule "dispatcher.so"


#!ifdef WITH_IPAUTH
loadmodule "permissions.so"
#!endif
#!ifdef WITH_MYSQL
loadmodule "db_mysql.so"
#!endif

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

# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam("tm", "failure_reply_mode", 3)
# default retransmission timeout: 30sec
modparam("tm", "fr_timer", 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam("tm", "fr_inv_timer", 120000)

# ----- dispatcher params -----
#modparam("dispatcher", "list_file", "/openser/etc/kamailio/dispatcher.list")
modparam("dispatcher", "db_url", DBURL)
modparam("dispatcher", "table_name", "dispatcher")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_threshhold", 10)
modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=4")
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_ping_from", "sip:l...@m-lab-ca805-sig.kd-lab.de")
modparam("dispatcher", "flags", 2)
modparam("dispatcher", "dst_avp", "$avp(dsdst)")
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")


# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")

# ----- permissions params -----
#!ifdef WITH_IPAUTH
modparam("permissions", "db_url", DBURL)
modparam("permissions", "db_mode", 1)
#!endif

route{

if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
drop();
};

#!ifdef WITH_IPAUTH
if (!allow_source_address())
{
sl_send_reply("403", "Forbidden");
exit;
}
#!endif

# Send to application servers for number evaluation

if ($rU=~"^0[1-9][0-9]{5,20}$") {
ds_select_dst("1","0");
if (method=="INVITE") {
t_on_failure("FAIL_ONE");
}
t_relay();
exit();
}
sl_send_reply("403", "Forbidden");
exit;
}

# Sample failure route
failure_route[FAIL_ONE] {

if (t_check_status("408")) {
xlog("L_INFO", "FAIL_ONE:time [$Tf] destination $avp(dsdst) marked as inactive 
\n");
ds_mark_dst("i");
}

exit;

}

___________________________________________________________
NEU: FreePhone - kostenlos mobil telefonieren und surfen!                       
        
Jetzt informieren: http://produkte.web.de/go/webdefreephone

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

--
Daniel-Constantin Mierla
http://www.asipto.com


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to