option to ignore low CSeq for NOTIFY for old event sub implementations

new sems.conf option:

  Ignore too low CSeq for NOTIFYs? [yes | no]

 May be necessary to interwork with simplistic/old (following 3265
 instead of 5057) SIP event notification implementations.

 ignore_notify_lower_cseq=yes

Conflicts:

	core/AmSipDialog.cpp
sayer/1.4-spce2.6
Stefan Sayer 15 years ago
parent b397d727dc
commit e9873524a7

@ -77,6 +77,7 @@ string AmConfig::NextHopIP = "";
unsigned int AmConfig::NextHopPort = 0;
bool AmConfig::NextHopForReplies = false;
bool AmConfig::ProxyStickyAuth = false;
bool AmConfig::IgnoreNotifyLowerCSeq = false;
bool AmConfig::DisableDNSSRV = false;
string AmConfig::Signature = "";
unsigned int AmConfig::MaxForwards = MAX_FORWARDS;
@ -309,6 +310,10 @@ int AmConfig::readConfiguration()
ProxyStickyAuth = (cfg.getParameter("proxy_sticky_auth") == "yes");
}
if(cfg.hasParameter("ignore_notify_lower_cseq")) {
IgnoreNotifyLowerCSeq = (cfg.getParameter("ignore_notify_lower_cseq") == "yes");
}
if(cfg.hasParameter("disable_dns_srv")) {
DisableDNSSRV = (cfg.getParameter("disable_dns_srv") == "yes");
}

@ -134,6 +134,8 @@ struct AmConfig
static bool NextHopForReplies;
/** update ruri-host to previously resolved IP:port on SIP auth */
static bool ProxyStickyAuth;
/** Ignore Low CSeq on NOTIFY - for RFC 3265 instead of 5057 */
static bool IgnoreNotifyLowerCSeq;
/** skip DNS SRV lookup for resolving destination address*/
static bool DisableDNSSRV;
/** Server/User-Agent header (optional) */

@ -110,19 +110,25 @@ void AmSipDialog::updateStatus(const AmSipRequest& req)
// Sanity checks
if (r_cseq_i && req.cseq <= r_cseq){
INFO("remote cseq lower than previous ones - refusing request\n");
// see 12.2.2
string hdrs;
if (req.method == "NOTIFY") {
// clever trick to not break subscription dialog usage
// for implementations which follow 3265 instead of 5057
hdrs = SIP_HDR_COLSP(SIP_HDR_RETRY_AFTER) "0" CRLF;
string hdrs; bool i = false;
if (req.method == SIP_METH_NOTIFY) {
if (AmConfig::IgnoreNotifyLowerCSeq)
i = true;
else
// clever trick to not break subscription dialog usage
// for implementations which follow 3265 instead of 5057
hdrs = SIP_HDR_COLSP(SIP_HDR_RETRY_AFTER) "0" CRLF;
}
reply_error(req, 500, SIP_REPLY_SERVER_INTERNAL_ERROR, hdrs,
next_hop_for_replies ? next_hop_ip : "",
next_hop_for_replies ? next_hop_port : 0);
return;
if (!i) {
INFO("remote cseq lower than previous ones - refusing request\n");
// see 12.2.2
reply_error(req, 500, SIP_REPLY_SERVER_INTERNAL_ERROR, hdrs,
next_hop_for_replies ? next_hop_ip : "",
next_hop_for_replies ? next_hop_port : 0);
return;
}
}
if (req.method == "INVITE") {

@ -9,6 +9,7 @@
#define SIP_METH_UPDATE "UPDATE"
#define SIP_METH_BYE "BYE"
#define SIP_METH_ACK "ACK"
#define SIP_METH_NOTIFY "NOTIFY"
#define SIP_HDR_FROM "From"
#define SIP_HDR_TO "To"

@ -525,6 +525,13 @@ use_default_signature=yes
#
# proxy_sticky_auth=yes
# Ignore too low CSeq for NOTIFYs? [yes | no]
#
# May be necessary to interwork with simplistic/old SIP event notification
# implementations.
#
#ignore_notify_lower_cseq=yes
#
# Accept final replies without To-tag? [yes|no]
#

Loading…
Cancel
Save