diff --git a/kamailio/default.cfg b/kamailio/default.cfg index c0061e3..a32167c 100644 --- a/kamailio/default.cfg +++ b/kamailio/default.cfg @@ -579,6 +579,12 @@ onreply_route[INTERNAL_REPLY] 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) { xlog("L_INFO", "$ci|pass|$T_req($si):$T_req($sp)"); } diff --git a/kamailio/dispatcher-role.cfg b/kamailio/dispatcher-role.cfg index d5e99b2..4bbeb0e 100644 --- a/kamailio/dispatcher-role.cfg +++ b/kamailio/dispatcher-role.cfg @@ -1,5 +1,6 @@ ######## Generic Hash Table container in shared memory ######## modparam("htable", "htable", "failover=>size=16;autoexpire=120") +modparam("htable", "htable", "park=>size=4;autoexpire=600") ####### Dispatcher module ######## loadmodule "dispatcher.so" @@ -82,6 +83,13 @@ route[DISPATCHER_FIND_ROUTES] } } } + ##### CALL-PARK #### + if($(ru{uri.user}) =~ "\*3" && $sht(park=>$(ru{uri.user})@$(ru{uri.domain})) != $null) { + $du = $sht(park=>$(ru{uri.user})@$(ruri{uri.domain})); + $sht(park=>$(ru{uri.user})@$(ruri{uri.domain})) = $null; + xlog("L_INFO", "$ci|log|redirecting park request to $du"); + return; + } } if (!ds_select_dst("$var(ds_group)", "0") || $(avp(ds_dst)[0]) == $null) {