1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
/*
* $Id: avpops_db.h,v 1.2 2006/02/15 15:55:52 miconda Exp $
*
* Copyright (C) 2004 Voice Sistem SRL
*
* This file is part of Open SIP Express Router.
*
* AVPOPS OpenSER-module is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* AVPOPS OpenSER-module is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* For any questions about this software and its license, please contact
* Voice Sistem at following e-mail address:
* office@voice-sistem.ro
*
*
* History:
* ---------
* 2004-10-04 first version (ramona)
* 2004-11-11 added support for db schemes for avp_db_load (ramona)
*/
#ifndef _AVP_OPS_DB_H_
#define _AVP_OPS_DB_H_
#include "../../db/db.h"
#include "../../parser/msg_parser.h"
#include "../../str.h"
#include "../../sr_module.h"
/* definition of a DB scheme*/
struct db_scheme
{
char *name;
char *uuid_col;
char *username_col;
char *domain_col;
char *value_col;
char *table;
int db_flags;
struct db_scheme *next;
};
typedef struct _avpname_list {
xl_spec_t sname;
struct _avpname_list *next;
} avpname_list_t, *avpname_list_p;
int avpops_db_bind(char* db_url);
int avpops_db_init(char* db_url, char* db_table, char **db_columns);
db_res_t *db_load_avp( str *uuid, str *username, str *domain,
char *attr, char *table, struct db_scheme *scheme);
void db_close_query( db_res_t *res );
int db_store_avp( db_key_t *keys, db_val_t *vals, int n, char *table);
int db_delete_avp( str *uuid, str *username, str *domain,
char *attr, char *table);
int db_query_avp(struct sip_msg* msg, char *query, avpname_list_t* dest);
int avp_add_db_scheme( modparam_t type, void* val);
struct db_scheme *avp_get_db_scheme( char *name );
#endif
|