Browse Source

granular reply configuration for presence query

update-rsyslog-config
lazedo 7 years ago
parent
commit
7e61d706cb
1 changed files with 17 additions and 11 deletions
  1. +17
    -11
      kamailio/presence-query.cfg

+ 17
- 11
kamailio/presence-query.cfg View File

@ -1,5 +1,8 @@
######## Presence query server module ######## ######## 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] route[PRESENCE_SEARCH_SUMMARY]
{ {
xlog("L_INFO", "$(kzE{kz.json,Msg-ID})|query|processing presence summary query for $(kzE{kz.json,Realm})\n"); 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] 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");
}
} }
} }


Loading…
Cancel
Save