Browse Source

allow opt-out str 5 processing andalso change at runtime

4.3
lazedo 7 years ago
committed by Luis Azedo
parent
commit
761a085cb2
2 changed files with 23 additions and 12 deletions
  1. +0
    -3
      kamailio/defs.cfg
  2. +23
    -9
      kamailio/fast-pickup-role.cfg

+ 0
- 3
kamailio/defs.cfg View File

@ -89,9 +89,6 @@
#!trydef KZ_TLS_REGISTRAR_PORT 7000 #!trydef KZ_TLS_REGISTRAR_PORT 7000
#!endif #!endif
#!trydef KZ_FAST_PICKUP_COOKIES 1
#!trydef KZ_FAST_PICKUP_REALTIME 1
#!trydef KZ_MULTI_HOMED 0 #!trydef KZ_MULTI_HOMED 0
#!ifndef KZ_DISABLE_WEBSOCKETS_REGISTRAR_PORT #!ifndef KZ_DISABLE_WEBSOCKETS_REGISTRAR_PORT


+ 23
- 9
kamailio/fast-pickup-role.cfg View File

@ -2,8 +2,13 @@
modparam("htable", "htable", "park=>size=16;autoexpire=600") modparam("htable", "htable", "park=>size=16;autoexpire=600")
modparam("htable", "htable", "fp=>size=8"); modparam("htable", "htable", "fp=>size=8");
#!trydef KZ_FAST_PICKUP_COOKIES 1
#!trydef KZ_FAST_PICKUP_REALTIME 1
#!trydef KZ_FAST_PICKUP_STAR_5 1
kazoo.fast_pickup_cookies = KZ_FAST_PICKUP_COOKIES descr "maintains a hash table for correlating call-ids with media servers" kazoo.fast_pickup_cookies = KZ_FAST_PICKUP_COOKIES descr "maintains a hash table for correlating call-ids with media servers"
kazoo.fast_pickup_realtime = KZ_FAST_PICKUP_REALTIME descr "queries channels api for realtime status of call-id" kazoo.fast_pickup_realtime = KZ_FAST_PICKUP_REALTIME descr "queries channels api for realtime status of call-id"
kazoo.fast_pickup_star_5 = KZ_FAST_PICKUP_STAR_5 descr "treats *5 as park pickup, queries state of *3"
route[FAST_PICKUP_START] route[FAST_PICKUP_START]
{ {
@ -96,15 +101,20 @@ route[FAST_PICKUP_ATTEMPT]
} }
##### CALL-PARK #### ##### CALL-PARK ####
if($(ru{uri.user}) =~ "\*5") {
$var(park) = $_s(*3$(ru{uri.user}{s.substr,2,0})@$(ru{uri.domain}));
if($sht(park=>$var(park)) != $null) {
$du = $sht(park=>$var(park));
xlog("L_INFO", "$ci|log|redirecting park request to $du\n");
route(EXTERNAL_TO_INTERNAL_RELAY);
exit();
}
##### STAR 5 CHECK ####
if($sel(cfg_get.kazoo.fast_pickup_star_5) == 1) {
if($(ru{uri.user}) =~ "\*5") {
$var(park) = $_s(*3$(ru{uri.user}{s.substr,2,0})@$(ru{uri.domain}));
if($sht(park=>$var(park)) != $null) {
$du = $sht(park=>$var(park));
xlog("L_INFO", "$ci|log|redirecting park request to $du\n");
route(EXTERNAL_TO_INTERNAL_RELAY);
exit();
}
}
} }
if($sht(park=>$(ru{uri.user})@$(ru{uri.domain})) != $null) { if($sht(park=>$(ru{uri.user})@$(ru{uri.domain})) != $null) {
$du = $sht(park=>$(ru{uri.user})@$(ruri{uri.domain})); $du = $sht(park=>$(ru{uri.user})@$(ruri{uri.domain}));
xlog("L_INFO", "$ci|log|redirecting park request to $du\n"); xlog("L_INFO", "$ci|log|redirecting park request to $du\n");
@ -113,7 +123,11 @@ route[FAST_PICKUP_ATTEMPT]
} }
##### CALL-PARK IN KAZOO #### ##### CALL-PARK IN KAZOO ####
if($(ru{uri.user}) =~ "\*[3,5]" && !($rd =~ "[0-9]{1,3}\.[0-9]{1,3}.[0-9]{1,3}\.[0-9]{1,3}") ) {
$var(park_extension) = "\*3";
if($sel(cfg_get.kazoo.fast_pickup_star_5) == 1) {
$var(park_extension) = "\*[3,5]";
}
if($(ru{uri.user}) =~ $var(park_extension) && !($rd =~ "[0-9]{1,3}\.[0-9]{1,3}.[0-9]{1,3}\.[0-9]{1,3}") ) {
xlog("L_INFO", "$ci|log|checking park request to $(ru{uri.user})@$(ru{uri.domain})\n"); xlog("L_INFO", "$ci|log|checking park request to $(ru{uri.user})@$(ru{uri.domain})\n");
$var(amqp_payload_request) = '{"Event-Category" : "call_event" , "Event-Name" : "query_user_channels_req", "Username" : "*3$(ru{uri.user}{s.substr,2,0})", "Realm" : "$(ru{uri.domain})", "Active-Only" : true }'; $var(amqp_payload_request) = '{"Event-Category" : "call_event" , "Event-Name" : "query_user_channels_req", "Username" : "*3$(ru{uri.user}{s.substr,2,0})", "Realm" : "$(ru{uri.domain})", "Active-Only" : true }';
$var(amqp_routing_key) = "call.status_req." + $(var(replaced_call_id){kz.encode}); $var(amqp_routing_key) = "call.status_req." + $(var(replaced_call_id){kz.encode});


Loading…
Cancel
Save