@ -30,6 +30,8 @@ mem_summary = 12
log_stderror = no
log_facility = LOG_LOCAL0
log_name = "kamailio"
latency_limit_action = 2000
latency_limit_db = 2000
####### Alias Parameters #########
auto_aliases = yes
@ -86,6 +88,9 @@ mpath="/usr/lib64/kamailio/modules/"
######## Kamailio control connector module ########
loadmodule "ctl.so"
######## set params at runtime
loadmodule "cfg_rpc.so"
######## Kamailio core extensions module ########
loadmodule "kex.so"
@ -138,7 +143,6 @@ loadmodule "xlog.so"
####### FIFO support for Management Interface ########
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
######## UAC ########
loadmodule "uac.so"
@ -220,6 +224,15 @@ include_file "registrar-sync-role.cfg"
#!ifdef FAST_PICKUP-ROLE
include_file "fast-pickup-role.cfg"
#!endif
#!ifdef PRESENCE_SYNC-ROLE
include_file "presence_sync-role.cfg"
#!endif
#!ifdef PRESENCE_QUERY-ROLE
include_file "presence_query-role.cfg"
#!endif
#!ifdef PRESENCE_NOTIFY_SYNC-ROLE
include_file "presence_notify_sync-role.cfg"
#!endif
####### Permissions module ##########
loadmodule "permissions.so"
@ -230,6 +243,8 @@ modparam("permissions", "db_mode", 1)
route
{
route(SANITY_CHECK);
route(CHECK_RETRANS);
# log the basic info regarding this call
xlog("L_INFO", "$ci|start|received $pr request $rm $ou");
@ -294,6 +309,15 @@ route
route(EXTERNAL_TO_INTERNAL_RELAY);
}
route[CHECK_RETRANS]
{
# handle retransmissions
if(t_precheck_trans()) {
t_check_trans();
exit;
}
}
route[SANITY_CHECK]
{
if (!sanity_check()) {
@ -501,9 +525,6 @@ route[PREPARE_INITIAL_REQUESTS]
exit();
}
# handle re-transmissions
t_check_trans();
if (is_method("UPDATE")) {
xlog("L_WARN", "$ci|end|update outside dialog not allowed");
send_reply("403", "Dialog does not exist");
@ -560,6 +581,7 @@ route[INTERNAL_TO_EXTERNAL_RELAY]
remove_hf_re("^X-.*");
t_on_reply("EXTERNAL_REPLY");
t_on_failure("EXTERNAL_FAULT");
t_set_fr(0, 10000);
@ -599,6 +621,8 @@ route[EXTERNAL_TO_INTERNAL_RELAY]
onreply_route[EXTERNAL_REPLY]
{
# this route handles replies that are coming from a carrier or customer device
xlog("L_INFO", "$ci|start|received external $rm reply $T_reply_code $rr source $si:$sp");
xlog("L_INFO", "$ci|log|external reply $T_reply_code");
#!ifdef WEBSOCKETS-ROLE
@ -622,9 +646,10 @@ onreply_route[EXTERNAL_REPLY]
onreply_route[INTERNAL_REPLY]
{
# this route handles replies that are comm ing from our media server
# this route handles replies that are coming from our media server
xlog("L_INFO", "$ci|start|received internal reply $T_reply_code $rr");
xlog("L_INFO", "$ci|log|source $si:$sp");
xlog("L_INFO", "$ci|log|method $rm");
#!ifdef WEBSOCKETS-ROLE
route(NAT_WEBSOCKETS_CORRECT);
@ -665,6 +690,20 @@ onreply_route[INTERNAL_REPLY]
$var(reply_reason) = $rr;
}
failure_route[EXTERNAL_FAULT]
{
if($T(reply_type) = =1){
# a request timeout, destination did not respond in time, does not show up in on_reply
# http://www.kamailio.org/wiki/cookbooks/4.3.x/pseudovariables#t_name
if(isflagset(FLAG_SESSION_PROGRESS)) {
#may be during re-invite, update, bye, cancel, etc or initial invite after 18x (transaction has a to tag)
xlog("L_INFO", "$ci|start|external failure route, $T_reply_code locally generated for method $rm after progress");
} else {
xlog("L_INFO", "$ci|start|external failure route, $T_reply_code locally generated for method $rm no progress");
}
}
}
failure_route[INTERNAL_FAULT]
{
# this branch handles failures (>=300) to our media servers,
@ -672,6 +711,16 @@ failure_route[INTERNAL_FAULT]
# if the failure cause was due to the transaction being
# cancelled then we are complete
if($T(reply_type) = =1){
# a request timeout, destination did not respond in time, does not show up in on_reply
# http://www.kamailio.org/wiki/cookbooks/4.3.x/pseudovariables#t_name
if(isflagset(FLAG_SESSION_PROGRESS)) {
#may be during re-invite, update, bye, cancel, etc or initial invite after 18x (transaction has a to tag)
xlog("L_INFO", "$ci|start|internal failure route, $T_reply_code locally generated for method $rm after progress");
} else {
xlog("L_INFO", "$ci|start|internal failure route, $T_reply_code locally generated for method $rm no progress");
}
}
if (t_is_canceled()) {
xlog("L_INFO", "$ci|log|transaction was cancelled");
exit;
@ -784,6 +833,20 @@ event_route[kazoo:mod-init]
#!endif
#!ifdef PRESENCE_SYNC-ROLE
$var(payload) = "{ 'exchange' : 'presence' , 'type' : 'topic', 'queue' : 'PRESENCE-QUEUE-MY_HOSTNAME', 'routing' : 'sync', 'auto_delete' : 1, 'durable' : 0, 'no_ack' : 1, 'wait_for_consumer_ack' : 0 }";
kazoo_subscribe("$var(payload)");
#!endif
#!ifdef PRESENCE_QUERY-ROLE
$var(payload) = "{ 'exchange' : 'omnipresence' , 'type' : 'topic', 'routing' : 'presence.search_req.*', 'federate' : 1 }";
kazoo_subscribe("$var(payload)");
#!endif
}
event_route[kazoo:consumer-event]
@ -801,5 +864,12 @@ event_route[kazoo:consumer-event-connection-closed]
xlog("L_INFO","connection to $(kzE{kz.json,host}) closed");
}
#!ifdef PRESENCE_NOTIFY_SYNC-ROLE
event_route[tm:local-request]
{
route(PRESENCE_LOCAL_NOTIFY);
}
#!endif
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab