00001 /* 00002 * $Id: dlg_db_handler.h 5648 2009-03-01 20:48:31Z miconda $ 00003 * 00004 * Copyright (C) 2007 Voice System SRL 00005 * 00006 * This file is part of Kamailio, a free SIP server. 00007 * 00008 * Kamailio 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 * 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 * 2007-05-10 initial version (ancuta) 00025 */ 00026 00027 00028 #ifndef _DLG_DB_HANDLER_H_ 00029 #define _DLG_DB_HANDLER_H_ 00030 00031 #include "../../str.h" 00032 #include "../../db/db.h" 00033 00034 #define CALL_ID_COL "callid" 00035 #define FROM_URI_COL "from_uri" 00036 #define FROM_TAG_COL "from_tag" 00037 #define TO_URI_COL "to_uri" 00038 #define TO_TAG_COL "to_tag" 00039 #define HASH_ID_COL "hash_id" 00040 #define HASH_ENTRY_COL "hash_entry" 00041 #define STATE_COL "state" 00042 #define START_TIME_COL "start_time" 00043 #define TIMEOUT_COL "timeout" 00044 #define TO_CSEQ_COL "callee_cseq" 00045 #define FROM_CSEQ_COL "caller_cseq" 00046 #define TO_ROUTE_COL "callee_route_set" 00047 #define FROM_ROUTE_COL "caller_route_set" 00048 #define TO_CONTACT_COL "callee_contact" 00049 #define FROM_CONTACT_COL "caller_contact" 00050 #define FROM_SOCK_COL "caller_sock" 00051 #define TO_SOCK_COL "callee_sock" 00052 #define SFLAGS_COL "sflags" 00053 #define TOROUTE_COL "toroute" 00054 #define DIALOG_TABLE_NAME "dialog" 00055 00056 #define DLG_TABLE_VERSION 3 00057 00058 /*every minute the dialogs' information will be refreshed*/ 00059 #define DB_DEFAULT_UPDATE_PERIOD 60 00060 #define DB_MODE_NONE 0 00061 #define DB_MODE_REALTIME 1 00062 #define DB_MODE_DELAYED 2 00063 #define DB_MODE_SHUTDOWN 3 00064 00065 #define DIALOG_TABLE_COL_NO 20 00066 00067 00068 extern str call_id_column; 00069 extern str from_uri_column; 00070 extern str from_tag_column; 00071 extern str to_uri_column; 00072 extern str to_tag_column; 00073 extern str h_id_column; 00074 extern str h_entry_column; 00075 extern str state_column; 00076 extern str start_time_column; 00077 extern str timeout_column; 00078 extern str to_cseq_column; 00079 extern str from_cseq_column; 00080 extern str to_route_column; 00081 extern str from_route_column; 00082 extern str to_contact_column; 00083 extern str from_contact_column; 00084 extern str to_sock_column; 00085 extern str from_sock_column; 00086 extern str sflags_column; 00087 extern str toroute_column; 00088 extern str dialog_table_name; 00089 extern int dlg_db_mode; 00090 00091 int init_dlg_db(const str *db_url, int dlg_hash_size, int db_update_period, int fetch_num_rows); 00092 int dlg_connect_db(const str *db_url); 00093 void destroy_dlg_db(void); 00094 00095 int remove_dialog_from_db(struct dlg_cell * cell); 00096 int update_dialog_dbinfo(struct dlg_cell * cell); 00097 void dialog_update_db(unsigned int ticks, void * param); 00098 00099 #endif
1.5.6