#include <stdio.h>#include <stdlib.h>#include <string.h>#include <libxml/parser.h>#include <time.h>#include "../../sr_module.h"#include "../../parser/parse_expires.h"#include "../../dprint.h"#include "../../mem/shm_mem.h"#include "../../parser/msg_parser.h"#include "../../str.h"#include "../../mem/mem.h"#include "../../pt.h"#include "../../db/db.h"#include "../tm/tm_load.h"#include "pua.h"#include "send_publish.h"#include "send_subscribe.h"#include "pua_bind.h"#include "pua_callback.h"#include "event_list.h"#include "add_events.h"#include "pidf.h"

Go to the source code of this file.
Defines | |
| #define | PUA_TABLE_VERSION 6 |
Functions | |
| int | bind_pua (pua_api_t *api) |
| static ua_pres_t * | build_uppubl_cbparam (ua_pres_t *p) |
| static int | child_init (int) |
| static int | db_restore (void) |
| static void | db_update (unsigned int ticks, void *param) |
| static void | destroy (void) |
| static void | hashT_clean (unsigned int ticks, void *param) |
| static int | mod_init (void) |
| static int | update_pua (ua_pres_t *p, unsigned int hash_code) |
Variables | |
| static cmd_export_t | cmds [] |
| static str | db_table = str_init("pua") |
| static str | db_url = str_init(DEFAULT_DB_URL) |
| int | default_expires = 3600 |
| int | dlginfo_increase_version = 0 |
| struct module_exports | exports |
| int | HASH_SIZE = -1 |
| htable_t * | HashT = NULL |
| int | min_expires = 0 |
| str | outbound_proxy = {0, 0} |
| static param_export_t | params [] |
| db_con_t * | pua_db = NULL |
| db_func_t | pua_dbf |
| pua_event_t * | pua_evlist = NULL |
| int | startup_time = 0 |
| static str | str_call_id_col = str_init("call_id") |
| static str | str_contact_col = str_init("contact") |
| static str | str_cseq_col = str_init("cseq") |
| static str | str_desired_expires_col = str_init("desired_expires") |
| static str | str_etag_col = str_init("etag") |
| static str | str_event_col = str_init("event") |
| static str | str_expires_col = str_init("expires") |
| static str | str_extra_headers_col = str_init("extra_headers") |
| static str | str_flag_col = str_init("flag") |
| static str | str_from_tag_col = str_init("from_tag") |
| static str | str_pres_id_col = str_init("pres_id") |
| static str | str_pres_uri_col = str_init("pres_uri") |
| static str | str_record_route_col = str_init("record_route") |
| static str | str_remote_contact_col = str_init("remote_contact") |
| static str | str_to_tag_col = str_init("to_tag") |
| static str | str_tuple_id_col = str_init("tuple_id") |
| static str | str_version_col = str_init("version") |
| static str | str_watcher_uri_col = str_init("watcher_uri") |
| struct tm_binds | tmb |
| int | update_period = 100 |
| #define PUA_TABLE_VERSION 6 |
| int bind_pua | ( | pua_api_t * | api | ) |
Definition at line 30 of file pua_bind.c.
References pua_api::add_event, add_pua_event(), get_record_id(), pua_api::get_record_id, is_dialog(), pua_api::is_dialog, LM_ERR, register_puacb(), pua_api::register_puacb, send_publish(), pua_api::send_publish, send_subscribe(), and pua_api::send_subscribe.
Referenced by init(), and mod_init().
Definition at line 1072 of file pua.c.
References ua_pres::content_type, publ_info::content_type, ua_pres::desired_expires, ua_pres::etag, publ_info::etag, ua_pres::event, publ_info::event, publ_info::expires, ua_pres::extra_headers, publ_info::extra_headers, ua_pres::flag, publ_info::flag, ua_pres::id, publ_info::id, LM_ERR, NULL, ua_pres::pres_uri, publ_info::pres_uri, publish_cbparam(), REQ_ME, publ_info::source_flag, ua_pres::tuple_id, and UPDATE_TYPE.
Referenced by update_pua().
| static int child_init | ( | int | rank | ) | [static] |
Definition at line 257 of file pua.c.
References db_func::init, LM_CRIT, LM_DBG, LM_ERR, and db_func::use_table.
| static int db_restore | ( | void | ) | [static] |
Definition at line 301 of file pua.c.
References ua_pres::call_id, callid_col, ua_pres::contact, contact_col, ua_pres::cseq, cseq_col, db_func::delete, ua_pres::desired_expires, ua_pres::etag, ua_pres::event, ua_pres::expires, expires_col, ua_pres::extra_headers, ua_pres::flag, db_func::free_result, ua_pres::from_tag, from_tag, ua_pres::id, insert_htable(), db_val_t::int_val, _str::len, LM_DBG, LM_ERR, LM_INFO, db_res::n, NULL, ua_pres::pres_uri, print_ua_pres(), db_func::query, ua_pres::record_route, record_route(), ua_pres::remote_contact, ROW_VALUES, db_res::rows, _str::s, shm_free, shm_malloc(), db_val_t::string_val, ua_pres::to_tag, ua_pres::tuple_id, db_func::use_table, db_val_t::val, ua_pres::version, and ua_pres::watcher_uri.
Referenced by mod_init().
| static void db_update | ( | unsigned int | ticks, | |
| void * | param | |||
| ) | [static] |
Definition at line 742 of file pua.c.
References ua_pres::call_id, callid_col, ua_pres::contact, contact_col, ua_pres::cseq, cseq_col, ua_pres::db_flag, DB_INT, DB_STR, db_func::delete, ua_pres::desired_expires, hash_entry::entity, ua_pres::etag, ua_pres::event, ua_pres::expires, expires_col, ua_pres::extra_headers, ua_pres::flag, db_func::free_result, ua_pres::from_tag, HASH_SIZE, ua_pres::id, db_func::insert, INSERTDB_FLAG, db_val_t::int_val, _str::len, LM_DBG, LM_ERR, hash_entry::lock, db_res::n, ua_pres::next, NO_UPDATEDB_FLAG, db_val_t::nul, NULL, OP_LT, htable::p_records, ua_pres::pres_uri, db_func::query, ua_pres::record_route, ua_pres::remote_contact, _str::s, db_val_t::str_val, ua_pres::to_tag, ua_pres::tuple_id, db_val_t::type, db_func::update, UPDATEDB_FLAG, db_func::use_table, db_val_t::val, ua_pres::version, and ua_pres::watcher_uri.
Referenced by mod_init().
| static void destroy | ( | void | ) | [static] |
| static void hashT_clean | ( | unsigned int | ticks, | |
| void * | param | |||
| ) | [static] |
Definition at line 588 of file pua.c.
References delete_htable(), ua_pres::desired_expires, hash_entry::entity, ua_pres::expires, HASH_SIZE, _str::len, LM_DBG, LM_ERR, hash_entry::lock, min_expires, ua_pres::next, NULL, htable::p_records, ua_pres::pres_uri, print_ua_pres(), _str::s, update_period, and update_pua().
Referenced by mod_init().
| static int mod_init | ( | void | ) | [static] |
init module function
Definition at line 148 of file pua.c.
References db_func::close, db_bind_mod(), DB_CAP_ALL, DB_CAPABILITY, db_check_table_version(), db_restore(), db_update(), default_expires, find_export(), HASH_SIZE, hashT_clean(), db_func::init, init_pua_evlist(), init_puacb_list(), _str::len, LM_DBG, LM_ERR, load_tm(), min_expires, new_htable(), NULL, pua_add_events(), PUA_TABLE_VERSION, register_timer(), _str::s, startup_time, tmb, update_period, and ZSW.
| int update_pua | ( | ua_pres_t * | p, | |
| unsigned int | hash_code | |||
| ) | [static] |
Definition at line 636 of file pua.c.
References build_uppubl_cbparam(), ua_pres::contact, ua_pres::desired_expires, ua_pres::etag, ua_pres::event, ua_pres::extra_headers, get_event(), _str::len, LM_DBG, LM_ERR, NULL, pkg_free, ua_pres::pres_uri, pua_build_dlg_t(), publ_build_hdr(), publ_cback_func(), REQ_ME, _str::s, shm_free, subs_build_hdr(), subs_cback_func(), subs_cbparam_indlg(), tm_binds::t_request, tm_binds::t_request_within, tmb, and ua_pres::watcher_uri.
Referenced by hashT_clean().
cmd_export_t cmds[] [static] |
| int default_expires = 3600 |
Definition at line 63 of file pua.c.
Referenced by calc_contact_expires(), child_init(), get_expires_hf(), and mod_init().
| int dlginfo_increase_version = 0 |
| struct module_exports exports |
Definition at line 59 of file pua.c.
Referenced by delete_htable(), destroy_htable(), get_dialog(), get_record_id(), insert_htable(), is_dialog(), publ_cback_func(), search_htable(), send_publish(), send_subscribe(), subs_cback_func(), and update_contact().
| int min_expires = 0 |
Definition at line 62 of file pua.c.
Referenced by calc_contact_expires(), hashT_clean(), mod_init(), publ_build_hdr(), and subs_build_hdr().
| str outbound_proxy = {0, 0} |
param_export_t params[] [static] |
| pua_event_t* pua_evlist = NULL |
Definition at line 70 of file pua.c.
Referenced by add_pua_event(), contains_pua_event(), destroy_pua_evlist(), and get_event().
| int startup_time = 0 |
str str_call_id_col = str_init("call_id") [static] |
str str_contact_col = str_init("contact") [static] |
str str_cseq_col = str_init("cseq") [static] |
str str_desired_expires_col = str_init("desired_expires") [static] |
str str_etag_col = str_init("etag") [static] |
str str_event_col = str_init("event") [static] |
str str_expires_col = str_init("expires") [static] |
str str_extra_headers_col = str_init("extra_headers") [static] |
str str_flag_col = str_init("flag") [static] |
str str_from_tag_col = str_init("from_tag") [static] |
str str_pres_id_col = str_init("pres_id") [static] |
str str_pres_uri_col = str_init("pres_uri") [static] |
str str_record_route_col = str_init("record_route") [static] |
str str_remote_contact_col = str_init("remote_contact") [static] |
str str_to_tag_col = str_init("to_tag") [static] |
str str_tuple_id_col = str_init("tuple_id") [static] |
str str_version_col = str_init("version") [static] |
str str_watcher_uri_col = str_init("watcher_uri") [static] |
| int update_period = 100 |
1.5.6