#include <stdlib.h>
#include "../../parser/parse_from.h"
#include "mi.h"
#include "h_table.h"
#include "t_lookup.h"
#include "t_reply.h"
#include "t_cancel.h"
#include "dlg.h"
#include "callid.h"
#include "uac.h"

Go to the source code of this file.
Data Structures | |
| struct | str_list |
Defines | |
| #define | MI_ROUTE_PREFIX_LEN (sizeof(MI_ROUTE_PREFIX_S)-1) |
| #define | MI_ROUTE_PREFIX_S "Route: " |
| #define | MI_ROUTE_SEPARATOR_LEN (sizeof(MI_ROUTE_SEPARATOR_S)-1) |
| #define | MI_ROUTE_SEPARATOR_S ", " |
| #define | skip_hf(_hf) |
Functions | |
| static char * | get_hfblock (str *uri, struct hdr_field *hf, int *l, struct socket_info **send_sock) |
| Convert a header field block to char array. | |
| static struct mi_root * | mi_check_msg (struct sip_msg *msg, str *method, str *body, int *cseq, str *callid) |
| Check if the request pushed via MI is correctly formed. | |
| static void | mi_print_routes (struct mi_node *node, dlg_t *dlg) |
| Print routes. | |
| static int | mi_print_uris (struct mi_node *node, struct sip_msg *reply) |
| Print URIs. | |
| struct mi_root * | mi_tm_cancel (struct mi_root *cmd_tree, void *param) |
| struct mi_root * | mi_tm_hash (struct mi_root *cmd_tree, void *param) |
| struct mi_root * | mi_tm_reply (struct mi_root *cmd_tree, void *param) |
| struct mi_root * | mi_tm_uac_dlg (struct mi_root *cmd_tree, void *param) |
| static void | mi_uac_dlg_hdl (struct cell *t, int type, struct tmcb_params *ps) |
| static struct str_list * | new_str (char *s, int len, struct str_list **last, int *total) |
| Allocate a new str on a str list. | |
Definition in file modules/tm/mi.c.
| #define MI_ROUTE_PREFIX_LEN (sizeof(MI_ROUTE_PREFIX_S)-1) |
Referenced by mi_print_routes().
| #define MI_ROUTE_PREFIX_S "Route: " |
Referenced by mi_print_routes().
| #define MI_ROUTE_SEPARATOR_LEN (sizeof(MI_ROUTE_SEPARATOR_S)-1) |
Referenced by mi_print_routes().
| #define MI_ROUTE_SEPARATOR_S ", " |
Referenced by mi_print_routes().
| #define skip_hf | ( | _hf | ) |
Value:
(((_hf)->type == HDR_FROM_T) || \ ((_hf)->type == HDR_TO_T) || \ ((_hf)->type == HDR_CALLID_T) || \ ((_hf)->type == HDR_CSEQ_T))
Definition at line 55 of file modules/tm/mi.c.
Referenced by get_hfblock().
| static char* get_hfblock | ( | str * | uri, | |
| struct hdr_field * | hf, | |||
| int * | l, | |||
| struct socket_info ** | send_sock | |||
| ) | [inline, static] |
Convert a header field block to char array.
Convert a header field block to char array, allocated in pkg_mem.
| uri | SIP URI | |
| hf | header field | |
| l | ||
| send_sock | socket information |
Definition at line 161 of file modules/tm/mi.c.
References _str::len, hdr_field::len, LM_DBG, LM_ERR, hdr_field::name, new_str(), hdr_field::next, str_list::next, pkg_free, pkg_malloc, PROTO_NONE, str_list::s, _str::s, skip_hf, SUBST_CHAR, and uri2sock().
Referenced by mi_tm_uac_dlg().
| static struct mi_root* mi_check_msg | ( | struct sip_msg * | msg, | |
| str * | method, | |||
| str * | body, | |||
| int * | cseq, | |||
| str * | callid | |||
| ) | [static, read] |
Check if the request pushed via MI is correctly formed.
Check if the request pushed via MI is correctly formed. Test if necessary SIP header fileds are included, could be parsed and the CSEQ is correct.
| msg | SIP message | |
| method | SIP method | |
| body | SIP body | |
| cseq | SIP CSEQ value | |
| callid | SIP callid, optional |
Definition at line 77 of file modules/tm/mi.c.
References hdr_field::body, sip_msg::callid, sip_msg::content_length, sip_msg::content_type, sip_msg::cseq, sip_msg::from, get_cseq, init_mi_tree(), _str::len, cseq_body::method, cseq_body::number, parse_from_header(), _str::s, str2int(), and sip_msg::to.
Referenced by mi_tm_uac_dlg().
Print routes.
Print route to MI node, allocate temporary memory in pkg_mem.
Definition at line 271 of file modules/tm/mi.c.
References add_mi_node_child(), dlg_hooks::first_route, dlg::hooks, dlg_hooks::last_route, _str::len, rr::len, len, LM_ERR, MI_DUP_VALUE, MI_ROUTE_PREFIX_LEN, MI_ROUTE_PREFIX_S, MI_ROUTE_SEPARATOR_LEN, MI_ROUTE_SEPARATOR_S, name_addr::name, rr::nameaddr, rr::next, NULL, pkg_free, pkg_malloc, _str::s, and s.
Referenced by mi_print_uris().
Print URIs.
Print URIs to MI node, allocate temporary memory in shm_mem.
Definition at line 335 of file modules/tm/mi.c.
References add_mi_node_child(), DLG_CONFIRMED, dlg_response_uac(), empty, free_dlg(), dlg::hooks, _str::len, LM_ERR, MI_DUP_VALUE, mi_print_routes(), dlg_hooks::next_hop, dlg_hooks::request_uri, _str::s, shm_malloc(), and dlg::state.
Referenced by mi_uac_dlg_hdl().
Definition at line 613 of file modules/tm/mi.c.
References cancel_uacs(), init_mi_tree(), mi_node::kids, LM_DBG, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mi_node::next, mi_root::node, t_lookup_callid(), UNREF, and mi_node::value.
Definition at line 640 of file modules/tm/mi.c.
References entry::acc_entries, add_mi_attr(), add_mi_node_child(), entry::cur_entries, s_table::entrys, free_mi_tree(), get_tm_table(), init_mi_tree(), int2str(), len, MI_DUP_VALUE, MI_INTERNAL_ERR_LEN, MI_INTERNAL_ERR_S, MI_OK_LEN, MI_OK_S, mi_root::node, NULL, and TM_TABLE_ENTRIES.
Definition at line 690 of file modules/tm/mi.c.
References init_mi_tree(), mi_node::kids, _str::len, MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, mi_node::next, mi_root::node, NULL, _str::s, str2int(), t_lookup_ident(), t_reply_with_body(), and mi_node::value.
Definition at line 448 of file modules/tm/mi.c.
References add_mi_node_child(), addf_mi_node_child(), mi_root::async_hdl, hdr_field::body, sip_msg::buf, DEFAULT_CSEQ, err2reason_phrase(), free_hdr_field_lst(), sip_msg::from, generate_callid(), generate_fromtag(), get_from, get_hfblock(), grep_sock_info(), HDR_EOH_F, sip_msg::headers, init_mi_tree(), mi_node::kids, sip_msg::len, _str::len, MAX_REASON_LEN, mi_check_msg(), MI_MISSING_PARM_LEN, MI_MISSING_PARM_S, MI_OK_LEN, MI_OK_S, MI_ROOT_ASYNC_RPL, mi_uac_dlg_hdl(), mi_node::next, socket_info::next, mi_root::node, NULL, parse_headers(), parse_phostport(), parse_uri(), pkg_free, port, socket_info::proto, _str::s, s, sock, socket_info::socket, t_uac(), sip_msg::to, sip_msg::unparsed, and mi_node::value.
| static void mi_uac_dlg_hdl | ( | struct cell * | t, | |
| int | type, | |||
| struct tmcb_params * | ps | |||
| ) | [static] |
Definition at line 385 of file modules/tm/mi.c.
References add_mi_node_child(), addf_mi_node_child(), sip_msg::buf, tmcb_params::code, FAKED_REPLY, sip_msg::first_line, get_reply_status(), mi_handler::handler_f, sip_msg::headers, init_mi_tree(), sip_msg::len, _str::len, LM_DBG, LM_ERR, MI_DUP_VALUE, MI_OK_LEN, MI_OK_S, mi_print_uris(), hdr_field::name, mi_root::node, tmcb_params::param, pkg_free, msg_start::reply, tmcb_params::rpl, _str::s, and msg_start::u.
Referenced by mi_tm_uac_dlg().
| static struct str_list* new_str | ( | char * | s, | |
| int | len, | |||
| struct str_list ** | last, | |||
| int * | total | |||
| ) | [static, read] |
Allocate a new str on a str list.
Allocate a new str in pkg_mem and attach it to a str list. Update the total number of list elements.
| s | char array | |
| len | length of the char array | |
| last | last list element | |
| total | total number of list elements |
Definition at line 131 of file modules/tm/mi.c.
References LM_ERR, and pkg_malloc.
Referenced by get_hfblock().
1.5.6