Module: kamailio
Branch: 5.3
Commit: 46ad9e6dacb7b6040e50ba0c53d72585510dac28
URL:
https://github.com/kamailio/kamailio/commit/46ad9e6dacb7b6040e50ba0c53d7258…
Author: Peter Friedrich <peter.friedrich(a)kapsch.net>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-03-30T19:08:31+02:00
ims_qos: bugfix for Rx register dialog callback
- bugfix for Rx register dialog callback
- In some scenarios like parallel forking several INVITE with identical
CALLID and FROMTAG sent to PCSCF which inserts dialogues for each INVITE.
- When 200OK is received in PCSCF the dialog callback must be registered
for the respective dialog. Currently sometimes the wrong dialog is selected
by searching with CALLID FROMTAG and TOTAG thus leading to problem
no STR is sent at BYE.
- Fix is to pickup the right dialog before suspending the transaction during
AAR/AAA processing and reuse this saved dialog.
(cherry picked from commit 2768f8ce1cf6da242674e7e40c8e76eb6c630f6b)
---
Modified: src/modules/ims_qos/ims_qos_mod.c
Modified: src/modules/ims_qos/rx_aar.c
Modified: src/modules/ims_qos/rx_aar.h
---
Diff:
https://github.com/kamailio/kamailio/commit/46ad9e6dacb7b6040e50ba0c53d7258…
Patch:
https://github.com/kamailio/kamailio/commit/46ad9e6dacb7b6040e50ba0c53d7258…
---
diff --git a/src/modules/ims_qos/ims_qos_mod.c b/src/modules/ims_qos/ims_qos_mod.c
index 7e0d50b2df..24a7a14531 100644
--- a/src/modules/ims_qos/ims_qos_mod.c
+++ b/src/modules/ims_qos/ims_qos_mod.c
@@ -1089,6 +1089,13 @@ static int w_rx_aar(struct sip_msg *msg, char *route, char* dir,
char *c_id, int
saved_t_data->aar_update = 1; //this is an update aar - we set this so on
async_aar we know this is an update and act accordingly
}
+ dlg = dlgb.get_dlg(msg);
+ if (!dlg) {
+ LM_ERR("Unable to find dialog and cannot do Rx without
it\n");
+ goto error;
+ }
+ saved_t_data->dlg = dlg;
+
LM_DBG("Suspending SIP TM transaction\n");
if (tmb.t_suspend(msg, &saved_t_data->tindex, &saved_t_data->tlabel) !=
0) {
LM_ERR("failed to suspend the TM processing\n");
diff --git a/src/modules/ims_qos/rx_aar.c b/src/modules/ims_qos/rx_aar.c
index 2029035415..b1e8df51b8 100644
--- a/src/modules/ims_qos/rx_aar.c
+++ b/src/modules/ims_qos/rx_aar.c
@@ -176,8 +176,7 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa,
long elaps
passed_rx_session_id->len = 0;
STR_SHM_DUP(*passed_rx_session_id, aaa->sessionId->data,
"cb_passed_rx_session_id");
LM_DBG("passed rx session id [%.*s]", passed_rx_session_id->len,
passed_rx_session_id->s);
-
- dlgb.register_dlgcb_nodlg(&data->callid, &data->ftag,
&data->ttag, DLGCB_TERMINATED | DLGCB_DESTROY | DLGCB_EXPIRED |
DLGCB_RESPONSE_WITHIN | DLGCB_CONFIRMED | DLGCB_FAILED, callback_dialog, (void*)
(passed_rx_session_id), free_dialog_data);
+ dlgb.register_dlgcb_nodlg( data->dlg, DLGCB_TERMINATED | DLGCB_DESTROY |
DLGCB_EXPIRED | DLGCB_RESPONSE_WITHIN | DLGCB_CONFIRMED | DLGCB_FAILED, callback_dialog,
(void*) (passed_rx_session_id), free_dialog_data);
}
result = CSCF_RETURN_TRUE;
} else {
diff --git a/src/modules/ims_qos/rx_aar.h b/src/modules/ims_qos/rx_aar.h
index 10fa2cc059..550202fa40 100644
--- a/src/modules/ims_qos/rx_aar.h
+++ b/src/modules/ims_qos/rx_aar.h
@@ -72,6 +72,7 @@ typedef struct saved_transaction {
str ftag;
str ttag;
unsigned int aar_update;
+ struct dlg_cell* dlg;
} saved_transaction_t;
typedef struct saved_transaction_local {