jabber.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/ipc.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include "../../sr_module.h"
#include "../../error.h"
#include "../../ut.h"
#include "../../mem/shm_mem.h"
#include "../../mem/mem.h"
#include "../../globals.h"
#include "../../timer.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parse_content.h"
#include "../../parser/parse_from.h"
#include "../../db/db.h"
#include "../tm/tm_load.h"
#include "xjab_load.h"
#include "xjab_worker.h"
#include "xjab_util.h"

Include dependency graph for jabber.c:

Go to the source code of this file.

Functions

static int child_init (int rank)
void destroy (void)
static int mod_init (void)
static int xj_exit_jconf (struct sip_msg *, char *, char *)
static int xj_go_offline (struct sip_msg *, char *, char *)
static int xj_go_online (struct sip_msg *, char *, char *)
static int xj_join_jconf (struct sip_msg *, char *, char *)
void xj_register_watcher (str *from, str *to, void *cbf, void *pp)
static int xj_send_message (struct sip_msg *, char *, char *)
void xj_unregister_watcher (str *from, str *to, void *cbf, void *pp)
void xjab_check_workers (int mpid)
int xjab_manage_sipmsg (struct sip_msg *msg, int type)

Variables

int cache_time = 600
int check_time = 20
static cmd_export_t cmds []
static db_con_t ** db_con
static str db_table = str_init("jusers")
static str db_url = str_init("mysql://root@127.0.0.1/sip_jab")
int delay_time = 90
struct module_exports exports
static db_func_t jabber_dbf
char * jaddress = "127.0.0.1"
char * jaliases = NULL
char * jdomain = NULL
int jport = 5222
xj_wlist jwl = NULL
int max_jobs = 10
int nrw = 2
static param_export_t params []
int ** pipes = NULL
char * priority = "9"
char * proxy = NULL
char * registrar = NULL
int sleep_time = 20
MODULE_VERSION struct tm_binds tmb


Function Documentation

static int child_init ( int  rank  )  [static]

launching the workers

Definition at line 317 of file jabber.c.

References check_time, jaddress, jport, LM_DBG, LM_ERR, nrw, NULL, pipes, priority, xj_wlist_set_pid(), xj_worker_process(), and xjab_check_workers().

void destroy ( void   ) 

destroy function of module

static int mod_init ( void   )  [static]

static int xj_exit_jconf ( struct sip_msg msg,
char *  foo1,
char *  foo2 
) [static]

exit from Jabber conference

Definition at line 401 of file jabber.c.

References LM_DBG, XJ_EXIT_JCONF, and xjab_manage_sipmsg().

static int xj_go_offline ( struct sip_msg msg,
char *  foo1,
char *  foo2 
) [static]

go offline in Jabber network

Definition at line 419 of file jabber.c.

References LM_DBG, XJ_GO_OFFLINE, and xjab_manage_sipmsg().

static int xj_go_online ( struct sip_msg msg,
char *  foo1,
char *  foo2 
) [static]

go online in Jabber network

Definition at line 410 of file jabber.c.

References LM_DBG, XJ_GO_ONLINE, and xjab_manage_sipmsg().

static int xj_join_jconf ( struct sip_msg msg,
char *  foo1,
char *  foo2 
) [static]

join a Jabber conference

Definition at line 392 of file jabber.c.

References LM_DBG, XJ_JOIN_JCONF, and xjab_manage_sipmsg().

void xj_register_watcher ( str from,
str to,
void *  cbf,
void *  pp 
)

register a watcher function for a Jabber user' presence

skip 'sip:' and parameters in destination address

Definition at line 694 of file jabber.c.

References _xj_sipmsg::cbf, to_body::error, _xj_jkey::hash, _xj_jkey::id, _xj_sipmsg::jkey, _str::len, LM_DBG, LM_ERR, _xj_sipmsg::msg, NULL, _xj_sipmsg::p, _str::s, shm_free, shm_malloc(), _xj_sipmsg::to, _xj_sipmsg::type, xj_extract_aor(), xj_get_hash(), XJ_REG_WATCHER, and xj_wlist_get().

static int xj_send_message ( struct sip_msg msg,
char *  foo1,
char *  foo2 
) [static]

send the SIP MESSAGE through Jabber

Definition at line 383 of file jabber.c.

References LM_DBG, XJ_SEND_MESSAGE, and xjab_manage_sipmsg().

void xj_unregister_watcher ( str from,
str to,
void *  cbf,
void *  pp 
)

unregister a watcher for a Jabber user' presence

Definition at line 786 of file jabber.c.

void xjab_check_workers ( int  mpid  ) 

check if all SER2Jab workers are still alive

  • if not, try to launch new ones

Definition at line 796 of file jabber.c.

References jaddress, jport, _xj_wlist::len, LM_DBG, LM_ERR, _xj_worker::pid, priority, _xj_wlist::workers, xj_wlist_clean_jobs(), xj_wlist_set_pid(), and xj_worker_process().

Referenced by child_init().

int xjab_manage_sipmsg ( struct sip_msg msg,
int  type 
)


Variable Documentation

int cache_time = 600

Definition at line 115 of file jabber.c.

Referenced by mod_init().

int check_time = 20

Definition at line 116 of file jabber.c.

Referenced by child_init().

cmd_export_t cmds[] [static]

Definition at line 137 of file jabber.c.

db_con_t** db_con [static]

Structure that represents database connection

Definition at line 92 of file jabber.c.

str db_table = str_init("jusers") [static]

Definition at line 98 of file jabber.c.

str db_url = str_init("mysql://root@127.0.0.1/sip_jab") [static]

parameters

Definition at line 97 of file jabber.c.

int delay_time = 90

Definition at line 113 of file jabber.c.

Referenced by mod_init().

Definition at line 180 of file jabber.c.

Definition at line 93 of file jabber.c.

char* jaddress = "127.0.0.1"

Definition at line 104 of file jabber.c.

Referenced by child_init(), and xjab_check_workers().

char* jaliases = NULL

Definition at line 107 of file jabber.c.

Referenced by mod_init().

char* jdomain = NULL

Definition at line 108 of file jabber.c.

Referenced by mod_init().

int jport = 5222

Definition at line 105 of file jabber.c.

Referenced by child_init(), and xjab_check_workers().

xj_wlist jwl = NULL

workers list

Definition at line 89 of file jabber.c.

Referenced by xj_wlist_init().

int max_jobs = 10

Definition at line 102 of file jabber.c.

Referenced by mod_init().

int nrw = 2

Definition at line 101 of file jabber.c.

Referenced by child_init(), and mod_init().

param_export_t params[] [static]

Definition at line 161 of file jabber.c.

int** pipes = NULL

Definition at line 118 of file jabber.c.

Referenced by child_init(), and mod_init().

char* priority = "9"

char* proxy = NULL

char* registrar = NULL

Definition at line 99 of file jabber.c.

Referenced by xj_worker_process().

int sleep_time = 20

Definition at line 114 of file jabber.c.

Referenced by mod_init().

MODULE_VERSION struct tm_binds tmb

TM bind

Definition at line 76 of file jabber.c.


Generated on Wed May 23 08:01:16 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6