|
|
|
@ -154,6 +154,7 @@ loadmodule "textopsx.so" |
|
|
|
######## Generic Hash Table container in shared memory ######## |
|
|
|
loadmodule "htable.so" |
|
|
|
modparam("htable", "htable", "associations=>size=16;autoexpire=7200") |
|
|
|
modparam("htable", "htable", "redirects=>size=16;autoexpire=5") |
|
|
|
|
|
|
|
######## Pseudo-Variables module ######## |
|
|
|
loadmodule "pv.so" |
|
|
|
@ -311,7 +312,6 @@ route[HANDLE_MOVE_REQUEST] |
|
|
|
{ |
|
|
|
if (is_method("INVITE") && $rU == "*6683*") { |
|
|
|
$var(contact_uri) = $(ct{tobody.user}) + "@" + $(ct{tobody.host}); |
|
|
|
$var(from_uri) = @from.uri.user + "@" + @from.uri.host; |
|
|
|
|
|
|
|
if ($sht(associations=>$var(contact_uri)) != $null) { |
|
|
|
$sht(associations=>$var(contact_uri)) = $null; |
|
|
|
@ -319,12 +319,6 @@ route[HANDLE_MOVE_REQUEST] |
|
|
|
with media server $sht(associations=>$var(contact_uri))"); |
|
|
|
} |
|
|
|
|
|
|
|
if ($sht(associations=>$var(from_uri)) != $null) { |
|
|
|
$sht(associations=>$var(from_uri)) = $null; |
|
|
|
xlog("L_INFO", "$ci|log|removed from association for $var(from_uri) |
|
|
|
with media server $sht(associations=>$var(from_uri))"); |
|
|
|
} |
|
|
|
|
|
|
|
send_reply("503", "Removed association"); |
|
|
|
|
|
|
|
exit; |
|
|
|
@ -476,14 +470,18 @@ onreply_route[INTERNAL_REPLY] |
|
|
|
xlog("L_INFO", "$ci|start|recieved internal reply $T_reply_code $rr"); |
|
|
|
xlog("L_INFO", "$ci|log|source $si:$sp"); |
|
|
|
|
|
|
|
if (t_check_status("(180)|(183)|(200)")) { |
|
|
|
xlog("L_INFO", "$ci|log|call setup, only listening for redirects"); |
|
|
|
setflag(FLAG_SESSION_PROGRESS); |
|
|
|
|
|
|
|
if ($avp(AVP_REDIRECT_KEY) != $null) { |
|
|
|
xlog("L_INFO", "$ci|log|removing redirect mapping for $avp(AVP_REDIRECT_KEY)"); |
|
|
|
$sht(associations=>$avp(AVP_REDIRECT_KEY)) = $null; |
|
|
|
if (is_method("INVITE") && |
|
|
|
!isflagset(FLAG_SESSION_PROGRESS) && |
|
|
|
t_check_status("(180)|(183)|(200)") |
|
|
|
) { |
|
|
|
if ($avp(AVP_REDIRECT_KEY) != $null && |
|
|
|
$sht(redirects=>$avp(AVP_REDIRECT_KEY)) != $null |
|
|
|
) { |
|
|
|
xlog("L_INFO", "$ci|log|removing redirect mapping $avp(AVP_REDIRECT_KEY)"); |
|
|
|
$sht(redirects=>$avp(AVP_REDIRECT_KEY)) = $null; |
|
|
|
} |
|
|
|
xlog("L_INFO", "$ci|log|call setup, now ignoring abnormal termination"); |
|
|
|
setflag(FLAG_SESSION_PROGRESS); |
|
|
|
} |
|
|
|
|
|
|
|
if ($rs < 300) { |
|
|
|
@ -508,19 +506,19 @@ failure_route[INTERNAL_FAULT] |
|
|
|
} |
|
|
|
|
|
|
|
# Handle redirects |
|
|
|
$var(redirect) = @from.uri.user + "@" + @from.uri.host + "->" |
|
|
|
+ @contact.uri.user + "@" + @contact.uri.host; |
|
|
|
if (t_check_status("302")) { |
|
|
|
$var(redirect) = @from.uri.user + "@" + @from.uri.host + "->" |
|
|
|
+ $T_rpl($(ct{tobody.user})) + "@" + $T_rpl($(ct{tobody.host})); |
|
|
|
if($T_rpl($hdr(X-Redirect-Server)) != $null) { |
|
|
|
$sht(associations=>$var(redirect)) = $T_rpl($hdr(X-Redirect-Server)); |
|
|
|
xlog("L_INFO", "$ci|log|stored redirect mapping for $var(redirect) to $T_rpl($hdr(X-Redirect-Server))"); |
|
|
|
$sht(redirects=>$var(redirect)) = $T_rpl($hdr(X-Redirect-Server)); |
|
|
|
xlog("L_INFO", "$ci|log|stored redirect mapping $var(redirect) to $T_rpl($hdr(X-Redirect-Server))"); |
|
|
|
} |
|
|
|
|
|
|
|
add_rcv_param("1"); |
|
|
|
|
|
|
|
} else if (!t_check_status("407")) { |
|
|
|
xlog("L_INFO", "$ci|log|removing redirect mapping for $var(redirect)"); |
|
|
|
$sht(associations=>$var(redirect)) = $null; |
|
|
|
} else if (!t_check_status("407") && |
|
|
|
$avp(AVP_REDIRECT_KEY) != $null && |
|
|
|
$sht(redirects=>$avp(AVP_REDIRECT_KEY)) != $null |
|
|
|
) { |
|
|
|
xlog("L_INFO", "$ci|log|removing redirect mapping $avp(AVP_REDIRECT_KEY)"); |
|
|
|
$sht(redirects=>$avp(AVP_REDIRECT_KEY)) = $null; |
|
|
|
} |
|
|
|
|
|
|
|
remove_hf_re("X-.*"); |
|
|
|
|