Module: sip-router
Branch: 4.0
Commit: 369164c689950595b7e35c36a810ecd41aaa7a0a
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=369164c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Jul 1 15:22:33 2013 +0200
dialog: increment cseq in early stage for PRACK and UPDATE
- rework from a patch by Halina Nowak
(cherry picked from commit 6cf3ab0ca6f38d1d2e60dbc644bb4d2fb563919a)
---
modules/dialog/dlg_handlers.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/modules/dialog/dlg_handlers.c b/modules/dialog/dlg_handlers.c
index 338dc44..ec55a13 100644
--- a/modules/dialog/dlg_handlers.c
+++ b/modules/dialog/dlg_handlers.c
@@ -1249,21 +1249,28 @@ void dlg_onroute(struct sip_msg* req, str *route_params, void
*param)
}
if ( (event==DLG_EVENT_REQ || event==DLG_EVENT_REQACK)
- && new_state==DLG_STATE_CONFIRMED) {
+ && (new_state==DLG_STATE_CONFIRMED || new_state==DLG_STATE_EARLY)) {
timeout = get_dlg_timeout(req);
if (timeout!=default_timeout) {
dlg->lifetime = timeout;
}
- if (update_dlg_timer( &dlg->tl, dlg->lifetime )==-1) {
- LM_ERR("failed to update dialog lifetime\n");
+ if (new_state!=DLG_STATE_EARLY) {
+ if (update_dlg_timer( &dlg->tl, dlg->lifetime )==-1) {
+ LM_ERR("failed to update dialog lifetime\n");
+ } else {
+ dlg->dflags |= DLG_FLAG_CHANGED;
+ }
}
- if (update_cseqs(dlg, req, dir)!=0) {
- LM_ERR("cseqs update failed\n");
- } else {
- dlg->dflags |= DLG_FLAG_CHANGED;
- if ( dlg_db_mode==DB_MODE_REALTIME )
- update_dialog_dbinfo(dlg);
+ if(event != DLG_EVENT_REQACK) {
+ if(update_cseqs(dlg, req, dir)!=0) {
+ LM_ERR("cseqs update failed\n");
+ } else {
+ dlg->dflags |= DLG_FLAG_CHANGED;
+ }
+ }
+ if(dlg_db_mode==DB_MODE_REALTIME && (dlg->dflags&DLG_FLAG_CHANGED)) {
+ update_dialog_dbinfo(dlg);
}
if (old_state==DLG_STATE_CONFIRMED_NA) {