acc_extra.h

Go to the documentation of this file.
00001 /*
00002  * $Id: acc_extra.h 5003 2008-09-26 11:01:51Z henningw $
00003  *
00004  * Copyright (C) 2004 Voice Sistem SRL
00005  * Copyright (C) 2008 Juha Heinanen
00006  *
00007  * This file is part of Kamailio, a free SIP server.
00008  *
00009  * Kamailio is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License
00011  * as published by the Free Software Foundation; either version 2
00012  * of the License, or (at your option) any later version.
00013  *
00014  * Kamailio is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022  *
00023  *
00024  * History:
00025  * ---------
00026  *  2004-10-28  first version (ramona)
00027  *  2005-05-30  acc_extra patch commited (ramona)
00028  *  2005-07-13  acc_extra specification moved to use pseudo-variables (bogdan)
00029  *  2006-09-08  flexible multi leg accounting support added,
00030  *              code cleanup for low level functions (bogdan)
00031  *  2006-09-19  final stage of a masive re-structuring and cleanup (bogdan)
00032  *  2008-09-03  added support for integer type Radius attributes (jh)
00033  */
00034 
00035 /*! \file
00036  * \ingroup acc
00037  * \brief Acc:: Extra attributes
00038  *
00039  * - \ref acc_extra.h
00040  * - Module: \ref acc
00041  */
00042 
00043 #ifndef _ACC_EXTRA_H_
00044 #define _ACC_EXTRA_H_
00045 
00046 #include "../../str.h"
00047 #include "../../pvar.h"
00048 #include "../../parser/msg_parser.h"
00049 
00050 struct acc_extra
00051 {
00052    str        name;       /*!< name (log comment/ column name) */
00053    pv_spec_t  spec;       /*!< value's spec */
00054    struct acc_extra *next;
00055 };
00056 
00057 
00058 #define MAX_ACC_EXTRA 64
00059 #define MAX_ACC_LEG   16
00060 
00061 enum {TYPE_NULL = 0, TYPE_INT, TYPE_STR};
00062 
00063 void init_acc_extra(void);
00064 
00065 struct acc_extra *parse_acc_extra(char *extra);
00066 
00067 struct acc_extra *parse_acc_leg(char *extra);
00068 
00069 void destroy_extras( struct acc_extra *extra);
00070 
00071 int extra2strar( struct acc_extra *extra, struct sip_msg *rq,
00072        str *val_arr, int *int_arr, char *type_arr);
00073 
00074 int legs2strar( struct acc_extra *legs, struct sip_msg *rq, str *val_arr,
00075       int *int_arr, char *type_arr, int start);
00076 
00077 int extra2int( struct acc_extra *extra, int *attrs );
00078 
00079 #ifdef RAD_ACC
00080 #include "../../radius.h"
00081 int extra2attrs( struct acc_extra *extra, struct attr *attrs, int offset);
00082 #endif
00083 
00084 #endif
00085 

Generated on Thu May 17 12:00:24 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6