#include "../../str.h"
#include "../../db/db.h"
#include "event_list.h"
#include "hash.h"
#include "event_list.h"


Go to the source code of this file.
Data Structures | |
| struct | subscription |
Defines | |
| #define | ACTIVE_STATUS 1 |
| #define | PENDING_STATUS 2 |
| #define | TERMINATED_STATUS 3 |
| #define | WAITING_STATUS 4 |
Typedefs | |
| typedef int(* | extract_sdialog_info_t )(subs_t *subs, struct sip_msg *msg, int max_expire, int *to_tag_gen, str scontact) |
| typedef int(* | handle_expired_func_t )(subs_t *) |
| typedef int(* | refresh_watcher_t )(str *, str *, str *, int, str *) |
| typedef struct subscription | subs_t |
| typedef void(* | update_db_subs_t )(db_con_t *, db_func_t, shtable_t, int, int, handle_expired_func_t) |
Functions | |
| int | delete_db_subs (str pres_uri, str ev_stored_name, str to_tag) |
| int | extract_sdialog_info (subs_t *subs, struct sip_msg *msg, int max_expire, int *to_tag_gen, str scontact) |
| int | handle_subscribe (struct sip_msg *, char *, char *) |
| void | msg_active_watchers_clean (unsigned int ticks, void *param) |
| void | msg_watchers_clean (unsigned int ticks, void *param) |
| int | refresh_watcher (str *pres_uri, str *watcher_uri, str *event, int status, str *reason) |
| int | restore_db_subs (void) |
| void | timer_db_update (unsigned int ticks, void *param) |
| void | update_db_subs (db_con_t *db, db_func_t dbf, shtable_t hash_table, int htable_size, int no_lock, handle_expired_func_t handle_expired_func) |
| int | update_subs_db (subs_t *subs, int type) |
Definition in file presence/subscribe.h.
| #define ACTIVE_STATUS 1 |
Definition at line 48 of file presence/subscribe.h.
Referenced by get_status_str(), get_subs_db(), get_subs_dialog(), handle_subscribe(), notify(), pres_watcher_allowed(), and send_notify_request().
| #define PENDING_STATUS 2 |
Definition at line 49 of file presence/subscribe.h.
Referenced by add_waiting_watchers(), get_status_str(), handle_subscribe(), msg_watchers_clean(), pres_watcher_allowed(), and send_notify_request().
| #define TERMINATED_STATUS 3 |
Definition at line 50 of file presence/subscribe.h.
Referenced by build_str_hdr(), get_status_str(), handle_expired_subs(), notify(), pres_watcher_allowed(), send_notify_request(), update_pw_dialogs(), and update_watchers_status().
| #define WAITING_STATUS 4 |
Definition at line 51 of file presence/subscribe.h.
Referenced by add_waiting_watchers(), and get_status_str().
| typedef int(* extract_sdialog_info_t)(subs_t *subs, struct sip_msg *msg, int max_expire, int *to_tag_gen, str scontact) |
Definition at line 112 of file presence/subscribe.h.
| typedef int(* handle_expired_func_t)(subs_t *) |
Definition at line 102 of file presence/subscribe.h.
| typedef int(* refresh_watcher_t)(str *, str *, str *,int, str *) |
Definition at line 98 of file presence/subscribe.h.
| typedef struct subscription subs_t |
Definition at line 81 of file presence/subscribe.h.
| typedef void(* update_db_subs_t)(db_con_t *,db_func_t,shtable_t,int,int, handle_expired_func_t) |
Definition at line 107 of file presence/subscribe.h.
Definition at line 139 of file presence/subscribe.c.
References active_watchers_table, DB_STR, db_func::delete, LM_ERR, db_val_t::nul, pa_db, pa_dbf, str_event_col, str_presentity_uri_col, str_to_tag_col, db_val_t::str_val, db_val_t::type, db_func::use_table, and db_val_t::val.
Referenced by p_tm_callback(), and update_subscription().
| int extract_sdialog_info | ( | subs_t * | subs, | |
| struct sip_msg * | msg, | |||
| int | max_expire, | |||
| int * | to_tag_gen, | |||
| str | scontact | |||
| ) |
Definition at line 753 of file presence/subscribe.c.
References receive_info::bind_address, hdr_field::body, subscription::callid, sip_msg::callid, subscription::contact, sip_msg::contact, contact_body::contacts, sip_msg::cseq, pres_ev::default_expires, to_body::error, subscription::event, EVENT_DIALOG_SLA, pres_ev::evp, subscription::expires, sip_msg::expires, sip_msg::from, subscription::from_domain, subscription::from_tag, subscription::from_user, get_cseq, get_local_contact(), sl_binds::get_reply_totag, sip_uri::host, _str::len, LM_DBG, LM_ERR, subscription::local_contact, NULL, parse_contact(), parse_expires(), parse_from_header(), parse_to(), parse_uri(), event::parsed, hdr_field::parsed, to_body::parsed_uri, subscription::pres_uri, print_rr_body(), sip_msg::rcv, subscription::record_route, sip_msg::record_route, subscription::remote_cseq, _str::s, slb, socket_info::sock_str, subscription::sockinfo_str, str2int(), to_body::tag_value, sip_msg::to, TO, subscription::to_domain, subscription::to_tag, subscription::to_user, uandd_to_uri(), contact::uri, to_body::uri, sip_uri::user, and subscription::version.
Referenced by bind_presence(), and handle_subscribe().
| int handle_subscribe | ( | struct sip_msg * | , | |
| char * | , | |||
| char * | ||||
| ) |
Definition at line 504 of file presence/subscribe.c.
References ACTIVE_STATUS, subscription::auth_rules_doc, BAD_EVENT_CODE, param::body, hdr_field::body, counter, subscription::event, sip_msg::event, EVENT_DIALOG_SLA, subscription::event_id, EVENT_OTHER, extract_sdialog_info(), pres_ev::get_auth_status, get_db_subs_auth(), pres_ev::get_rules_doc, get_status_str(), get_stored_info(), HDR_EOH_F, sip_uri::host, insert_db_subs_auth(), _str::len, LM_DBG, LM_ERR, subscription::local_contact, max_expires, param::name, param::next, NULL, event::params, parse_event(), parse_headers(), parse_sip_msg_uri(), parse_uri(), event::parsed, hdr_field::parsed, sip_msg::parsed_uri, PENDING_STATUS, pkg_free, subscription::pres_uri, subscription::reason, subscription::record_route, _str::s, search_event(), send_error_reply(), server_address, subscription::status, event::text, uandd_to_uri(), update_subscription(), and sip_uri::user.
| void msg_active_watchers_clean | ( | unsigned int | ticks, | |
| void * | param | |||
| ) |
| void msg_watchers_clean | ( | unsigned int | ticks, | |
| void * | param | |||
| ) |
Definition at line 455 of file presence/subscribe.c.
References DB_INT, db_func::delete, db_func::free_result, db_val_t::int_val, LM_DBG, LM_ERR, db_res::n, db_val_t::nul, NULL, OP_EQ, OP_LT, pa_db, pa_dbf, PENDING_STATUS, db_func::query, str_id_col, str_inserted_time_col, str_status_col, db_val_t::type, db_func::use_table, db_val_t::val, and watchers_table.
Referenced by mi_cleanup(), and mod_init().
Definition at line 1823 of file presence/subscribe.c.
References contains_event(), core_hash(), domain, subs_entry::entries, subscription::event, subscription::from_domain, subscription::from_user, sip_uri::host, _str::len, LM_ERR, lock, mem_copy_subs(), subscription::next, notify(), NULL, parse_uri(), pkg_free, PKG_MEM_TYPE, subscription::pres_uri, subscription::reason, _str::s, s, shtable_size, subscription::status, subs_htable, sip_uri::user, and user.
| int restore_db_subs | ( | void | ) |
Definition at line 1618 of file presence/subscribe.c.
References active_watchers_table, subscription::callid, callid_col, subscription::contact, contact_col, contains_event(), core_hash(), db_func::delete, ERR_MEM, to_body::error, subscription::event, subscription::event_id, evlist::events, EvList, subscription::expires, expires_col, free_event_params(), db_func::free_result, subscription::from_domain, subscription::from_tag, subscription::from_user, insert_shtable(), db_val_t::int_val, _str::len, LM_DBG, LM_ERR, LM_INFO, subscription::local_contact, subscription::local_cseq, db_res::n, pres_ev::name, NULL, pa_db, pa_dbf, event::params, PKG_MEM_TYPE, subscription::pres_uri, db_func::query, subscription::reason, reason_col, subscription::record_route, subscription::remote_cseq, ROW_VALUES, db_res::rows, _str::s, s, shm_copy_event(), shm_malloc(), SHM_MEM_STR, shtable_size, subscription::sockinfo_str, subscription::status, str_callid_col, str_contact_col, str_event_col, str_event_id_col, str_expires_col, str_from_tag_col, str_local_contact_col, str_local_cseq_col, str_presentity_uri_col, str_reason_col, str_record_route_col, str_remote_cseq_col, str_socket_info_col, str_status_col, str_to_domain_col, str_to_tag_col, str_to_user_col, str_version_col, str_watcher_domain_col, str_watcher_username_col, db_val_t::string_val, subs_htable, subscription::to_domain, subscription::to_tag, subscription::to_user, db_func::use_table, db_val_t::val, and subscription::version.
Referenced by mod_init().
| void timer_db_update | ( | unsigned int | ticks, | |
| void * | param | |||
| ) |
Definition at line 1322 of file presence/subscribe.c.
References active_watchers_table, handle_expired_subs(), LM_ERR, NULL, pa_db, pa_dbf, shtable_size, subs_htable, update_db_subs(), and db_func::use_table.
Referenced by mod_init().
| void update_db_subs | ( | db_con_t * | db, | |
| db_func_t | dbf, | |||
| shtable_t | hash_table, | |||
| int | htable_size, | |||
| int | no_lock, | |||
| handle_expired_func_t | handle_expired_func | |||
| ) |
Definition at line 1340 of file presence/subscribe.c.
References subscription::callid, callid_col, subscription::contact, contact_col, subscription::db_flag, DB_INT, DB_STR, db_func::delete, subs_entry::entries, subscription::event, subscription::event_id, subscription::expires, expires_col, subscription::from_domain, subscription::from_tag, subscription::from_user, db_func::insert, INSERTDB_FLAG, db_val_t::int_val, LM_DBG, LM_ERR, subscription::local_contact, subscription::local_cseq, lock, pres_ev::name, subscription::next, NO_UPDATEDB_FLAG, db_val_t::nul, NULL, OP_LT, subscription::pres_uri, printf_subs(), subscription::reason, reason_col, subscription::record_route, subscription::remote_cseq, _str::s, s, shm_free, subscription::sockinfo_str, subscription::status, str_callid_col, str_contact_col, str_event_col, str_event_id_col, str_expires_col, str_from_tag_col, str_local_contact_col, str_local_cseq_col, str_presentity_uri_col, str_reason_col, str_record_route_col, str_remote_cseq_col, str_socket_info_col, str_status_col, str_to_domain_col, str_to_tag_col, str_to_user_col, db_val_t::str_val, str_version_col, str_watcher_domain_col, str_watcher_username_col, subscription::to_domain, subscription::to_tag, subscription::to_user, db_val_t::type, db_func::update, UPDATEDB_FLAG, db_val_t::val, and subscription::version.
Referenced by bind_presence(), and timer_db_update().
| int update_subs_db | ( | subs_t * | subs, | |
| int | type | |||
| ) |
Definition at line 179 of file presence/subscribe.c.
References active_watchers_table, subscription::callid, DB_INT, DB_STR, subscription::event, subscription::event_id, subscription::expires, subscription::from_domain, subscription::from_tag, subscription::from_user, db_val_t::int_val, LM_ERR, subscription::local_cseq, pres_ev::name, db_val_t::nul, NULL, pa_db, pa_dbf, subscription::pres_uri, subscription::reason, subscription::remote_cseq, REMOTE_TYPE, _str::s, subscription::status, str_callid_col, str_event_col, str_event_id_col, str_expires_col, str_from_tag_col, str_local_cseq_col, str_presentity_uri_col, str_reason_col, str_remote_cseq_col, str_status_col, str_to_tag_col, db_val_t::str_val, str_version_col, str_watcher_domain_col, str_watcher_username_col, subscription::to_tag, db_val_t::type, db_func::update, db_func::use_table, db_val_t::val, and subscription::version.
Referenced by notify(), and update_subscription().
1.5.6