00001 /* 00002 * $Id: script_cb.h 5003 2008-09-26 11:01:51Z henningw $ 00003 * 00004 * Copyright (C) 2001-2003 FhG Fokus 00005 * 00006 * This file is part of Kamailio, a free SIP server. 00007 * 00008 * Kamailio is free software; you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation; either version 2 of the License, or 00011 * (at your option) any later version 00012 * 00013 * Kamailio is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program; if not, write to the Free Software 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 * 00022 * History: 00023 * -------- 00024 * 2005-02-13 script callbacks devided into request and reply types (bogdan) 00025 */ 00026 00027 /*! 00028 * \file 00029 * \brief Script callbacks functions 00030 */ 00031 00032 #ifndef _SCRIPT_CB_H_ 00033 #define _SCRIPT_CB_H_ 00034 00035 #include "parser/msg_parser.h" 00036 00037 /*! Callback function */ 00038 typedef int (cb_function)( struct sip_msg *msg, void *param ); 00039 00040 /* Callback types */ 00041 #define PRE_SCRIPT_CB (1<<0) /*!< pre-script callback */ 00042 #define POST_SCRIPT_CB (1<<1) /*!< post-script callback */ 00043 #define REQ_TYPE_CB (1<<2) /*!< request callback */ 00044 #define RPL_TYPE_CB (1<<3) /*!< reply callback */ 00045 00046 00047 /*! Script callback list */ 00048 struct script_cb{ 00049 cb_function *cbf; /*!< callback function */ 00050 struct script_cb *next; /*!< next callback */ 00051 unsigned int id; /*!< callback id */ 00052 void *param; /*!< callback parameter */ 00053 }; 00054 00055 int register_script_cb( cb_function f, int type, void *param ); 00056 void destroy_script_cb(void); 00057 00058 int exec_pre_req_cb( struct sip_msg *msg); 00059 int exec_post_req_cb( struct sip_msg *msg); 00060 00061 int exec_pre_rpl_cb( struct sip_msg *msg); 00062 int exec_post_rpl_cb( struct sip_msg *msg); 00063 00064 #endif
1.5.6