Module: kamailio
Branch: master
Commit: e0b5ead3cbb73368c7efa3d17e538f458affe98e
URL:
https://github.com/kamailio/kamailio/commit/e0b5ead3cbb73368c7efa3d17e538f4…
Author: Luis Azedo <luis(a)2600hz.com>
Committer: Luis Azedo <luis(a)2600hz.com>
Date: 2017-03-03T17:53:46Z
presence: add a offset for allowed cseq difference
---
Modified: src/modules/presence/presence.c
Modified: src/modules/presence/presence.h
Modified: src/modules/presence/subscribe.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e0b5ead3cbb73368c7efa3d17e538f4…
Patch:
https://github.com/kamailio/kamailio/commit/e0b5ead3cbb73368c7efa3d17e538f4…
---
diff --git a/src/modules/presence/presence.c b/src/modules/presence/presence.c
index 080e9f7..68bc3a7 100644
--- a/src/modules/presence/presence.c
+++ b/src/modules/presence/presence.c
@@ -142,6 +142,7 @@ char prefix='a';
int startup_time=0;
str db_url = {0, 0};
int expires_offset = 0;
+int pres_cseq_offset = 0;
uint32_t min_expires= 0;
int min_expires_action= 1;
uint32_t max_expires= 3600;
@@ -226,6 +227,7 @@ static param_export_t params[]={
{ "retrieve_order", PARAM_INT, &pres_retrieve_order},
{ "retrieve_order_by", PARAM_STR, &pres_retrieve_order_by},
{ "sip_uri_match", PARAM_INT, &pres_uri_match},
+ { "cseq_offset", PARAM_INT, &pres_cseq_offset},
{0,0,0}
};
diff --git a/src/modules/presence/presence.h b/src/modules/presence/presence.h
index 62afa7d..4dbc324 100644
--- a/src/modules/presence/presence.h
+++ b/src/modules/presence/presence.h
@@ -71,6 +71,7 @@ extern int pid;
extern int startup_time;
extern char *to_tag_pref;
extern int expires_offset;
+extern int pres_cseq_offset;
extern str server_address;
extern uint32_t min_expires;
extern int min_expires_action;
diff --git a/src/modules/presence/subscribe.c b/src/modules/presence/subscribe.c
index 000b87d..9dc3b4e 100644
--- a/src/modules/presence/subscribe.c
+++ b/src/modules/presence/subscribe.c
@@ -1666,7 +1666,7 @@ int get_stored_info(struct sip_msg* msg, subs_t* subs, int*
reply_code,
subs->local_cseq= s->local_cseq +1;
- if(subs->remote_cseq<= s->remote_cseq)
+ if(subs->remote_cseq + pres_cseq_offset <= s->remote_cseq)
{
LM_ERR("wrong sequence number;received: %d - stored: %d\n",
subs->remote_cseq, s->remote_cseq);
@@ -1782,7 +1782,7 @@ int get_database_info(struct sip_msg* msg, subs_t* subs, int*
reply_code, str* r
row_vals = ROW_VALUES(row);
remote_cseq= row_vals[remote_cseq_col].val.int_val;
- if(subs->remote_cseq<= remote_cseq)
+ if(subs->remote_cseq + pres_cseq_offset <= remote_cseq)
{
LM_ERR("wrong sequence number received: %d - stored: %d\n",
subs->remote_cseq, remote_cseq);