|
|
|
@ -1,5 +1,8 @@ |
|
|
|
######## Presence query server module ######## |
|
|
|
|
|
|
|
#!trydef KZ_PRESENCE_QUERY_REPLY_ZONES 0 |
|
|
|
kazoo.presence_query_reply_zones = KZ_PRESENCE_QUERY_REPLY_ZONES descr "0 - all, 1 - local, 2 - remote" |
|
|
|
|
|
|
|
route[PRESENCE_SEARCH_SUMMARY] |
|
|
|
{ |
|
|
|
xlog("L_INFO", "$(kzE{kz.json,Msg-ID})|query|processing presence summary query for $(kzE{kz.json,Realm})\n"); |
|
|
|
@ -88,19 +91,22 @@ route[PRESENCE_SEARCH_DETAIL] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event_route[kazoo:consumer-event-presence-search-req] |
|
|
|
{ |
|
|
|
switch($(kzE{kz.json,Search-Type})) { |
|
|
|
case "summary": |
|
|
|
route(PRESENCE_SEARCH_SUMMARY); |
|
|
|
break; |
|
|
|
case "detail": |
|
|
|
route(PRESENCE_SEARCH_DETAIL); |
|
|
|
break; |
|
|
|
default: |
|
|
|
xlog("L_INFO", "$ci|search type '$(kzE{kz.json,Search-Type})' not handled\n"); |
|
|
|
$var(Zone) = $(kzE{kz.json,AMQP-Broker-Zone}); |
|
|
|
if( ($var(Zone) == "MY_AMQP_ZONE" && $sel(cfg_get.kazoo.presence_query_reply_zones) != 2) || |
|
|
|
($var(Zone) != "MY_AMQP_ZONE" && $sel(cfg_get.kazoo.presence_query_reply_zones) != 1)) { |
|
|
|
|
|
|
|
switch($(kzE{kz.json,Search-Type})) { |
|
|
|
case "summary": |
|
|
|
route(PRESENCE_SEARCH_SUMMARY); |
|
|
|
break; |
|
|
|
case "detail": |
|
|
|
route(PRESENCE_SEARCH_DETAIL); |
|
|
|
break; |
|
|
|
default: |
|
|
|
xlog("L_INFO", "$ci|search type '$(kzE{kz.json,Search-Type})' not handled\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|