Remove artificial preconditioning + logging improvements
This commit is contained in:
@@ -282,7 +282,6 @@ modparam("htable", "htable", "natpingfrom=>size=8;autoexpire=600000;")
|
||||
|
||||
modparam("htable", "htable", "contact=>size=8;autoexpire=20")
|
||||
modparam("htable", "htable", "a=>size=8;autoexpire=20")
|
||||
modparam("htable", "htable", "supported=>size=8;autoexpire=20")
|
||||
|
||||
#!ifdef WITH_IMS_HDR_CACHE
|
||||
modparam("htable", "htable", "serviceroutes=>size=16;autoexpire=14400;")
|
||||
@@ -470,7 +469,7 @@ modparam("statistics", "variable", "register_time")
|
||||
# - processing of any incoming SIP request starts with this route
|
||||
route {
|
||||
##!ifdef WITH_DEBUG
|
||||
xlog("$rm ($fu ($si:$sp) to $tu, $ci)\n");
|
||||
xnotice("PCSCF: $rm $ru ($fu ($si:$sp) to $tu, $ci)\n");
|
||||
##!endif
|
||||
|
||||
#!ifdef WITH_WEBSOCKET
|
||||
@@ -496,11 +495,6 @@ route {
|
||||
exit;
|
||||
}
|
||||
|
||||
# handle requests within SIP dialogs
|
||||
route(WITHINDLG);
|
||||
|
||||
### only initial requests (no To tag)
|
||||
|
||||
# handle retransmissions
|
||||
if(t_precheck_trans()) {
|
||||
t_check_trans();
|
||||
@@ -511,6 +505,11 @@ route {
|
||||
# Check for Re-Transmissions
|
||||
t_check_trans();
|
||||
|
||||
# handle requests within SIP dialogs
|
||||
route(WITHINDLG);
|
||||
|
||||
### only initial requests (no To tag)
|
||||
|
||||
if (is_method("UPDATE")) {
|
||||
send_reply("403","Forbidden - Target refresh outside dialog not allowed");
|
||||
break;
|
||||
@@ -778,44 +777,23 @@ route[RELAY] {
|
||||
# Handle requests within SIP dialogs
|
||||
route[WITHINDLG] {
|
||||
if (has_totag()) {
|
||||
xnotice("Within DLG");
|
||||
xnotice("Within DLG\n");
|
||||
# sequential request withing a dialog should
|
||||
# take the path determined by record-routing
|
||||
if (loose_route()) {
|
||||
xnotice("Within loose route");
|
||||
xnotice("Within loose route\n");
|
||||
if(!isdsturiset()) {
|
||||
handle_ruri_alias();
|
||||
#if ($rc == 1) {
|
||||
# $ru = "sip:" + $rU + "@" + $dd + ":" + $dp + ";transport=" + $rP;
|
||||
#}
|
||||
}
|
||||
|
||||
if ( is_method("ACK") && ($sht(contact=>$ci) != $null) ) {
|
||||
xlog("Contact of Reply: $sht(contact=>$ci) ($ci)\n");
|
||||
$ru = $sht(contact=>$ci);
|
||||
}
|
||||
|
||||
# https://www.sharetechnote.com/html/IMS_SIP_Precondition.html
|
||||
# https://www.sharetechnote.com/html/IMS_SIP_Precondition.html#Requirement_for_UPDATE
|
||||
if (is_method("PRACK") && (($sht(supported=>$ci) =~ ".*precondition.*") || ($sht(supported=>$ci) =~ ".*precondition.*"))) {
|
||||
if(!is_present_hf("Supported")) {
|
||||
append_hf("Supported: 100rel,precondition\r\n");
|
||||
} else {
|
||||
remove_hf("Supported");
|
||||
$var(new_supp) = $hdr(Supported);
|
||||
if (!($hdr(Supported) =~ ".*precondition.*")) {
|
||||
$var(new_supp) = $var(new_supp) + ",precondition";
|
||||
}
|
||||
if (!($hdr(Supported) =~ ".*100rel.*")) {
|
||||
$var(new_supp) = $var(new_supp) + ",100rel";
|
||||
}
|
||||
append_hf("Supported: $var(new_supp)\r\n");
|
||||
}
|
||||
xnotice("Invite Supported: $sht(supported=>$ci)\n");
|
||||
xnotice("Old Supported: $hdr(Supported)\n");
|
||||
xnotice("New Supported: $var(new_supp)\n");
|
||||
msg_apply_changes();
|
||||
}
|
||||
|
||||
if ($route_uri =~ "sip:mt@.*") {
|
||||
route(MT_indialog);
|
||||
} else {
|
||||
|
||||
@@ -87,11 +87,6 @@ route[MO]
|
||||
}
|
||||
set_dlg_profile("orig");
|
||||
t_on_reply("MO_reply");
|
||||
|
||||
# Store the supported header if INVITE
|
||||
if (is_method("INVITE")) {
|
||||
$sht(supported=>$ci) = $hdr(Supported);
|
||||
}
|
||||
}
|
||||
|
||||
######################################################################
|
||||
@@ -112,12 +107,6 @@ onreply_route[MO_reply] {
|
||||
ipsec_forward("location");
|
||||
#}
|
||||
#!endif
|
||||
# If reply 183/200 does not have Require: precondition then empty stored supported hash entry
|
||||
if (t_check_status("183|200") && has_body("application/sdp")) {
|
||||
if (is_present_hf("Require") && !($hdr(Require) =~ ".*precondition.*")) {
|
||||
$sht(supported=>$ci) = $null;
|
||||
}
|
||||
}
|
||||
# In case of 1xx and 2xx do NAT
|
||||
if(status=~"[12][0-9][0-9]")
|
||||
route(NATMANAGE);
|
||||
|
||||
Reference in New Issue
Block a user