Module: kamailio
Branch: 5.3
Commit: 8cee1675e95363462d20cdc2b8aaac1a6976eb9c
URL:
https://github.com/kamailio/kamailio/commit/8cee1675e95363462d20cdc2b8aaac1…
Author: Peter Friedrich <peter.friedrich(a)kapsch.net>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-03-30T19:08:17+02:00
ims_dialog: bugfix for registering dialog callbacks
- bugfix for registering dialog callbacks
- in Rx scenarios of parallel forking (several INVITEs with same CALLID
and FROMTAG sent to PCSCF) and INVITE for orig and term handled in
same PCSCF (means also INVITEs with identical CALLID and FROMTAG) the wrong
dialog is selected for registering the callback (i.e. the callback
for sending STR) when 200OK from terminator is processed.
- Root cause is that dialog is searched with callid-fromtag-totag but at
the time of dialog insertion (processing of INVITE) no totag is available.
- fix is to get ctx dialog at 200OK processing before suspending the
transaction - save dialog until AAA is received - use this dialog for
registering the STR callback.
(cherry picked from commit e2a1b967fd6e2cc92dc1447e1c033f6124aca446)
---
Modified: src/modules/ims_dialog/dlg_cb.c
Modified: src/modules/ims_dialog/dlg_cb.h
Modified: src/modules/ims_dialog/dlg_handlers.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8cee1675e95363462d20cdc2b8aaac1…
Patch:
https://github.com/kamailio/kamailio/commit/8cee1675e95363462d20cdc2b8aaac1…
---
diff --git a/src/modules/ims_dialog/dlg_cb.c b/src/modules/ims_dialog/dlg_cb.c
index 1b7caa21ce..d4d0ee356c 100644
--- a/src/modules/ims_dialog/dlg_cb.c
+++ b/src/modules/ims_dialog/dlg_cb.c
@@ -100,15 +100,10 @@ void destroy_dlg_callbacks(unsigned int types)
}
}
-int register_dlgcb_nodlg(str *callid, str *ftag, str *ttag,
- int types, dialog_cb f,
+
+int register_dlgcb_nodlg(struct dlg_cell *dlg, int types, dialog_cb f,
void *param, param_free_cb ff )
{
- struct dlg_cell *dlg;
-
- unsigned int dir = DLG_DIR_NONE;
- dlg = get_dlg(callid, ftag, ttag, &dir); //increments ref count!
-
if (!dlg) {
LM_ERR("Can't find dialog to register callback\n");
return -1;
diff --git a/src/modules/ims_dialog/dlg_cb.h b/src/modules/ims_dialog/dlg_cb.h
index f0f9815c9c..13d76d5a74 100644
--- a/src/modules/ims_dialog/dlg_cb.h
+++ b/src/modules/ims_dialog/dlg_cb.h
@@ -51,8 +51,7 @@ typedef void (param_free_cb) (void *param);
typedef int (*ims_register_dlgcb_f)(struct dlg_cell* dlg, int cb_types,
dialog_cb f, void *param, param_free_cb ff);
-typedef int (*ims_register_dlgcb_nodlg_f)(str *callid, str *ftag, str *ttag,
- int cb_types, dialog_cb f, void *param, param_free_cb ff);
+typedef int (*ims_register_dlgcb_nodlg_f)(struct dlg_cell* dlg, int cb_types, dialog_cb
f, void *param, param_free_cb ff);
/* method to set a variable within a dialog */
//typedef int (*set_dlg_variable_f)( struct dlg_cell* dlg,
@@ -103,7 +102,7 @@ void destroy_dlg_callbacks(unsigned int type);
void destroy_dlg_callbacks_list(struct dlg_callback *cb);
-int register_dlgcb_nodlg(str *callid, str *ftag, str *ttag, int types, dialog_cb f, void
*param, param_free_cb ff );
+int register_dlgcb_nodlg(struct dlg_cell* dlg, int types, dialog_cb f, void *param,
param_free_cb ff);
int register_dlgcb( struct dlg_cell* dlg, int types, dialog_cb f, void *param,
param_free_cb ff);
void run_create_callbacks(struct dlg_cell *dlg, struct sip_msg *msg);
diff --git a/src/modules/ims_dialog/dlg_handlers.c
b/src/modules/ims_dialog/dlg_handlers.c
index b0f5b491bb..3d8dee7ff3 100644
--- a/src/modules/ims_dialog/dlg_handlers.c
+++ b/src/modules/ims_dialog/dlg_handlers.c
@@ -1965,4 +1965,3 @@ struct dlg_cell *dlg_get_msg_dialog(sip_msg_t *msg) {
return dlg;
}
-