rls.c File Reference

#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 "../../pt.h"
#include "../../db/db.h"
#include "../../sr_module.h"
#include "../../dprint.h"
#include "../../error.h"
#include "../../ut.h"
#include "../../mem/mem.h"
#include "../../mem/shm_mem.h"
#include "../tm/tm_load.h"
#include "../sl/sl_api.h"
#include "../presence/bind_presence.h"
#include "../presence/hash.h"
#include "../pua/pua_bind.h"
#include "../pua/pidf.h"
#include "../xcap_client/xcap_functions.h"
#include "rls.h"
#include "notify.h"
#include "resource_notify.h"

Include dependency graph for rls.c:

Go to the source code of this file.

Defines

#define P_TABLE_VERSION   0
#define W_TABLE_VERSION   1

Functions

int add_rls_event (modparam_t type, void *val)
static int child_init (int)
void destroy (void)
int handle_expired_record (subs_t *s)
static int mod_init (void)
int rls_handle_subscribe (struct sip_msg *, char *, char *)
int rls_restore_db_subs (void)
int rlsubs_table_restore ()
void rlsubs_table_update (unsigned int ticks, void *param)

Variables

int clean_period = 100
static cmd_export_t cmds []
str db_url = str_init(DEFAULT_DB_URL)
struct module_exports exports
int hash_size = 512
static param_export_t params []
int pid
contains_event_t pres_contains_event
mem_copy_subs_t pres_copy_subs
delete_shtable_t pres_delete_shtable
destroy_shtable_t pres_destroy_shtable
extract_sdialog_info_t pres_extract_sdialog_info
get_event_list_t pres_get_ev_list
insert_shtable_t pres_insert_shtable
new_shtable_t pres_new_shtable
search_event_t pres_search_event
search_shtable_t pres_search_shtable
update_db_subs_t pres_update_db_subs
update_shtable_t pres_update_shtable
get_record_id_t pua_get_record_id
send_subscribe_t pua_send_subscribe
str rlpres_table = str_init("rls_presentity")
db_con_trls_db = NULL
db_func_t rls_dbf
int rls_events = EVENT_PRESENCE
int rls_integrated_xcap_server = 0
int rls_max_expires = 7200
shtable_t rls_table
str rls_xcap_table = str_init("xcap")
str rlsubs_table = str_init("rls_watchers")
str server_address = {0, 0}
struct sl_binds slb
str str_auth_state_col = str_init("auth_state")
str str_callid_col = str_init("callid")
str str_contact_col = str_init("contact")
str str_content_type_col = str_init("content_type")
str str_doc_col = str_init("doc")
str str_doc_type_col = str_init("doc_type")
str str_domain_col = str_init("domain")
str str_etag_col = str_init("etag")
str str_event_col = str_init("event")
str str_event_id_col = str_init("event_id")
str str_expires_col = str_init("expires")
str str_from_tag_col = str_init("from_tag")
str str_local_contact_col = str_init("local_contact")
str str_local_cseq_col = str_init("local_cseq")
str str_presence_state_col = str_init("presence_state")
str str_presentity_uri_col = str_init("presentity_uri")
str str_reason_col = str_init("reason")
str str_record_route_col = str_init("record_route")
str str_remote_cseq_col = str_init("remote_cseq")
str str_resource_uri_col = str_init("resource_uri")
str str_rlsubs_did_col = str_init("rlsubs_did")
str str_socket_info_col = str_init("socket_info")
str str_status_col = str_init("status")
str str_to_domain_col = str_init("to_domain")
str str_to_tag_col = str_init("to_tag")
str str_to_user_col = str_init("to_user")
str str_updated_col = str_init("updated")
str str_username_col = str_init("username")
str str_version_col = str_init("version")
str str_watcher_domain_col = str_init("watcher_domain")
str str_watcher_username_col = str_init("watcher_username")
struct tm_binds tmb
int to_presence_code = 1
int waitn_time = 10
xcapGetNewDoc_t xcap_GetNewDoc = 0
unsigned int xcap_port = 8000
char * xcap_root
xmlDocGetNodeByName_t XMLDocGetNodeByName
xmlNodeGetAttrContentByName_t XMLNodeGetAttrContentByName
xmlNodeGetNodeByName_t XMLNodeGetNodeByName
xmlNodeGetNodeContentByName_t XMLNodeGetNodeContentByName


Define Documentation

#define P_TABLE_VERSION   0

Definition at line 59 of file rls.c.

#define W_TABLE_VERSION   1

Definition at line 60 of file rls.c.

Referenced by mod_init().


Function Documentation

int add_rls_event ( modparam_t  type,
void *  val 
)

Definition at line 709 of file rls.c.

References EVENT_OTHER, event_parser(), LM_ERR, event::parsed, and rls_events.

static int child_init ( int  rank  )  [static]

