acc.h

Go to the documentation of this file.
00001 /*
00002  * $Id: acc.h 5003 2008-09-26 11:01:51Z henningw $
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  * Copyright (C) 2006 Voice Sistem SRL
00006  *
00007  * This file is part of Kamailio, a free SIP server.
00008  *
00009  * Kamailio is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (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  * History:
00024  * --------
00025  * 2003-04-04  grand acc cleanup (jiri)
00026  * 2003-11-04  multidomain support for mysql introduced (jiri)
00027  * 2004-06-06  cleanup: acc_db_{bind,init,close} added (andrei)
00028  * 2006-09-08  flexible multi leg accounting support added,
00029  *             code cleanup for low level functions (bogdan)
00030  * 2006-09-19  final stage of a masive re-structuring and cleanup (bogdan)
00031  */
00032 
00033 /*! \file
00034  * \ingroup acc
00035  * \brief Acc:: Core accounting
00036  *
00037  * - See \ref acc.c
00038  * - Module: \ref acc
00039  */
00040 
00041 #ifndef _ACC_ACC_H_
00042 #define _ACC_ACC_H_
00043 
00044 #define ACC_CORE_LEN 6
00045 
00046 /* leading text for a request accounted from a script */
00047 #define ACC "ACC: "
00048 #define ACC_REQUEST ACC"request accounted: "
00049 #define ACC_REQUEST_LEN (sizeof(ACC_REQUEST)-1)
00050 #define ACC_MISSED ACC"call missed: "
00051 #define ACC_MISSED_LEN (sizeof(ACC_MISSED)-1)
00052 #define ACC_ANSWERED ACC"transaction answered: "
00053 #define ACC_ANSWERED_LEN (sizeof(ACC_ANSWERED)-1)
00054 #define ACC_ACKED ACC"request acknowledged: "
00055 #define ACC_ACKED_LEN (sizeof(ACC_ACKED)-1)
00056 
00057 /* syslog attribute names */
00058 #define A_METHOD "method"
00059 #define A_METHOD_LEN (sizeof(A_METHOD)-1)
00060 #define A_FROMTAG "from_tag"
00061 #define A_FROMTAG_LEN (sizeof(A_FROMTAG)-1)
00062 #define A_TOTAG "to_tag"
00063 #define A_TOTAG_LEN (sizeof(A_TOTAG)-1)
00064 #define A_CALLID "call_id"
00065 #define A_CALLID_LEN (sizeof(A_CALLID)-1)
00066 #define A_CODE "code"
00067 #define A_CODE_LEN (sizeof(A_CODE)-1)
00068 #define A_STATUS "reason"
00069 #define A_STATUS_LEN (sizeof(A_STATUS)-1)
00070 
00071 #define A_SEPARATOR_CHR ';'
00072 #define A_EQ_CHR '='
00073 
00074 #define MAX_SYSLOG_SIZE  65536
00075 
00076 void acc_log_init(void);
00077 int  acc_log_request( struct sip_msg *req);
00078 
00079 #ifdef SQL_ACC
00080 int  acc_db_init(const str* db_url);
00081 int  acc_db_init_child(const str* db_url);
00082 void acc_db_close(void);
00083 int  acc_db_request( struct sip_msg *req);
00084 #endif
00085 
00086 #ifdef RAD_ACC
00087 int  init_acc_rad(char *rad_cfg, int srv_type);
00088 int  acc_rad_request( struct sip_msg *req );
00089 #endif
00090 
00091 #ifdef DIAM_ACC
00092 int  acc_diam_init(void);
00093 int  acc_diam_request( struct sip_msg *req );
00094 #endif
00095 
00096 #endif

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