dispatch.h

Go to the documentation of this file.
00001 /**
00002  * $Id: dispatch.h 5456 2009-01-14 11:52:18Z miconda $
00003  *
00004  * dispatcher module
00005  * 
00006  * Copyright (C) 2004-2006 FhG Fokus
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License 
00021  * along with this program; if not, write to the Free Software 
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023  *
00024  * History
00025  * -------
00026  * 2004-07-31  first version, by daniel
00027  * 2007-01-11  Added a function to check if a specific gateway is in
00028  *    a group (carsten)
00029  * 2007-02-09  Added active probing of failed destinations and automatic
00030  *    re-enabling of destinations
00031  * 2007-05-08  Ported the changes to SVN-Trunk and renamed ds_is_domain
00032  *    to ds_is_from_list.
00033  */
00034 
00035 /*! \file
00036  * \ingroup dispatcher
00037  * \brief Dispatcher :: Dispatch
00038  */
00039 
00040 #ifndef _DISPATCH_H_
00041 #define _DISPATCH_H_
00042 
00043 #include <stdio.h>
00044 #include "../../pvar.h"
00045 #include "../../parser/msg_parser.h"
00046 #include "../tm/tm_load.h"
00047 
00048 
00049 #define DS_HASH_USER_ONLY  1  /*!< use only the uri user part for hashing */
00050 #define DS_FAILOVER_ON     2  /*!< store the other dest in avps */
00051 
00052 #define DS_INACTIVE_DST    1  /*!< inactive destination */
00053 #define DS_PROBING_DST     2  /*!< checking destination */
00054 #define DS_RESET_FAIL_DST  4  /*!< Reset-Failure-Counter */
00055 
00056 extern str ds_db_url;
00057 extern str ds_table_name;
00058 extern str ds_set_id_col;
00059 extern str ds_dest_uri_col;
00060 extern str ds_dest_flags_col;
00061 extern str ds_dest_priority_col;
00062 
00063 extern int ds_flags; 
00064 extern int ds_use_default;
00065 
00066 extern int_str dst_avp_name;
00067 extern unsigned short dst_avp_type;
00068 extern int_str grp_avp_name;
00069 extern unsigned short grp_avp_type;
00070 extern int_str cnt_avp_name;
00071 extern unsigned short cnt_avp_type;
00072 
00073 extern pv_elem_t * hash_param_model;
00074 
00075 extern str ds_setid_pvname;
00076 extern pv_spec_t ds_setid_pv;
00077 
00078 /* Structure containing pointers to TM-functions */
00079 struct tm_binds tmb;
00080 extern str ds_ping_method;
00081 extern str ds_ping_from;
00082 extern int probing_threshhold; /*!< number of failed requests,
00083                   before a destination is taken into probing */ 
00084 extern int ds_probing_mode;
00085 extern int ds_append_branch;
00086 
00087 int init_data(void);
00088 int init_ds_db(void);
00089 int ds_load_list(char *lfile);
00090 int ds_connect_db(void);
00091 void ds_disconnect_db(void);
00092 int ds_load_db(void);
00093 int ds_destroy_list(void);
00094 int ds_select_dst(struct sip_msg *msg, int set, int alg, int mode);
00095 int ds_next_dst(struct sip_msg *msg, int mode);
00096 int ds_set_state(int group, str *address, int state, int type);
00097 int ds_mark_dst(struct sip_msg *msg, int mode);
00098 int ds_print_list(FILE *fout);
00099 int ds_print_mi_list(struct mi_node* rpl);
00100 
00101 int ds_is_from_list(struct sip_msg *_m, int group);
00102 /*! \brief
00103  * Timer for checking inactive destinations
00104  */
00105 void ds_check_timer(unsigned int ticks, void* param);
00106 
00107 #endif
00108 

Generated on Tue May 22 16:00:26 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6