Initialize children

Definition at line 454 of file rls.c.

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

void destroy ( void   ) 

int handle_expired_record ( subs_t s  ) 

Definition at line 506 of file rls.c.

References LM_ERR, NULL, and rls_send_notify().

Referenced by rlsubs_table_update().

static int mod_init ( void   )  [static]

module functions

init module function

Definition at line 207 of file rls.c.

References bind_presence(), bind_pua(), bind_xcap(), clean_period, db_func::close, presence_api::contains_event, db_bind_mod(), DB_CAP_ALL, DB_CAPABILITY, db_check_table_version(), presence_api::delete_shtable, presence_api::destroy_shtable, presence_api::extract_sdialog_info, find_export(), presence_api::get_event_list, pua_api::get_record_id, xcap_api::getNewDoc, hash_size, db_func::init, presence_api::insert_shtable, _str::len, LM_DBG, LM_ERR, load_sl_api(), load_tm_api(), presence_api::mem_copy_subs, presence_api::new_shtable, NULL, P_TABLE_VERSION, pres_contains_event, pres_copy_subs, pres_delete_shtable, pres_destroy_shtable, pres_extract_sdialog_info, pres_get_ev_list, pres_insert_shtable, pres_new_shtable, pres_search_event, pres_search_shtable, pres_update_db_subs, pres_update_shtable, pua, pua_get_record_id, pua_send_subscribe, register_timer(), rls_integrated_xcap_server, rls_presentity_clean(), rls_restore_db_subs(), rlsubs_table_update(), _str::s, presence_api::search_event, presence_api::search_shtable, pua_api::send_subscribe, slb, str2int(), timer_send_notify(), tmb, presence_api::update_db_subs, presence_api::update_shtable, W_TABLE_VERSION, waitn_time, xcap_GetNewDoc, xcap_port, xcap_root, libxml_api::xmlDocGetNodeByName, XMLDocGetNodeByName, libxml_api::xmlNodeGetAttrContentByName, XMLNodeGetAttrContentByName, libxml_api::xmlNodeGetNodeByName, XMLNodeGetNodeByName, libxml_api::xmlNodeGetNodeContentByName, XMLNodeGetNodeContentByName, and ZSW.

int rls_handle_subscribe ( struct sip_msg ,
char *  ,
char *   
)

Definition at line 330 of file rls/subscribe.c.

int rls_restore_db_subs ( void   ) 

int rlsubs_table_restore (  ) 

void rlsubs_table_update ( unsigned int  ticks,
void *  param 
)

Definition at line 518 of file rls.c.

References handle_expired_record(), hash_size, LM_ERR, NULL, pres_update_db_subs, and db_func::use_table.

Referenced by mod_init().


Variable Documentation

int clean_period = 100

Definition at line 80 of file rls.c.

cmd_export_t cmds[] [static]

Definition at line 161 of file rls.c.

str db_url = str_init(DEFAULT_DB_URL)

Definition at line 73 of file rls.c.

module exports

Definition at line 189 of file rls.c.

int hash_size = 512

param_export_t params[] [static]

Definition at line 170 of file rls.c.

int pid

Definition at line 76 of file rls.c.

Definition at line 77 of file rls.c.

Referenced by mod_init(), and rls_restore_db_subs().

Definition at line 99 of file rls.c.

Referenced by mod_init(), and timer_send_notify().

Definition at line 97 of file rls.c.

Referenced by mod_init(), and rls_notify_callback().

Definition at line 98 of file rls.c.

Referenced by mod_init().

Definition at line 101 of file rls.c.

Referenced by mod_init(), and rls_handle_subscribe().

Definition at line 79 of file rls.c.

Referenced by mod_init(), and reply_489().

Definition at line 94 of file rls.c.

Referenced by mod_init(), rls_handle_subscribe(), and rls_restore_db_subs().

Definition at line 93 of file rls.c.

Referenced by mod_init().

Definition at line 78 of file rls.c.

Referenced by mod_init(), and rls_handle_subscribe().

Definition at line 95 of file rls.c.

Referenced by mod_init(), rls_handle_subscribe(), timer_send_notify(), and update_rlsubs().

Definition at line 100 of file rls.c.

Referenced by mod_init(), and rlsubs_table_update().

Definition at line 96 of file rls.c.

Referenced by agg_body_sendn_update(), and mod_init().

Definition at line 111 of file rls.c.

Referenced by mod_init(), and rls_handle_notify().

Definition at line 110 of file rls.c.

str rlpres_table = str_init("rls_presentity")

Definition at line 70 of file rls.c.

Referenced by rls_handle_notify(), rls_presentity_clean(), send_full_notify(), and timer_send_notify().

db_con_t* rls_db = NULL

int rls_events = EVENT_PRESENCE

Definition at line 102 of file rls.c.

