<p>Hi,</p>
<p>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.</p>
<p>} else if (cell->flags & DLG_FLAG_VP_CHANGED) {<br>
VAL_TYPE(values) = DB_BIGINT;<br>
VAL_TYPE(values+20) = DB_INT;<br>
VAL_TYPE(values+21) = DB_INT;<br>
VAL_TYPE(values+18) = VAL_TYPE(values+19) = DB_STR;</p>
<pre><code> /* 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;
}
</code></pre>
<p>The issue will only affect users that have set db_mode to DB_REALTIME.</p>
<p>Regards,<br>
Mickael</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/310">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/5479561__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyNDE0MTE2NiwiZGF0YSI6eyJpZCI6NDAxNDA2NTd9fQ==--3775b1d5c7a758978d59db58de3d68beaea28bcd.gif" width="1" /></p>