#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "../../db/db.h"
#include "../../dprint.h"
#include "../../mem/shm_mem.h"
#include "../../str.h"
#include "../alias_db/alias_db.h"
#include "../../data_lump_rpl.h"
#include "presentity.h"
#include "presence.h"
#include "notify.h"
#include "publish.h"
#include "hash.h"
#include "utils_func.h"

Go to the source code of this file.
Defines | |
| #define | ETAG_LEN 128 |
Functions | |
| int | check_if_dialog (str body, int *is_dialog) |
| char * | extract_sphere (str body) |
| char * | generate_ETag (int publ_count) |
| char * | get_sphere (str *pres_uri) |
| presentity_t * | new_presentity (str *domain, str *user, int expires, pres_ev_t *event, str *etag, str *sender) |
| int | pres_htable_restore (void) |
| int | publ_send200ok (struct sip_msg *msg, int lexpire, str etag) |
| int | update_presentity (struct sip_msg *msg, presentity_t *presentity, str *body, int new_t, int *sent_reply, char *sphere) |
| xmlNodePtr | xmlNodeGetChildByName (xmlNodePtr node, const char *name) |
| xmlNodePtr | xmlNodeGetNodeByName (xmlNodePtr node, const char *name, const char *ns) |
Variables | |
| static str | pu_200_rpl = str_init("OK") |
| static str | pu_412_rpl = str_init("Conditional request failed") |
Definition in file presentity.c.
| #define ETAG_LEN 128 |
| int check_if_dialog | ( | str | body, | |
| int * | is_dialog | |||
| ) |
Definition at line 243 of file presentity.c.
References _str::len, LM_ERR, NULL, _str::s, and xmlNodeGetChildByName().
Referenced by update_presentity().
| char* extract_sphere | ( | str | body | ) |
Definition at line 786 of file presentity.c.
References ERR_MEM, _str::len, LM_DBG, LM_ERR, NULL, pkg_malloc, PKG_MEM_STR, _str::s, and xmlNodeGetNodeByName().
Referenced by get_sphere(), handle_publish(), pres_htable_restore(), and update_phtable().
| char* generate_ETag | ( | int | publ_count | ) |
Definition at line 61 of file presentity.c.
References counter, ERR_MEM, ETAG_LEN, LM_DBG, LM_ERR, NULL, pid, pkg_free, pkg_malloc, PKG_MEM_STR, prefix, snprintf, and startup_time.
Referenced by handle_publish(), and update_presentity().
| char* get_sphere | ( | str * | pres_uri | ) |
Definition at line 853 of file presentity.c.
References core_hash(), DB_STR, ERR_MEM, EVENT_PRESENCE, extract_sphere(), fallback2db, db_func::free_result, sip_uri::host, _str::len, LM_DBG, LM_ERR, lock, db_res::n, db_val_t::nul, NULL, pa_db, pa_dbf, parse_uri(), phtable_size, pkg_malloc, PKG_MEM_STR, presentity_table, db_func::query, ROW_VALUES, db_res::rows, _str::s, search_phtable(), pres_entry::sphere, sphere_enable, str_body_col, str_domain_col, str_event_col, str_init, str_username_col, db_val_t::str_val, db_val_t::string_val, db_val_t::type, db_func::use_table, sip_uri::user, and db_val_t::val.
Referenced by bind_presence().
| presentity_t* new_presentity | ( | str * | domain, | |
| str * | user, | |||
| int | expires, | |||
| pres_ev_t * | event, | |||
| str * | etag, | |||
| str * | sender | |||
| ) |
Definition at line 168 of file presentity.c.
References presentity::domain, ERR_MEM, presentity::etag, presentity::event, presentity::expires, _str::len, LM_ERR, NULL, pkg_free, pkg_malloc, PKG_MEM_STR, presentity::received_time, _str::s, presentity::sender, and presentity::user.
Referenced by handle_publish().
| int pres_htable_restore | ( | void | ) |
Definition at line 681 of file presentity.c.
References domain, domain_col, event_parser(), EVENT_PRESENCE, expires_col, extract_sphere(), free_event_params(), db_func::free_result, insert_phtable(), db_val_t::int_val, _str::len, LM_ERR, db_res::n, NULL, pa_db, pa_dbf, event::params, event::parsed, pkg_free, PKG_MEM_TYPE, presentity_table, db_func::query, ROW_VALUES, db_res::rows, _str::s, sphere_enable, str_body_col, str_domain_col, str_event_col, str_expires_col, str_init, str_username_col, db_val_t::string_val, uandd_to_uri(), db_func::use_table, user, and user_col.
Referenced by mod_init().
Definition at line 95 of file presentity.c.
References add_lump_rpl(), buf, buf_len, ERR_MEM, expires_offset, sip_msg::len, _str::len, LM_DBG, LM_ERR, LUMP_RPL_HDR, NULL, pkg_free, pkg_malloc, PKG_MEM_STR, _str::s, sl_binds::send_reply, slb, and snprintf.
Referenced by update_presentity().
| int update_presentity | ( | struct sip_msg * | msg, | |
| presentity_t * | presentity, | |||
| str * | body, | |||
| int | new_t, | |||
| int * | sent_reply, | |||
| char * | sphere | |||
| ) |
Definition at line 268 of file presentity.c.
References check_if_dialog(), DB_BLOB, DB_INT, DB_STR, db_func::delete, delete_phtable(), presentity::domain, presentity::etag, pres_ev::etag_not_new, presentity::event, EVENT_DIALOG_SLA, EVENT_PRESENCE, pres_ev::evp, presentity::expires, db_func::free_result, generate_ETag(), pres_ev::get_rules_doc, db_func::insert, insert_phtable(), db_val_t::int_val, is_dialog(), _str::len, LM_DBG, LM_ERR, db_res::n, pres_ev::name, db_val_t::nul, NULL, OP_EQ, pa_db, pa_dbf, event::parsed, pkg_free, presentity_table, publ_notify(), publ_send200ok(), db_func::query, presentity::received_time, pres_ev::req_auth, ROW_VALUES, db_res::rows, _str::s, sl_binds::send_reply, presentity::sender, slb, sphere_enable, str2int(), str_body_col, str_domain_col, str_etag_col, str_event_col, str_expires_col, str_received_time_col, str_sender_col, str_username_col, db_val_t::str_val, db_val_t::string_val, db_val_t::type, uandd_to_uri(), db_func::update, update_phtable(), db_func::use_table, presentity::user, and db_val_t::val.
Referenced by handle_publish().
| xmlNodePtr xmlNodeGetChildByName | ( | xmlNodePtr | node, | |
| const char * | name | |||
| ) |
Definition at line 232 of file presentity.c.
Referenced by agregate_xmls(), check_if_dialog(), get_final_notify_body(), get_rule_node(), and pres_watcher_allowed().
| xmlNodePtr xmlNodeGetNodeByName | ( | xmlNodePtr | node, | |
| const char * | name, | |||
| const char * | ns | |||
| ) |
Definition at line 834 of file presentity.c.
References NULL.
Referenced by bind_libxml_api(), extract_sphere(), get_final_notify_body(), xmlDocGetNodeByName(), xmlNodeGetNodeByName(), and xmlNodeGetNodeContentByName().
str pu_200_rpl = str_init("OK") [static] |
Definition at line 56 of file presentity.c.
str pu_412_rpl = str_init("Conditional request failed") [static] |
Definition at line 57 of file presentity.c.
1.5.6