#include <string.h>
#include <stdio.h>
#include "../../mi/mi.h"
#include "../../dprint.h"
#include "../../ut.h"
#include "../../qvalue.h"
#include "../../ip_addr.h"
#include "ul_mi.h"
#include "dlist.h"
#include "udomain.h"
#include "utime.h"
#include "ul_mod.h"

Go to the source code of this file.
Defines | |
| #define | MI_UL_CSEQ 1 |
Functions | |
| static int | mi_add_aor_node (struct mi_node *parent, urecord_t *r, time_t t, int short_dump) |
| Add a node for a address of record. | |
| static udomain_t * | mi_find_domain (str *table) |
| Search a domain in the global domain list. | |
| static int | mi_fix_aor (str *aor) |
| Convert address of record. | |
| struct mi_root * | mi_usrloc_add (struct mi_root *cmd, void *param) |
| Add a new contact for an address of record. | |
| struct mi_root * | mi_usrloc_dump (struct mi_root *cmd, void *param) |
| Dump the content of the usrloc. | |
| struct mi_root * | mi_usrloc_flush (struct mi_root *cmd, void *param) |
| Flush the usrloc memory cache to DB. | |
| struct mi_root * | mi_usrloc_rm_aor (struct mi_root *cmd, void *param) |
| Delete a address of record including its contacts. | |
| struct mi_root * | mi_usrloc_rm_contact (struct mi_root *cmd, void *param) |
| Delete a contact from an AOR record. | |
| struct mi_root * | mi_usrloc_show_contact (struct mi_root *cmd, void *param) |
| Dumps the contacts of an AOR. | |
Variables | |
| static str | mi_ul_cid = str_init("dfjrewr12386fd6-343@openser.mi") |
| static str | mi_ul_ua = str_init("Kamailio MI Server") |
Definition in file ul_mi.c.
| #define MI_UL_CSEQ 1 |
CSEQ nr used
Definition at line 50 of file ul_mi.c.
Referenced by mi_usrloc_add(), and mi_usrloc_rm_contact().
| static int mi_add_aor_node | ( | struct mi_node * | parent, | |
| urecord_t * | r, | |||
| time_t | t, | |||
| int | short_dump | |||
| ) | [inline, static] |
Add a node for a address of record.
| parent | parent node | |
| r | printed record | |
| t | actual time | |
| short_dump | 0 means that all informations will be included, 1 that only the AOR is printed |
Definition at line 111 of file ul_mi.c.
References add_mi_attr(), add_mi_node_child(), urecord::aor, ucontact::c, ucontact::callid, ucontact::cflags, urecord::contacts, CS_DIRTY, CS_NEW, CS_SYNC, ucontact::cseq, ucontact::expires, ucontact::flags, int2str(), _str::len, len, ucontact::methods, MI_DUP_VALUE, ucontact::next, ucontact::path, ucontact::q, q2str(), ucontact::received, _str::s, ucontact::sock, socket_info::sock_str, ucontact::state, UL_EXPIRED_TIME, and ucontact::user_agent.
Referenced by mi_usrloc_dump().
Search a domain in the global domain list.
| table | domain (table) name |
Definition at line 64 of file ul_mi.c.
References dlist::d, _str::len, dlist::name, dlist::next, root, and _str::s.
Referenced by mi_usrloc_add(), mi_usrloc_rm_aor(), mi_usrloc_rm_contact(), and mi_usrloc_show_contact().
| static int mi_fix_aor | ( | str * | aor | ) | [inline, static] |
Convert address of record.
Convert an address of record string to lower case, and truncate it when use_domain is not set.
| aor | address of record |
Definition at line 85 of file ul_mi.c.
References _str::len, NULL, _str::s, strlower(), and use_domain.
Referenced by mi_usrloc_add(), mi_usrloc_rm_aor(), mi_usrloc_rm_contact(), and mi_usrloc_show_contact().
Add a new contact for an address of record.
Definition at line 450 of file ul_mi.c.
References act_time, ucontact_info::callid, ucontact_info::cflags, ucontact_info::cseq, ucontact_info::expires, ucontact_info::flags, get_act_time(), get_ucontact(), get_urecord(), init_mi_tree(), insert_ucontact(), insert_urecord(), mi_node::kids, _str::len, lock_udomain(), ucontact_info::methods, MI_BAD_PARM_LEN, MI_BAD_PARM_S, mi_find_domain(), mi_fix_aor(), MI_INTERNAL_ERR_LEN, MI_INTERNAL_ERR_S, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, MI_UL_CSEQ, mi_node::next, mi_root::node, NULL, ucontact_info::q, release_urecord(), _str::s, str2int(), str2q(), unlock_udomain(), update_ucontact(), ucontact_info::user_agent, and mi_node::value.
Dump the content of the usrloc.
Definition at line 342 of file ul_mi.c.
References add_mi_attr(), add_mi_node_child(), dlist::d, hslot::first, free_mi_tree(), init_mi_tree(), int2str(), mi_node::kids, _str::len, len, lock_ulslot(), max, mi_add_aor_node(), MI_DUP_VALUE, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, hslot::n, dlist::name, urecord::next, dlist::next, mi_node::next, mi_root::node, NULL, root, _str::s, udomain::size, table, udomain::table, unlock_ulslot(), and mi_node::value.
Flush the usrloc memory cache to DB.
Definition at line 429 of file ul_mi.c.
References init_mi_tree(), MI_OK_LEN, MI_OK_S, NULL, and synchronize_all_udomains().
Delete a address of record including its contacts.
Definition at line 244 of file ul_mi.c.
References delete_urecord(), init_mi_tree(), mi_node::kids, lock_udomain(), mi_find_domain(), mi_fix_aor(), MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mi_node::next, mi_root::node, NULL, unlock_udomain(), and mi_node::value.
Delete a contact from an AOR record.
Definition at line 282 of file ul_mi.c.
References delete_ucontact(), get_ucontact(), get_urecord(), init_mi_tree(), mi_node::kids, lock_udomain(), mi_find_domain(), mi_fix_aor(), MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, MI_UL_CSEQ, mi_node::next, mi_root::node, NULL, release_urecord(), unlock_udomain(), and mi_node::value.
Dumps the contacts of an AOR.
Definition at line 564 of file ul_mi.c.
References act_time, addf_mi_node_child(), ucontact::c, ucontact::cflags, urecord::contacts, ucontact::expires, ucontact::flags, free_mi_tree(), get_act_time(), get_urecord(), init_mi_tree(), mi_node::kids, _str::len, lock_udomain(), ucontact::methods, mi_find_domain(), mi_fix_aor(), MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, ucontact::next, mi_node::next, mi_root::node, NULL, ucontact::path, ucontact::q, q2str(), ucontact::received, _str::s, ucontact::sock, socket_info::sock_str, unlock_udomain(), ucontact::user_agent, VALID_CONTACT, mi_node::value, and ZSW.
1.5.6