00001 /* 00002 * $Id: parse_event.h 4789 2008-09-01 11:32:36Z klaus_darilion $ 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 00023 /*! 00024 * \file 00025 * \brief Event header field body parser 00026 * 00027 * The parser was written for Presence Agent module only. 00028 * it recognize presence package only, no sub-packages, no parameters 00029 * It should be replaced by a more generic parser if sub-packages or 00030 * parameters should be parsed too. 00031 * \ingroup parser 00032 */ 00033 00034 #ifndef PARSE_EVENT_H 00035 #define PARSE_EVENT_H 00036 00037 #include "../str.h" 00038 #include "hf.h" 00039 #include "parse_param.h" 00040 00041 #define EVENT_OTHER 0 00042 #define EVENT_PRESENCE 1 00043 #define EVENT_PRESENCE_WINFO 2 00044 #define EVENT_SIP_PROFILE 3 00045 #define EVENT_XCAP_CHANGE 4 00046 #define EVENT_DIALOG 5 00047 #define EVENT_MWI 6 00048 #define EVENT_DIALOG_SLA 7 00049 00050 typedef struct event { 00051 str text; /* Original string representation */ 00052 int parsed; /* Parsed variant */ 00053 param_t* params; 00054 } event_t; 00055 00056 00057 /*! 00058 * Parse Event HF body 00059 */ 00060 int parse_event(struct hdr_field* _h); 00061 00062 00063 /*! 00064 * Release memory 00065 */ 00066 void free_event(event_t** _e); 00067 00068 00069 /*! 00070 * Print structure, for debugging only 00071 */ 00072 void print_event(event_t* _e); 00073 00074 int event_parser(char* _s, int _l, event_t* _e); 00075 00076 #endif /* PARSE_EVENT_H */
1.5.6