|
|
|
@ -4,7 +4,7 @@ |
|
|
|
#!trydef PRESENCE_MAX_EXPIRES 3600 |
|
|
|
|
|
|
|
modparam("htable", "htable", "p=>size=32;autoexpire=3600;") |
|
|
|
modparam("htable", "htable", "first=>size=32;autoexpire=3600;initval =0;updateexpire=1") |
|
|
|
modparam("htable", "htable", "first=>size=32;autoexpire=3600;initval =0;updateexpire=1;") |
|
|
|
|
|
|
|
loadmodule "presence.so" |
|
|
|
loadmodule "presence_dialoginfo.so" |
|
|
|
@ -53,6 +53,7 @@ modparam("nat_traversal", "keepalive_state_file", "KAZOO_DATA_DIR/keep_alive_sta |
|
|
|
modparam("nat_traversal", "keepalive_interval", 45) |
|
|
|
#!endif |
|
|
|
|
|
|
|
kazoo.presence_sync_amqp = 0 descr "sync subscriptions to amqp" |
|
|
|
|
|
|
|
#!ifdef FAST_PICKUP_ROLE |
|
|
|
#!include_file "fast-pickup-role.cfg" |
|
|
|
@ -88,11 +89,17 @@ route[HANDLE_SUBSCRIBE] |
|
|
|
route(PRESENCE_NAT); |
|
|
|
#!endif |
|
|
|
|
|
|
|
if(has_totag()) { |
|
|
|
loose_route(); |
|
|
|
} |
|
|
|
|
|
|
|
record_route(); |
|
|
|
|
|
|
|
if (!t_newtran()) { |
|
|
|
sl_reply_error(); |
|
|
|
exit; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(has_totag()) { |
|
|
|
route(HANDLE_RESUBSCRIBE); |
|
|
|
} else { |
|
|
|
@ -106,8 +113,7 @@ route[HANDLE_SUBSCRIBE] |
|
|
|
|
|
|
|
route[HANDLE_RESUBSCRIBE] |
|
|
|
{ |
|
|
|
loose_route(); |
|
|
|
|
|
|
|
|
|
|
|
if(handle_subscribe()) { |
|
|
|
if($subs(remote_cseq) < 5) { |
|
|
|
$sht(first=>$subs(callid)) = $null; |
|
|
|
@ -151,8 +157,6 @@ route[HANDLE_NEW_SUBSCRIBE] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
record_route(); |
|
|
|
|
|
|
|
if (handle_subscribe()) { |
|
|
|
route(SUBSCRIBE_AMQP); |
|
|
|
xlog("L_INFO","$ci|end|new $hdr(Event) subscription from $fU to $tU in realm $fd : $sht(first=>$ci) : $sht(first=>$fU::$tU::$fd::$hdr(Event))\n"); |
|
|
|
@ -167,9 +171,11 @@ route[HANDLE_NEW_SUBSCRIBE] |
|
|
|
|
|
|
|
route[SUBSCRIBE_AMQP] |
|
|
|
{ |
|
|
|
$var(rk) = "subscribe." + $(subs(to_domain){kz.encode}) + "." + $(subs(to_user){kz.encode}); |
|
|
|
$var(amqp_payload_request) = $_s({"Event-Category" : "presence", "Event-Name" : "subscription", "Event-Package" : "$hdr(event)", "Expires" : $subs(expires), "Queue" : "BLF-MY_HOSTNAME", "Server-ID" : "BLF-MY_HOSTNAME" , "Contact" : "$(ct{s.escape.common}{s.replace,\','}{s.replace,$$,})", "Call-ID" : "$ci", "From" : "$fu", "User" : "$subs(uri)", "User-Agent" : "$(ua{s.escape.common}{s.replace,\','}{s.replace,$$,})" }); |
|
|
|
kazoo_publish("omnipresence", "$var(rk)", $var(amqp_payload_request)); |
|
|
|
if(@cfg_get.kazoo.presence_sync_amqp == 1) { |
|
|
|
$var(rk) = "subscribe." + $(subs(to_domain){kz.encode}) + "." + $(subs(to_user){kz.encode}); |
|
|
|
$var(amqp_payload_request) = $_s({"Event-Category" : "presence", "Event-Name" : "subscription", "Event-Package" : "$hdr(event)", "Expires" : $subs(expires), "Queue" : "BLF-MY_HOSTNAME", "Server-ID" : "BLF-MY_HOSTNAME" , "Contact" : "$(ct{s.escape.common}{s.replace,\','}{s.replace,$$,})", "Call-ID" : "$ci", "From" : "$fu", "User" : "$subs(uri)", "User-Agent" : "$(ua{s.escape.common}{s.replace,\','}{s.replace,$$,})" }); |
|
|
|
kazoo_publish("omnipresence", "$var(rk)", $var(amqp_payload_request)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
route[HANDLE_PUBLISH] |
|
|
|
|