Module: sip-router
Branch: master
Commit: 390383e2d0dff755ff9f0eb6a6b1fe627dc29949
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=390383e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Thu Feb 9 15:28:44 2012 +0100
dialog(k): match on callid and ftag for no ACK'ed dialogs
- some of the TM callbacks look for the dialog with initial INVITE that
has no to-tag yet, even that the callback is run on 200ok and dialog was
updated with this field
- reported by Jon Bergli Heier
---
modules_k/dialog/dlg_hash.h | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/modules_k/dialog/dlg_hash.h b/modules_k/dialog/dlg_hash.h
index fa7566b..06fbd75 100644
--- a/modules_k/dialog/dlg_hash.h
+++ b/modules_k/dialog/dlg_hash.h
@@ -458,6 +458,16 @@ static inline int match_dialog(dlg_cell_t *dlg, str *callid,
*dir = DLG_DIR_DOWNSTREAM;
return 1;
}
+ /* if no ACK yet, might be a lookup of dlg from a TM callback that
+ * runs on 200ok but with initial INVITE that has no to-tag */
+ if(ttag->len==0 && dlg->state==DLG_STATE_CONFIRMED_NA
+ && dlg->tag[DLG_CALLER_LEG].len == ftag->len &&
+ strncmp(dlg->tag[DLG_CALLER_LEG].s, ftag->s, ftag->len)==0 &&
+ strncmp(dlg->callid.s, callid->s, callid->len)==0) {
+
+ *dir = DLG_DIR_DOWNSTREAM;
+ return 1;
+ }
}
}