dp_db.h

Go to the documentation of this file.
00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C)  2007-2008 Voice Sistem SRL
00005  *
00006  * This file is part of SIP-router, a free SIP server.
00007  *
00008  * SIP-router 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  * SIP-router 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  *  2007-08-01 initial version (ancuta onofrei)
00025  */
00026 
00034 #ifndef _DP_DB_H_
00035 #define _DP_DB_H
00036 
00037 #include "../../str.h"
00038 #include "../../lib/srdb1/db.h"
00039 
00040 #define DP_TABLE_NAME                   "dialplan"
00041 #define DPID_COL                                "dpid"
00042 #define PR_COL                                  "pr"
00043 #define MATCH_OP_COL                    "match_op"
00044 #define MATCH_EXP_COL                   "match_exp"
00045 #define MATCH_LEN_COL                   "match_len"
00046 #define SUBST_EXP_COL                   "subst_exp"
00047 #define REPL_EXP_COL                    "repl_exp"
00048 #define ATTRS_COL                               "attrs"
00049 
00050 
00051 #define DP_TABLE_VERSION                1
00052 #define DP_TABLE_COL_NO                 8
00053 
00054 extern str dp_db_url;
00055 extern str dp_table_name;
00056 extern str dpid_column; 
00057 extern str pr_column; 
00058 extern str match_op_column; 
00059 extern str match_exp_column; 
00060 extern str match_len_column; 
00061 extern str subst_exp_column; 
00062 extern str repl_exp_column; 
00063 extern str attrs_column; 
00064 
00065 int init_db_data();
00066 int dp_connect_db();
00067 void dp_disconnect_db();
00068 
00069 #endif