|
@@ -385,9 +385,12 @@ do{ \
|
|
|
|
|
|
/* callback function prototype */
|
|
|
typedef void (transaction_cb) (struct cell* t, int type, struct tmcb_params*);
|
|
|
+/*! \brief function to release the callback param */
|
|
|
+typedef void (release_tmcb_param) (void* param);
|
|
|
/* register callback function prototype */
|
|
|
typedef int (*register_tmcb_f)(struct sip_msg* p_msg, struct cell *t,
|
|
|
- int cb_types, transaction_cb f, void *param);
|
|
|
+ int cb_types, transaction_cb f, void *param,
|
|
|
+ release_tmcb_param func);
|
|
|
|
|
|
|
|
|
struct tm_callback {
|
|
@@ -395,6 +398,8 @@ struct tm_callback {
|
|
|
int types; /* types of events that trigger the callback*/
|
|
|
transaction_cb* callback; /* callback function */
|
|
|
void *param; /* param to be passed to callback function */
|
|
|
+ release_tmcb_param* release; /**< Function to release the callback param
|
|
|
+ * when the callback is deleted */
|
|
|
struct tm_callback* next;
|
|
|
};
|
|
|
|
|
@@ -423,11 +428,13 @@ void destroy_tmcb_lists();
|
|
|
|
|
|
/* register a callback for several types of events */
|
|
|
int register_tmcb( struct sip_msg* p_msg, struct cell *t, int types,
|
|
|
- transaction_cb f, void *param );
|
|
|
+ transaction_cb f, void *param,
|
|
|
+ release_tmcb_param rel_func);
|
|
|
|
|
|
/* inserts a callback into the a callback list */
|
|
|
int insert_tmcb(struct tmcb_head_list *cb_list, int types,
|
|
|
- transaction_cb f, void *param );
|
|
|
+ transaction_cb f, void *param,
|
|
|
+ release_tmcb_param rel_func);
|
|
|
|
|
|
/* run all transaction callbacks for an event type */
|
|
|
void run_trans_callbacks( int type , struct cell *trans,
|