[OpenSIPS-Devel] [opensips] dlg_id of dialog to update not set before executing UPDATE (#310)

miko95 notifications at github.com
Wed Aug 20 10:06:06 CEST 2014


Hi,

In function update_dialog_dbinfo (see dlg_db_handler.c), the dlg_id is not set before issuing the UPDATE statement. The type is set to DB_BIGINT using the VAL_TYPE macro, but the value is not set.

} else if (cell->flags & DLG_FLAG_VP_CHANGED) {
		VAL_TYPE(values) = DB_BIGINT;
		VAL_TYPE(values+20) = DB_INT;
		VAL_TYPE(values+21) = DB_INT;
		VAL_TYPE(values+18) = VAL_TYPE(values+19) = DB_STR;

		/* lock the entry */
		entry = (d_table->entries)[cell->h_entry];
		dlg_lock( d_table, &entry);

                /* THIS LINE SHOULD BE ADDED */
                SET_BIGINT_VALUE(values, (((long long)cell->h_entry << 32) |
					 cell->h_id));

		set_final_update_cols(values+18, cell, 0);

		CON_PS_REFERENCE(dialog_db_handle) = &my_ps_update_vp;

		if((dialog_dbf.update(dialog_db_handle, (insert_keys), 0,
						(values), (insert_keys+18), (values+18), 1, 4)) !=0){
			LM_ERR("could not update database info\n");
			goto error;
		}

		run_dlg_callbacks( DLGCB_SAVED, cell, 0, DLG_DIR_NONE, 0);

		cell->flags &= ~DLG_FLAG_VP_CHANGED;
	}

The issue will only affect users that have set db_mode to DB_REALTIME.

Regards,
Mickael

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/310
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140820/10af0dd3/attachment.htm>


More information about the Devel mailing list