dlg_handlers.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Voice System SRL
00003  *
00004  * This file is part of Kamailio, a free SIP server.
00005  *
00006  * Kamailio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version
00010  *
00011  * Kamailio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License 
00017  * along with this program; if not, write to the Free Software 
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  * History:
00021  * --------
00022  * 2006-04-14  initial version (bogdan)
00023  * 2007-03-06  syncronized state machine added for dialog state. New tranzition
00024  *             design based on events; removed num_1xx and num_2xx (bogdan)
00025  */
00026 
00027 
00035 #ifndef _DIALOG_DLG_HANDLERS_H_
00036 #define _DIALOG_DLG_HANDLERS_H_
00037 
00038 #include "../../parser/msg_parser.h"
00039 #include "../../str.h"
00040 #include "../../pvar.h"
00041 #include "../../modules/tm/t_hooks.h"
00042 #include "dlg_timer.h"
00043 
00044 #define MAX_DLG_RR_PARAM_NAME 32
00045 
00046 /* values for the sequential match mode */
00047 #define SEQ_MATCH_STRICT_ID  0
00048 #define SEQ_MATCH_FALLBACK   1
00049 #define SEQ_MATCH_NO_ID      2
00050 
00051 
00060 void init_dlg_handlers(char *rr_param, int dlg_flag,
00061                 pv_spec_t *timeout_avp, int default_timeout,
00062                 int seq_match_mode);
00063 
00064 
00068 void destroy_dlg_handlers(void);
00069 
00070 
00084 int populate_leg_info(dlg_cell_t *dlg, sip_msg_t *msg,
00085         tm_cell_t *t, unsigned int leg, str *tag);
00086 
00087 
00094 void dlg_onreq(tm_cell_t *t, int type, struct tmcb_params *param);
00095 
00096 
00108 void dlg_onroute(sip_msg_t *req, str *rr_param, void *param);
00109 
00110 
00115 void dlg_ontimeout(dlg_tl_t *tl);
00116 
00117 
00132 int dlg_new_dialog(sip_msg_t *req, tm_cell_t *t, const int run_initial_cbs);
00133 
00134 
00142 int pv_get_dlg_lifetime(sip_msg_t *msg, pv_param_t *param,
00143                 pv_value_t *res);
00144 
00145 
00153 int pv_get_dlg_status(sip_msg_t *msg, pv_param_t *param,
00154                 pv_value_t *res);
00155 
00156 
00163 void dlg_tmcb_dummy(tm_cell_t *t, int type, struct tmcb_params *param);
00164 
00168 dlg_cell_t *dlg_get_msg_dialog(sip_msg_t *msg);
00169 
00173 dlg_iuid_t *dlg_get_iuid_shm_clone(dlg_cell_t *dlg);
00174 
00178 void dlg_iuid_sfree(void *iuid);
00179 
00183 int dlg_manage(sip_msg_t *msg);
00184 
00185 #endif