Browse code

dialog: exposed functions to search dlg and lock table entry

Daniel-Constantin Mierla authored on 23/03/2020 16:48:39
Showing 1 changed files
... ...
@@ -324,6 +324,18 @@ int dlg_update_rr_set(struct dlg_cell * dlg, unsigned int leg, str *rr);
324 324
 int dlg_set_toroute(dlg_cell_t *dlg, str *route);
325 325
 
326 326
 
327
+/*!
328
+ * \brief Lookup a dialog in the global list
329
+ *
330
+ * Note that the caller is responsible for decrementing (or reusing)
331
+ * the reference counter by one again iff a dialog has been found.
332
+ * \param h_entry number of the hash table entry
333
+ * \param h_id id of the hash table entry
334
+ * \param lmode id if 0, then dlg table entry is unlocked, otherwise is locked
335
+ * \return dialog structure on success, NULL on failure
336
+ */
337
+dlg_cell_t *dlg_lookup_mode(unsigned int h_entry, unsigned int h_id, int lmode);
338
+
327 339
 /*!
328 340
  * \brief Lookup a dialog in the global list
329 341
  *
... ...
@@ -335,6 +347,17 @@ int dlg_set_toroute(dlg_cell_t *dlg, str *route);
335 347
  */
336 348
 dlg_cell_t* dlg_lookup(unsigned int h_entry, unsigned int h_id);
337 349
 
350
+/*!
351
+ * \brief Search a dialog in the global list by iuid
352
+ *
353
+ * Note that the caller is responsible for decrementing (or reusing)
354
+ * the reference counter by one again if a dialog has been found.
355
+ * \param diuid internal unique id per dialog
356
+ * \param lmode id if 0, then dlg table entry is unlocked, otherwise is locked
357
+ * \return dialog structure on success, NULL on failure
358
+ */
359
+dlg_cell_t* dlg_get_by_iuid_mode(dlg_iuid_t *diuid, int lmode);
360
+
338 361
 /*!
339 362
  * \brief Search and return dialog in the global list by iuid
340 363
  *