dispatcher.c File Reference

Dispatcher :: Dispatch. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include "../../mi/mi.h"
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../error.h"
#include "../../ut.h"
#include "../../route.h"
#include "../../mem/mem.h"
#include "../../mod_fix.h"
#include "dispatch.h"

Include dependency graph for dispatcher.c:

Go to the source code of this file.

Defines

#define DS_DEST_FLAGS_COL   "flags"
#define DS_DEST_PRIORITY_COL   "priority"
#define DS_DEST_URI_COL   "destination"
#define DS_SET_ID_COL   "setid"
#define DS_TABLE_NAME   "dispatcher"
#define MI_ERR_RELOAD   "ERROR Reloading data"
#define MI_ERR_RELOAD_LEN   (sizeof(MI_ERR_RELOAD)-1)
#define MI_NOT_SUPPORTED   "DB mode not configured"
#define MI_NOT_SUPPORTED_LEN   (sizeof(MI_NOT_SUPPORTED)-1)

Functions

static int child_init (int rank)
 Initialize children.
static void destroy (void)
 destroy function
static struct mi_rootds_mi_list (struct mi_root *cmd, void *param)
static struct mi_rootds_mi_reload (struct mi_root *cmd_tree, void *param)
static struct mi_rootds_mi_set (struct mi_root *cmd, void *param)
static int ds_warn_fixup (void **param, int param_no)
static int mi_child_init (void)
static int mod_init (void)
static int w_ds_is_from_list0 (struct sip_msg *, char *, char *)
static int w_ds_is_from_list1 (struct sip_msg *, char *, char *)
static int w_ds_mark_dst0 (struct sip_msg *, char *, char *)
static int w_ds_mark_dst1 (struct sip_msg *, char *, char *)
static int w_ds_next_domain (struct sip_msg *, char *, char *)
static int w_ds_next_dst (struct sip_msg *, char *, char *)
static int w_ds_select_domain (struct sip_msg *, char *, char *)
static int w_ds_select_dst (struct sip_msg *, char *, char *)

Variables

static cmd_export_t cmds []
int_str cnt_avp_name
static str cnt_avp_param = {NULL, 0}
unsigned short cnt_avp_type
int ds_append_branch = 1
str ds_db_url = {NULL, 0}
str ds_dest_flags_col = str_init(DS_DEST_FLAGS_COL)
str ds_dest_priority_col = str_init(DS_DEST_PRIORITY_COL)
str ds_dest_uri_col = str_init(DS_DEST_URI_COL)
int ds_flags = 0
int ds_force_dst = 0
str ds_ping_from = {"sip:dispatcher@localhost", 24}
static int ds_ping_interval = 0
str ds_ping_method = {"OPTIONS",7}
int ds_probing_mode = 0
str ds_set_id_col = str_init(DS_SET_ID_COL)
pv_spec_t ds_setid_pv
str ds_setid_pvname = {NULL, 0}
str ds_table_name = str_init(DS_TABLE_NAME)
int ds_use_default = 0
char * dslistfile = CFG_DIR"dispatcher.list"
int_str dst_avp_name
static str dst_avp_param = {NULL, 0}
unsigned short dst_avp_type
struct module_exports exports
int_str grp_avp_name
static str grp_avp_param = {NULL, 0}
unsigned short grp_avp_type
pv_elem_thash_param_model = NULL
str hash_pvar_param = {NULL, 0}
static mi_export_t mi_cmds []
static param_export_t params []
int probing_threshhold = 3


Detailed Description

Dispatcher :: Dispatch.

Id
dispatcher.c 5456 2009-01-14 11:52:18Z miconda

dispatcher module -- stateless load balancing

Copyright (C) 2004-2005 FhG Fokus Copyright (C) 2006 Voice Sistem SRL

This file is part of Kamailio, a free SIP server.

Kamailio 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

Kamailio 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

History ------- 2004-07-31 first version, by daniel 2007-01-11 Added a function to check if a specific gateway is in a group (carsten - Carsten Bock, BASIS AudioNet GmbH) 2007-02-09 Added active probing of failed destinations and automatic re-enabling of destinations (carsten) 2007-05-08 Ported the changes to SVN-Trunk and renamed ds_is_domain to ds_is_from_list. (carsten) 2007-07-18 Added support for load/reload groups from DB reload triggered from ds_reload MI_Command (ancuta)

Definition in file dispatcher.c.


Define Documentation

#define DS_DEST_FLAGS_COL   "flags"

Definition at line 72 of file dispatcher.c.

#define DS_DEST_PRIORITY_COL   "priority"

Definition at line 73 of file dispatcher.c.

#define DS_DEST_URI_COL   "destination"

Definition at line 71 of file dispatcher.c.

#define DS_SET_ID_COL   "setid"

Definition at line 70 of file dispatcher.c.

#define DS_TABLE_NAME   "dispatcher"

Definition at line 74 of file dispatcher.c.

#define MI_ERR_RELOAD   "ERROR Reloading data"

Definition at line 559 of file dispatcher.c.

Referenced by ds_mi_reload().

#define MI_ERR_RELOAD_LEN   (sizeof(MI_ERR_RELOAD)-1)

Definition at line 560 of file dispatcher.c.

Referenced by ds_mi_reload().

#define MI_NOT_SUPPORTED   "DB mode not configured"

Definition at line 561 of file dispatcher.c.

#define MI_NOT_SUPPORTED_LEN   (sizeof(MI_NOT_SUPPORTED)-1)

Definition at line 562 of file dispatcher.c.


Function Documentation

static int child_init ( int  rank  )  [static]

Initialize children.

Definition at line 359 of file dispatcher.c.

static void destroy ( void   )  [static]

destroy function

