Browse Source

KAZOO-3494: move the fast pickup handler for park in to the new role

3.20
karl anderson 11 years ago
parent
commit
3bd6991581
3 changed files with 30 additions and 15 deletions
  1. +7
    -12
      kamailio/default.cfg
  2. +0
    -1
      kamailio/dispatcher-role.cfg
  3. +23
    -2
      kamailio/fast-pickup-role.cfg

+ 7
- 12
kamailio/default.cfg View File

@ -571,12 +571,9 @@ route[EXTERNAL_TO_INTERNAL_RELAY]
} }
#!endif #!endif
##### CALL-PARK ####
if(is_method("REFER")) {
$avp(refer_to) = $hdr(Refer-To);
$avp(refer_to_uri) = $rt;
$avp(referred_by) = $hdr(Referred-By);
}
#!ifdef FAST_PICKUP-ROLE
route(FAST_PICKUP_REFER);
#!endif
remove_hf_re("^X-.*"); remove_hf_re("^X-.*");
append_hf("X-AUTH-IP: $si\r\n"); append_hf("X-AUTH-IP: $si\r\n");
@ -633,6 +630,10 @@ onreply_route[INTERNAL_REPLY]
route(DOS_PREVENTION); route(DOS_PREVENTION);
#!endif #!endif
#!ifdef FAST_PICKUP-ROLE
route(FAST_PICKUP_REPLY);
#!endif
if (is_method("INVITE") && if (is_method("INVITE") &&
!isflagset(FLAG_SESSION_PROGRESS) && !isflagset(FLAG_SESSION_PROGRESS) &&
t_check_status("(180)|(183)|(200)") t_check_status("(180)|(183)|(200)")
@ -647,12 +648,6 @@ onreply_route[INTERNAL_REPLY]
setflag(FLAG_SESSION_PROGRESS); setflag(FLAG_SESSION_PROGRESS);
} }
##### CALL-PARK ####
if (is_method("REFER") && t_check_status("(200)|(202)") ) {
$sht(park=>$(avp(refer_to_uri){uri.user})@$(avp(refer_to_uri){uri.domain})) = "sip:" + $(ct{tobody.uri}{uri.host}) + ":" + $(ct{tobody.uri}{uri.port});
xlog("L_INFO", "caching park info $(avp(refer_to_uri){uri.user})@$(avp(refer_to_uri){uri.domain}) = sip:$(ct{tobody.uri}{uri.host}):$(ct{tobody.uri}{uri.port})");
}
if ($rs < 300) { if ($rs < 300) {
xlog("L_INFO", "$ci|pass|$T_req($si):$T_req($sp)"); xlog("L_INFO", "$ci|pass|$T_req($si):$T_req($sp)");
} }


+ 0
- 1
kamailio/dispatcher-role.cfg View File

@ -1,6 +1,5 @@
######## Generic Hash Table container in shared memory ######## ######## Generic Hash Table container in shared memory ########
modparam("htable", "htable", "failover=>size=16;autoexpire=120") modparam("htable", "htable", "failover=>size=16;autoexpire=120")
modparam("htable", "htable", "park=>size=4;autoexpire=600")
####### Dispatcher module ######## ####### Dispatcher module ########
loadmodule "dispatcher.so" loadmodule "dispatcher.so"


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

@ -1,5 +1,5 @@
######## FAST PICKUP ROLE ######## ######## FAST PICKUP ROLE ########
modparam("htable", "htable", "park=>size=4;autoexpire=600")
modparam("htable", "htable", "fp=>size=32;autoexpire=3600;"); modparam("htable", "htable", "fp=>size=32;autoexpire=3600;");
route[ATTEMPT_FAST_PICKUP] route[ATTEMPT_FAST_PICKUP]
@ -71,7 +71,28 @@ route[ATTEMPT_FAST_PICKUP]
} }
} }
} }
}
route[FAST_PICKUP_REFER]
{
if(!is_method("REFER")) {
return;
}
$avp(refer_to) = $hdr(Refer-To);
$avp(referred_by) = $hdr(Referred-By);
$avp(refer_to_uri) = $rt;
}
route[FAST_PICKUP_REPLY] {
if (!is_method("REFER") || !t_check_status("(200)|(202)") ) {
return;
}
$var(contact) = "sip:$(ct{tobody.uri}{uri.host}):$(ct{tobody.uri}{uri.port})";
xlog("L_INFO", "caching park info $(avp(refer_to_uri){uri.user})@$(avp(refer_to_uri){uri.domain}) = $var(contact)");
$sht(park=>$(avp(refer_to_uri){uri.user})@$(avp(refer_to_uri){uri.domain})) = $var(contact);
} }
route[FAST_PICKUP_INIT] route[FAST_PICKUP_INIT]


Loading…
Cancel
Save