#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"

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 |
| 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] |
init module function
creating the pipes
Definition at line 198 of file jabber.c.
References cache_time, db_bind_mod(), DB_CAP_QUERY, DB_CAPABILITY, delay_time, find_export(), db_func::init, jaliases, jdomain, _str::len, LM_DBG, LM_ERR, LM_WARN, load_tm_api(), max_jobs, nrw, NULL, pipes, pkg_malloc, proxy, _str::s, shm_malloc(), sleep_time, tmb, db_func::use_table, xj_wlist_init(), and xj_wlist_set_aliases().
| 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().
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 xjab_check_workers | ( | int | mpid | ) |
check if all SER2Jab workers are still alive
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 | |||
| ) |
manage SIP message
skip 'sip:' and parameters in destination address
Definition at line 428 of file jabber.c.
References sip_msg::content_length, to_body::error, sip_msg::first_line, sip_msg::from, get_body(), get_content_length, _xj_jkey::hash, HDR_FROM_F, HDR_TO_F, _xj_jkey::id, _xj_sipmsg::jkey, _str::len, LM_DBG, LM_ERR, _xj_sipmsg::msg, sip_msg::new_uri, NULL, parse_content_type_hdr(), parse_from_header(), parse_headers(), hdr_field::parsed, msg_start::request, _str::s, shm_free, shm_malloc(), SUBTYPE_CPIM, SUBTYPE_PLAIN, _xj_sipmsg::to, sip_msg::to, _xj_sipmsg::type, TYPE_MESSAGE, TYPE_TEXT, msg_start::u, XJ_EXIT_JCONF, xj_extract_aor(), xj_get_hash(), XJ_GO_OFFLINE, XJ_GO_ONLINE, XJ_JOIN_JCONF, XJ_SEND_MESSAGE, xj_wlist_check(), xj_wlist_check_aliases(), and xj_wlist_get().
Referenced by xj_exit_jconf(), xj_go_offline(), xj_go_online(), xj_join_jconf(), and xj_send_message().
| int cache_time = 600 |
| int check_time = 20 |
cmd_export_t cmds[] [static] |
| int delay_time = 90 |
| struct module_exports exports |
db_func_t jabber_dbf [static] |
| char* jaddress = "127.0.0.1" |
| char* jaliases = NULL |
| char* jdomain = NULL |
| int jport = 5222 |
| int max_jobs = 10 |
| int nrw = 2 |
param_export_t params[] [static] |
| int** pipes = NULL |
| char* priority = "9" |
Definition at line 111 of file jabber.c.
Referenced by build_xmpp_content(), child_init(), do_query(), ds_load_db(), ds_load_list(), enum_pv_query_3(), reload_gws_and_lcrs(), run_proxy(), sip_msg_cloner(), sort_srvs(), and xjab_check_workers().
| char* proxy = NULL |
Definition at line 109 of file jabber.c.
Referenced by ac_sl_msg(), client_find_account(), conf_destroy(), fixup_phostport2proxy(), miniclient_start(), mod_init(), update_proxy(), uri2su(), and utils_forward().
| char* registrar = NULL |
| int sleep_time = 20 |
1.5.6