dlg_cb.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _DIALOG_DLG_CB_H_
00033 #define _DIALOG_DLG_CB_H_
00034
00035 #include "../../parser/msg_parser.h"
00036
00037 struct dlg_cell;
00038
00039 struct dlg_cb_params {
00040 struct sip_msg* msg;
00041 unsigned int direction;
00042 void *dlg_data;
00043 void **param;
00044 };
00045
00046
00047 typedef void (dialog_cb) (struct dlg_cell* dlg, int type,
00048 struct dlg_cb_params * params);
00049
00050 typedef void (param_free_cb) (void *param);
00051
00052 typedef int (*register_dlgcb_f)(struct dlg_cell* dlg, int cb_types,
00053 dialog_cb f, void *param, param_free_cb ff);
00054
00055
00056 #define DLGCB_LOADED (1<<0)
00057 #define DLGCB_CREATED (1<<1)
00058 #define DLGCB_FAILED (1<<2)
00059 #define DLGCB_CONFIRMED (1<<3)
00060 #define DLGCB_REQ_WITHIN (1<<4)
00061 #define DLGCB_TERMINATED (1<<5)
00062 #define DLGCB_EXPIRED (1<<6)
00063 #define DLGCB_EARLY (1<<7)
00064 #define DLGCB_RESPONSE_FWDED (1<<8)
00065 #define DLGCB_RESPONSE_WITHIN (1<<9)
00066 #define DLGCB_MI_CONTEXT (1<<10)
00067 #define DLGCB_DESTROY (1<<11)
00068
00069 struct dlg_callback {
00070 int types;
00071 dialog_cb* callback;
00072 void *param;
00073 param_free_cb* callback_param_free;
00074 struct dlg_callback* next;
00075 };
00076
00077
00078 struct dlg_head_cbl {
00079 struct dlg_callback *first;
00080 int types;
00081 };
00082
00083
00084 void destroy_dlg_callbacks(unsigned int type);
00085
00086 void destroy_dlg_callbacks_list(struct dlg_callback *cb);
00087
00088 int register_dlgcb( struct dlg_cell* dlg, int types, dialog_cb f, void *param, param_free_cb ff);
00089
00090 void run_create_callbacks(struct dlg_cell *dlg, struct sip_msg *msg);
00091
00092 void run_dlg_callbacks( int type , struct dlg_cell *dlg, struct sip_msg *msg,
00093 unsigned int dir, void *dlg_data);
00094
00095 void run_load_callbacks( void );
00096
00097
00098 #endif