TT#47976 presence: test if event is dialog when attempting to delete old records

Change-Id: Ic39b448f611e326e80bbb8d7832d04cea42b1136
changes/17/25117/3
Andreas Granig 7 years ago
parent 2e1778866e
commit e3eda4a89f

@ -45,3 +45,4 @@ sipwise/dtmf-blocking.patch
sipwise/media-blocking.patch
upstream/core_cfg_reset_routename_properly.patch
sipwise/tt41650.patch
sipwise/tt47976.patch

@ -0,0 +1,41 @@
Index: kamailio/src/modules/presence/presentity.c
===================================================================
--- kamailio.orig/src/modules/presence/presentity.c
+++ kamailio/src/modules/presence/presentity.c
@@ -379,6 +379,10 @@ int delete_presentity_if_dialog_id_exist
int i = 0;
presentity_t old_presentity;
+ if (presentity->event->evp->type != EVENT_DIALOG) {
+ return 0;
+ }
+
query_cols[n_query_cols] = &str_domain_col;
query_ops[n_query_cols] = OP_EQ;
query_vals[n_query_cols].type = DB1_STR;
@@ -706,17 +710,18 @@ int update_presentity(struct sip_msg* ms
goto error;
}
}
+ if (presentity->event->evp->type == EVENT_DIALOG) {
+ check_if_dialog(*body, &is_dialog, &dialog_id);
+ if (dialog_id) {
+ if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) {
+ free(dialog_id);
+ dialog_id = NULL;
+ goto error;
+ }
- check_if_dialog(*body, &is_dialog, &dialog_id);
- if ( dialog_id ) {
- if (delete_presentity_if_dialog_id_exists(presentity, dialog_id) < 0) {
free(dialog_id);
dialog_id = NULL;
- goto error;
}
-
- free(dialog_id);
- dialog_id = NULL;
}
LM_DBG("inserting %d cols into table\n",n_query_cols);
Loading…
Cancel
Save