presence.c File Reference

Kamailio presence module. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include "../../db/db.h"
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../error.h"
#include "../../ut.h"
#include "../../parser/parse_to.h"
#include "../../parser/parse_uri.h"
#include "../../parser/parse_content.h"
#include "../../parser/parse_from.h"
#include "../../mem/mem.h"
#include "../../mem/shm_mem.h"
#include "../../usr_avp.h"
#include "../tm/tm_load.h"
#include "../sl/sl_api.h"
#include "../../pt.h"
#include "../../mi/mi.h"
#include "../pua/hash.h"
#include "publish.h"
#include "subscribe.h"
#include "event_list.h"
#include "bind_presence.h"
#include "notify.h"

Include dependency graph for presence.c:

Go to the source code of this file.

Defines

#define ACTWATCH_TABLE_VERSION   9
#define P_TABLE_VERSION   3
#define S_TABLE_VERSION   3

Functions

static int child_init (int)
static void destroy (void)
static int fixup_presence (void **param, int param_no)
static int fixup_subscribe (void **param, int param_no)
static int mi_child_init (void)
static struct mi_rootmi_cleanup (struct mi_root *cmd, void *param)
static struct mi_rootmi_refreshWatchers (struct mi_root *cmd, void *param)
 mi cmd: refreshWatchers <presentity_uri> <event> <refresh_type> // can be: = 0 -> watchers autentification type or != 0 -> publish type // *
static int mod_init (void)
int pres_db_delete_status (subs_t *s)
int pres_update_status (subs_t subs, str reason, db_key_t *query_cols, db_val_t *query_vals, int n_query_cols, subs_t **subs_array)
int stored_pres_info (struct sip_msg *msg, char *pres_uri, char *s)
static int update_pw_dialogs (subs_t *subs, unsigned int hash_code, subs_t **subs_array)
int update_watchers_status (str pres_uri, pres_ev_t *ev, str *rules_doc)

Variables

str active_watchers_table = str_init("active_watchers")
static int clean_period = 100
static cmd_export_t cmds []
int counter = 0
static int db_update_period = 100
str db_url = {0, 0}
evlist_tEvList = NULL
int expires_offset = 0
struct module_exports exports
int fallback2db = 0
int library_mode = 0
char * log_buf = NULL
int max_expires = 3600
static mi_export_t mi_cmds []
db_con_tpa_db = NULL
db_func_t pa_dbf
static param_export_t params []
int phtable_size = 9
int pid = 0
char prefix = 'a'
phtable_tpres_htable
str presentity_table = str_init("presentity")
str server_address = {0, 0}
int shtable_size = 9
struct sl_binds slb
int sphere_enable = 0
int startup_time = 0
shtable_t subs_htable = NULL
struct tm_binds tmb
char * to_tag_pref = "10"
str watchers_table = str_init("watchers")


Detailed Description

Kamailio presence module.

Definition in file presence.c.


Define Documentation

#define ACTWATCH_TABLE_VERSION   9

Definition at line 81 of file presence.c.

Referenced by mod_init().

#define P_TABLE_VERSION   3

Definition at line 80 of file presence.c.

Referenced by mod_init().

#define S_TABLE_VERSION   3

Definition at line 79 of file presence.c.


Function Documentation

static int child_init ( int  rank  )  [static]

Initialize children

Definition at line 341 of file presence.c.

References db_func::init, library_mode, LM_CRIT, LM_DBG, LM_ERR, my_pid(), pid, and db_func::use_table.

static void destroy ( void   )  [static]

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

Definition at line 444 of file presence.c.

References E_UNSPEC, _str::len, library_mode, LM_ERR, pv_parse_format(), _str::s, and s.

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

Definition at line 474 of file presence.c.

References library_mode, and LM_ERR.

static int mi_child_init ( void   )  [static]

Definition at line 384 of file presence.c.

References db_func::init, library_mode, LM_CRIT, LM_DBG, LM_ERR, and db_func::use_table.

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

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

mi cmd: refreshWatchers <presentity_uri> <event> <refresh_type> // can be: = 0 -> watchers autentification type or != 0 -> publish type // *

Definition at line 494 of file presence.c.

References contains_event(), sip_uri::host, init_mi_tree(), mi_node::kids, _str::len, LM_DBG, LM_ERR, mi_node::next, mi_root::node, NULL, parse_uri(), pkg_free, query_db_notify(), s, _str::s, str2int(), update_watchers_status(), sip_uri::user, and mi_node::value.

static int mod_init ( void   )  [static]

int pres_db_delete_status ( subs_t s  ) 

int pres_update_status ( subs_t  subs,
str  reason,
db_key_t query_cols,
db_val_t query_vals,
int  n_query_cols,
subs_t **  subs_array 
)

int stored_pres_info ( struct sip_msg msg,
char *  pres_uri,
char *  s 
)

static int update_pw_dialogs ( subs_t subs,
unsigned int  hash_code,
subs_t **  subs_array 
) [static]

int update_watchers_status ( str  pres_uri,
pres_ev_t ev,
str rules_doc 
)


Variable Documentation

str active_watchers_table = str_init("active_watchers")

int clean_period = 100 [static]

Definition at line 84 of file presence.c.

Referenced by mod_init().

cmd_export_t cmds[] [static]

Definition at line 135 of file presence.c.

int counter = 0

int db_update_period = 100 [static]

Definition at line 85 of file presence.c.

str db_url = {0, 0}

Definition at line 124 of file presence.c.

evlist_t* EvList = NULL

int expires_offset = 0

Definition at line 125 of file presence.c.

Referenced by mod_init(), and publ_send200ok().

module exports

Definition at line 169 of file presence.c.

int fallback2db = 0

int library_mode = 0

Definition at line 94 of file presence.c.

Referenced by child_init(), fixup_presence(), fixup_subscribe(), mi_child_init(), and mod_init().

char* log_buf = NULL

Definition at line 83 of file presence.c.

Referenced by mod_init(), xdbg(), xlog_1(), and xlog_2().

int max_expires = 3600

mi_export_t mi_cmds[] [static]

Initial value:

 {
   { "refreshWatchers", mi_refreshWatchers,    0,  0,  mi_child_init},
   { "cleanup",         mi_cleanup,            0,  0,  mi_child_init},
   {  0,                0,                     0,  0,  0}
}

Definition at line 162 of file presence.c.

db_con_t* pa_db = NULL

param_export_t params[] [static]

Definition at line 144 of file presence.c.

int phtable_size = 9

int pid = 0

char prefix = 'a'

pstn prefix

Definition at line 122 of file presence.c.

Definition at line 133 of file presence.c.

str presentity_table = str_init("presentity")

str server_address = {0, 0}

Definition at line 95 of file presence.c.

Referenced by bla_cb(), handle_subscribe(), request_winfo(), and rls_handle_subscribe().

int shtable_size = 9

struct sl_binds slb

SL binds

Definition at line 104 of file presence.c.

int sphere_enable = 0

int startup_time = 0

Definition at line 123 of file presence.c.

Referenced by generate_ETag(), and mod_init().

struct tm_binds tmb

TM bind

Definition at line 102 of file presence.c.

char* to_tag_pref = "10"

Definition at line 99 of file presence.c.

Referenced by mod_init().

str watchers_table = str_init("watchers")


Generated on Thu May 24 08:01:15 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6