From 125031daeade9dab5c36b912dda65700d95c4c6a Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 23 Mar 2020 17:48:39 +0100 Subject: [PATCH] dialog: exposed functions to search dlg and lock table entry --- src/modules/dialog/dlg_hash.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/modules/dialog/dlg_hash.h b/src/modules/dialog/dlg_hash.h index eb933c5acb2..ed5cd7bef0f 100644 --- a/src/modules/dialog/dlg_hash.h +++ b/src/modules/dialog/dlg_hash.h @@ -324,6 +324,18 @@ int dlg_update_rr_set(struct dlg_cell * dlg, unsigned int leg, str *rr); int dlg_set_toroute(dlg_cell_t *dlg, str *route); +/*! + * \brief Lookup a dialog in the global list + * + * Note that the caller is responsible for decrementing (or reusing) + * the reference counter by one again iff a dialog has been found. + * \param h_entry number of the hash table entry + * \param h_id id of the hash table entry + * \param lmode id if 0, then dlg table entry is unlocked, otherwise is locked + * \return dialog structure on success, NULL on failure + */ +dlg_cell_t *dlg_lookup_mode(unsigned int h_entry, unsigned int h_id, int lmode); + /*! * \brief Lookup a dialog in the global list * @@ -335,6 +347,17 @@ int dlg_set_toroute(dlg_cell_t *dlg, str *route); */ dlg_cell_t* dlg_lookup(unsigned int h_entry, unsigned int h_id); +/*! + * \brief Search a dialog in the global list by iuid + * + * Note that the caller is responsible for decrementing (or reusing) + * the reference counter by one again if a dialog has been found. + * \param diuid internal unique id per dialog + * \param lmode id if 0, then dlg table entry is unlocked, otherwise is locked + * \return dialog structure on success, NULL on failure + */ +dlg_cell_t* dlg_get_by_iuid_mode(dlg_iuid_t *diuid, int lmode); + /*! * \brief Search and return dialog in the global list by iuid *