Definition at line 378 of file dispatcher.c.

References ds_destroy_list(), ds_disconnect_db(), and _str::s.

static struct mi_root * ds_mi_list ( struct mi_root cmd,
void *  param 
) [static, read]

static struct mi_root * ds_mi_reload ( struct mi_root cmd_tree,
void *  param 
) [static, read]

static struct mi_root * ds_mi_set ( struct mi_root cmd,
void *  param 
) [static, read]

static int ds_warn_fixup ( void **  param,
int  param_no 
) [static]

Definition at line 468 of file dispatcher.c.

References LM_ERR, and _str::s.

static int mi_child_init ( void   )  [static]

Definition at line 366 of file dispatcher.c.

References ds_connect_db(), and _str::s.

static int mod_init ( void   )  [static]

static int w_ds_is_from_list0 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 577 of file dispatcher.c.

References ds_is_from_list().

static int w_ds_is_from_list1 ( struct sip_msg msg,
char *  set,
char *  str2 
) [static]

Definition at line 583 of file dispatcher.c.

References ds_is_from_list().

static int w_ds_mark_dst0 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 450 of file dispatcher.c.

References ds_mark_dst().

static int w_ds_mark_dst1 ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 458 of file dispatcher.c.

References ds_mark_dst().

static int w_ds_next_domain ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 442 of file dispatcher.c.

References ds_next_dst().

static int w_ds_next_dst ( struct sip_msg msg,
char *  str1,
char *  str2 
) [static]

Definition at line 434 of file dispatcher.c.

References ds_next_dst().

static int w_ds_select_domain ( struct sip_msg msg,
char *  set,
char *  alg 
) [static]

Definition at line 411 of file dispatcher.c.

References ds_select_dst(), fixup_get_ivalue(), LM_ERR, NULL, and s.

static int w_ds_select_dst ( struct sip_msg msg,
char *  set,
char *  alg 
) [static]

Definition at line 388 of file dispatcher.c.

References ds_select_dst(), fixup_get_ivalue(), LM_ERR, NULL, and s.


Variable Documentation

cmd_export_t cmds[] [static]

Definition at line 137 of file dispatcher.c.

Definition at line 90 of file dispatcher.c.

Referenced by ds_select_dst().

str cnt_avp_param = {NULL, 0} [static]

Definition at line 83 of file dispatcher.c.

unsigned short cnt_avp_type

Definition at line 91 of file dispatcher.c.

Referenced by ds_select_dst(), and mod_init().

Definition at line 101 of file dispatcher.c.

Referenced by ds_update_dst().

str ds_db_url = {NULL, 0}

Definition at line 104 of file dispatcher.c.

Referenced by ds_connect_db(), and init_ds_db().

str ds_dest_flags_col = str_init(DS_DEST_FLAGS_COL)

Definition at line 107 of file dispatcher.c.

Referenced by ds_load_db().

str ds_dest_priority_col = str_init(DS_DEST_PRIORITY_COL)

Definition at line 108 of file dispatcher.c.

Referenced by ds_load_db().

str ds_dest_uri_col = str_init(DS_DEST_URI_COL)

Definition at line 106 of file dispatcher.c.

Referenced by ds_load_db().

int ds_flags = 0

int ds_force_dst = 0

Definition at line 78 of file dispatcher.c.

Referenced by ds_select_dst().

str ds_ping_from = {"sip:dispatcher@localhost", 24}

Definition at line 98 of file dispatcher.c.

Referenced by ds_check_timer().

int ds_ping_interval = 0 [static]

Definition at line 99 of file dispatcher.c.

Referenced by mod_init().

str ds_ping_method = {"OPTIONS",7}

Definition at line 97 of file dispatcher.c.

Referenced by ds_check_timer().

int ds_probing_mode = 0

Definition at line 100 of file dispatcher.c.

Referenced by ds_check_timer(), and ds_options_callback().

str ds_set_id_col = str_init(DS_SET_ID_COL)

Definition at line 105 of file dispatcher.c.

Referenced by ds_load_db().

Definition at line 112 of file dispatcher.c.

Referenced by ds_is_from_list().

str ds_setid_pvname = {NULL, 0}

Definition at line 111 of file dispatcher.c.

Referenced by ds_is_from_list().

str ds_table_name = str_init(DS_TABLE_NAME)

Definition at line 109 of file dispatcher.c.

Referenced by ds_load_db(), and init_ds_db().

int ds_use_default = 0

Definition at line 80 of file dispatcher.c.

Referenced by ds_select_dst().

char* dslistfile = CFG_DIR"dispatcher.list"

parameters

Definition at line 77 of file dispatcher.c.

Referenced by ds_mi_reload(), and mod_init().

str dst_avp_param = {NULL, 0} [static]

Definition at line 81 of file dispatcher.c.

unsigned short dst_avp_type

module exports

Definition at line 185 of file dispatcher.c.

Definition at line 88 of file dispatcher.c.

Referenced by ds_mark_dst(), and ds_select_dst().

str grp_avp_param = {NULL, 0} [static]

Definition at line 82 of file dispatcher.c.

unsigned short grp_avp_type

Definition at line 89 of file dispatcher.c.

Referenced by ds_mark_dst(), ds_select_dst(), and mod_init().

Definition at line 93 of file dispatcher.c.

Referenced by ds_hash_pvar().

str hash_pvar_param = {NULL, 0}

Definition at line 84 of file dispatcher.c.

mi_export_t mi_cmds[] [static]

Definition at line 176 of file dispatcher.c.

param_export_t params[] [static]

Definition at line 150 of file dispatcher.c.

number of failed requests, before a destination is taken into probing

Definition at line 95 of file dispatcher.c.

Referenced by ds_print_list(), and ds_set_state().


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