avpops_db.h

Go to the documentation of this file.
00001 /*
00002  * $Id: avpops_db.h 5091 2008-10-17 17:07:01Z henningw $
00003  *
00004  * Copyright (C) 2004-2006 Voice Sistem SRL
00005  *
00006  * This file is part of Kamailio.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (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  *  2004-10-04  first version (ramona)
00025  *  2004-11-11  added support for db schemes for avp_db_load (ramona)
00026  */
00027 
00028 
00029 
00030 #ifndef _AVP_OPS_DB_H_
00031 #define _AVP_OPS_DB_H_
00032 
00033 #include "../../db/db.h"
00034 #include "../../parser/msg_parser.h"
00035 #include "../../str.h"
00036 #include "../../sr_module.h"
00037 #include "../../pvar.h"
00038 
00039 
00040 /* definition of a DB scheme*/
00041 struct db_scheme
00042 {
00043    str name;
00044    str uuid_col;
00045    str username_col;
00046    str domain_col;
00047    str value_col;
00048    str table;
00049    int db_flags;
00050    struct db_scheme *next;
00051 };
00052 
00053 
00054 int avpops_db_bind(const str* db_url);
00055 
00056 int avpops_db_init(const str* db_url, const str* db_table, str **db_columns);
00057 
00058 db_res_t *db_load_avp( str *uuid, str *username, str *domain,
00059       char *attr, const str *table, struct db_scheme *scheme);
00060 
00061 void db_close_query( db_res_t *res );
00062 
00063 int db_store_avp( db_key_t *keys, db_val_t *vals, int n, const str *table);
00064 
00065 int db_delete_avp( str *uuid, str *username, str *domain,
00066       char *attr, const str *table);
00067 
00068 int db_query_avp(struct sip_msg* msg, char *query, pvname_list_t* dest);
00069 
00070 int avp_add_db_scheme( modparam_t type, void* val);
00071 
00072 struct db_scheme *avp_get_db_scheme( str *name );
00073 
00074 #endif

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