Referenced by add_rls_event(), and rls_handle_subscribe().

Definition at line 84 of file rls.c.

Referenced by get_resource_list(), and mod_init().

int rls_max_expires = 7200

Definition at line 104 of file rls.c.

Referenced by rls_handle_subscribe().

str rls_xcap_table = str_init("xcap")

Definition at line 71 of file rls.c.

Referenced by get_resource_list().

str rlsubs_table = str_init("rls_watchers")

Definition at line 69 of file rls.c.

Referenced by rls_notify_callback().

str server_address = {0, 0}

modules variables

Definition at line 67 of file rls.c.

struct sl_binds slb

SL binds

Definition at line 116 of file rls.c.

str str_auth_state_col = str_init("auth_state")

Definition at line 121 of file rls.c.

Referenced by rls_handle_notify(), send_full_notify(), and timer_send_notify().

str str_callid_col = str_init("callid")

Definition at line 133 of file rls.c.

str str_contact_col = str_init("contact")

Definition at line 140 of file rls.c.

str str_content_type_col = str_init("content_type")

Definition at line 123 of file rls.c.

Referenced by rls_handle_notify(), send_full_notify(), and timer_send_notify().

str str_doc_col = str_init("doc")

Definition at line 148 of file rls.c.

Referenced by get_resource_list(), and xcapGetNewDoc().

str str_doc_type_col = str_init("doc_type")

Definition at line 146 of file rls.c.

Referenced by get_resource_list(), and xcapGetNewDoc().

str str_domain_col = str_init("domain")

Definition at line 145 of file rls.c.

str str_etag_col = str_init("etag")

Definition at line 147 of file rls.c.

str str_event_col = str_init("event")

Definition at line 127 of file rls.c.

str str_event_id_col = str_init("event_id")

Definition at line 128 of file rls.c.

str str_expires_col = str_init("expires")

Definition at line 125 of file rls.c.

str str_from_tag_col = str_init("from_tag")

Definition at line 135 of file rls.c.

str str_local_contact_col = str_init("local_contact")

Definition at line 141 of file rls.c.

str str_local_cseq_col = str_init("local_cseq")

Definition at line 136 of file rls.c.

str str_presence_state_col = str_init("presence_state")

Definition at line 124 of file rls.c.

Referenced by rls_handle_notify(), send_full_notify(), and timer_send_notify().

str str_presentity_uri_col = str_init("presentity_uri")

Definition at line 126 of file rls.c.

str str_reason_col = str_init("reason")

Definition at line 122 of file rls.c.

str str_record_route_col = str_init("record_route")

Definition at line 138 of file rls.c.

str str_remote_cseq_col = str_init("remote_cseq")

Definition at line 137 of file rls.c.

str str_resource_uri_col = str_init("resource_uri")

Definition at line 119 of file rls.c.

Referenced by rls_handle_notify(), send_full_notify(), and timer_send_notify().

str str_rlsubs_did_col = str_init("rlsubs_did")

Definition at line 118 of file rls.c.

Referenced by rls_handle_notify(), send_full_notify(), and timer_send_notify().

str str_socket_info_col = str_init("socket_info")

Definition at line 139 of file rls.c.

str str_status_col = str_init("status")

Definition at line 143 of file rls.c.

str str_to_domain_col = str_init("to_domain")

Definition at line 130 of file rls.c.

str str_to_tag_col = str_init("to_tag")

Definition at line 134 of file rls.c.

str str_to_user_col = str_init("to_user")

Definition at line 129 of file rls.c.

str str_updated_col = str_init("updated")

Definition at line 120 of file rls.c.

Referenced by rls_handle_notify(), send_full_notify(), and timer_send_notify().

str str_username_col = str_init("username")

Definition at line 144 of file rls.c.

str str_version_col = str_init("version")

Definition at line 142 of file rls.c.

str str_watcher_domain_col = str_init("watcher_domain")

Definition at line 132 of file rls.c.

str str_watcher_username_col = str_init("watcher_username")

Definition at line 131 of file rls.c.

struct tm_binds tmb

TM bind

Definition at line 114 of file rls.c.

Definition at line 103 of file rls.c.

Referenced by rls_handle_subscribe().

int waitn_time = 10

Definition at line 68 of file rls.c.

Referenced by mod_init().

Definition at line 107 of file rls.c.

unsigned int xcap_port = 8000

Definition at line 82 of file rls.c.

Referenced by get_resource_list(), mod_init(), and refreshXcapDoc().

char* xcap_root

Definition at line 81 of file rls.c.

Referenced by get_resource_list(), and mod_init().

libxml api

Definition at line 87 of file rls.c.

Definition at line 90 of file rls.c.

Definition at line 88 of file rls.c.

Definition at line 89 of file rls.c.


Generated on Thu May 24 12:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6