|
|
|
@ -19,16 +19,16 @@ route[PRESENCE_LOCAL_NOTIFY] |
|
|
|
if($rm != "NOTIFY") { |
|
|
|
return; |
|
|
|
} |
|
|
|
t_set_fr(@cfg_get.kazoo.presence_notify_timeout, @cfg_get.kazoo.presence_notify_timeout); |
|
|
|
t_set_fr($sel(cfg_get.kazoo.presence_notify_timeout), $sel(cfg_get.kazoo.presence_notify_timeout)); |
|
|
|
xlog("L_DEBUG", "$ci|log|init preparing $subs(event) notify to $subs(watcher_username)@$subs(watcher_domain) on behalf of $subs(pres_uri) : $du\n"); |
|
|
|
if(@cfg_get.kazoo.presence_notify_log_init_body == 1) { |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_log_init_body) == 1) { |
|
|
|
xlog("L_INFO", "$ci|log|init|body $(mb{s.escape.common}{s.replace,\','}{s.replace,$$,})\n"); |
|
|
|
} |
|
|
|
if(@cfg_get.kazoo.presence_notify_force_send_socket == 1) { |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_force_send_socket) == 1) { |
|
|
|
$fs = $_s($(pr{s.tolower}):$(hdr(Contact){nameaddr.uri}{uri.host}):$(hdr(Contact){nameaddr.uri}{uri.port})); |
|
|
|
xlog("L_DEBUG", "$ci|log|init|forcing socket to $fs, $(pr{s.tolower}):$(hdr(Contact){nameaddr.uri}{uri.host}):$(hdr(Contact){nameaddr.uri}{uri.port}) , $ct\n"); |
|
|
|
} |
|
|
|
if(@cfg_get.kazoo.presence_notify_record_route == 1) { |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_record_route) == 1) { |
|
|
|
record_route(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ modparam("rtimer", "exec", "timer=pres_cleanup;route=PRESENCE_CLEANUP") |
|
|
|
|
|
|
|
event_route[presence:notify-reply] |
|
|
|
{ |
|
|
|
if(@cfg_get.kazoo.presence_notify != 1) |
|
|
|
if($sel(cfg_get.kazoo.presence_notify) != 1) |
|
|
|
return; |
|
|
|
|
|
|
|
$xavp(pres=>delete_subscription) = 0; |
|
|
|
@ -84,16 +84,16 @@ event_route[presence:notify-reply] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(@cfg_get.kazoo.presence_notify_log_body == 1) |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_log_body) == 1) |
|
|
|
xlog("L_INFO", "$ci|log|sent|body $(mb{s.escape.common}{s.replace,\','}{s.replace,$$,})\n"); |
|
|
|
if(@cfg_get.kazoo.presence_notify_log_resp_body == 1) |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_log_resp_body) == 1) |
|
|
|
xlog("L_INFO", "$ci|log|resp|body $(notify_reply($mb){s.escape.common}{s.replace,\','}{s.replace,$$,})\n"); |
|
|
|
|
|
|
|
if(@cfg_get.kazoo.presence_notify_log_to_amqp == 1) { |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_log_to_amqp) == 1) { |
|
|
|
route(PRESENCE_NOTIFY_AMQP); |
|
|
|
} |
|
|
|
|
|
|
|
if(@cfg_get.kazoo.presence_notify_log_to_table == 1) { |
|
|
|
if($sel(cfg_get.kazoo.presence_notify_log_to_table) == 1) { |
|
|
|
if($xavp(pres=>delete_subscription) != 1 && $subs(reason) != "timeout") { |
|
|
|
$var(Query) = $_s(KZQ_REPLACE_WATCHERS_LOG); |
|
|
|
mq_add("presence_last_notity", "$subs(callid)", "$var(Query)"); |
|
|
|
|