MT#64901 core: add `ignore_routeset_on_prack`

To keep the route set from PRACK 200 OK

Closes #17

Change-Id: I0bc9454f9e26541863f4e240b0eedaca513dda6d
Signed-off-by: Vadim Saranov <vadim.saranov@gmail.com>
master
Vadim Saranov 4 weeks ago committed by Donat Zenichev
parent a84cb0e3aa
commit cac6485dff

@ -107,6 +107,7 @@ bool AmConfig::LogEvents = false;
int AmConfig::UnhandledReplyLoglevel = 0;
bool AmConfig::SkipGenerateDirectionBoth = false;
bool AmConfig::IgnoreRouteSetOnPrack = false;
#ifdef WITH_ZRTP
bool AmConfig::enable_zrtp = true;
@ -412,6 +413,10 @@ int AmConfig::readConfiguration()
SkipGenerateDirectionBoth = (cfg.getParameter("skip_generate_direction_both") == "yes");
}
if(cfg.hasParameter("ignore_routeset_on_prack")) {
IgnoreRouteSetOnPrack = (cfg.getParameter("ignore_routeset_on_prack") == "yes");
}
if(cfg.hasParameter("sip_nat_handling")) {
SipNATHandling = (cfg.getParameter("sip_nat_handling") == "yes");
}

@ -207,6 +207,11 @@ struct AmConfig
static vector <string> CodecOrder;
static bool SkipGenerateDirectionBoth;
/** strict RFC 3261 behavior for the 200 OK on PRACK: when true, the route
* set is not updated (it is taken once when the dialog is created) and the
* remote tag is only taken from the 200 OK on PRACK if it was not yet set.
* false (default) keeps the legacy behavior of updating both. */
static bool IgnoreRouteSetOnPrack;
enum ApplicationSelector {
App_RURIUSER,

@ -598,14 +598,26 @@ bool AmSipDialog::onRxReplyStatus(const AmSipReply& reply)
/* PRACK */
} else if (reply.cseq_method == SIP_METH_PRACK) {
/* do not update call leg status for transactions not involving INVITE.
* In this case just update the to-tag and route set */
if (!reply.to_tag.empty()) {
ILOG_DLG(L_DBG, "Updating remote tag (to tag) to: '%s'.\n", reply.to_tag.c_str());
setRemoteTag(reply.to_tag);
}
if (!reply.route.empty()) {
ILOG_DLG(L_DBG, "Updating route set to: '%s'.\n", reply.route.c_str());
setRouteSet(reply.route);
* With ignore_routeset_on_prack=yes the route set is taken once when the
* dialog is created and is not updated by the 200 OK on PRACK; the remote
* tag is still taken from the 200 OK on PRACK only if it was not already
* known. The default (no) keeps the legacy behavior of updating both from
* the 200 OK on PRACK.
*/
if (AmConfig::IgnoreRouteSetOnPrack) {
if (!reply.to_tag.empty() && getRemoteTag().empty()) {
ILOG_DLG(L_DBG, "Taking remote tag (to tag) from PRACK 200 OK: '%s'.\n", reply.to_tag.c_str());
setRemoteTag(reply.to_tag);
}
} else {
if (!reply.to_tag.empty()) {
ILOG_DLG(L_DBG, "Updating remote tag (to tag) to: '%s'.\n", reply.to_tag.c_str());
setRemoteTag(reply.to_tag);
}
if (!reply.route.empty()) {
ILOG_DLG(L_DBG, "Updating route set to: '%s'.\n", reply.route.c_str());
setRouteSet(reply.route);
}
}
}

@ -426,6 +426,18 @@ use_default_signature=yes
#
#100rel=require
# ignore the route set from the 200 OK on PRACK? [yes, no]
#
# yes - strict RFC 3261: the route set is taken once when the dialog is
# created and not updated, and the remote tag is taken from the 200 OK
# on PRACK only if it was not already known.
# no - legacy behavior: the route set and remote tag are updated from the
# 200 OK on PRACK.
#
# Default: no
#
#ignore_routeset_on_prack=yes
# Make SIP authenticated requests sticky to the proxy? [yes | no]
#
# If enabled, host of request-URI of out-of-dialog requests that are

@ -576,6 +576,18 @@ use_default_signature=yes
#
#100rel=require
# ignore the route set from the 200 OK on PRACK? [yes, no]
#
# yes - strict RFC 3261: the route set is taken once when the dialog is
# created and not updated, and the remote tag is taken from the 200 OK
# on PRACK only if it was not already known.
# no - legacy behavior: the route set and remote tag are updated from the
# 200 OK on PRACK.
#
# Default: no
#
#ignore_routeset_on_prack=yes
# force the use of outbound interface? [yes, no]
#
# Useful in case of overlapping networks, or if OS routing can/should not be used.

Loading…
Cancel
Save