#include <string.h>
#include "../../mem/shm_mem.h"
#include "../../dprint.h"
#include "../../md5.h"
#include "../../socket_info.h"
#include "ut.h"
#include "h_table.h"
#include "t_hooks.h"
#include "t_funcs.h"
#include "t_msgbuilder.h"
#include "callid.h"
#include "uac.h"

Go to the source code of this file.
Defines | |
| #define | FROM_TAG_LEN (MD5_LEN + 1 /* - */ + CRC16_LEN) |
Functions | |
| static int | check_params (str *method, str *to, str *from, dlg_t **dialog) |
| Check value of parameters. | |
| static unsigned int | dlg2hash (dlg_t *dlg) |
| Generate a hash from a dialog state. | |
| void | generate_fromtag (str *tag, str *callid) |
| Generate a From tag from the callid. | |
| int | req_outside (str *method, str *to, str *from, str *headers, str *body, dlg_t **dialog, transaction_cb cb, void *cbp) |
| Send an initial request that will start a dialog. | |
| int | req_within (str *method, str *headers, str *body, dlg_t *dialog, transaction_cb completion_cb, void *cbp) |
| Send a message within a dialog. | |
| int | request (str *m, str *ruri, str *to, str *from, str *h, str *b, str *oburi, transaction_cb cb, void *cbp) |
| Send a transactional request, no dialogs involved. | |
| int | t_uac (str *method, str *headers, str *body, dlg_t *dialog, transaction_cb cb, void *cbp) |
| Send a request using data from the dialog structure. | |
| int | uac_init (void) |
| Initialize UAC. | |
Variables | |
| static char | from_tag [FROM_TAG_LEN+1] |
| int | pass_provisional_replies = 0 |
Simple UAC for things such as SUBSCRIBE or SMS gateway; no authentication and other UAC features -- just send a message, retransmit and await a reply; forking is not supported during client generation, in all other places it is -- adding it should be simple
Definition in file tm/uac.c.
| #define FROM_TAG_LEN (MD5_LEN + 1 /* - */ + CRC16_LEN) |
from tag length, MD5 + '-' + CRC16
Definition at line 80 of file tm/uac.c.
Referenced by generate_fromtag().
| static unsigned int dlg2hash | ( | dlg_t * | dlg | ) | [inline, static] |
Generate a hash from a dialog state.
Definition at line 175 of file tm/uac.c.
References dlg_id::call_id, dlg::id, int2str(), _str::len, LM_DBG, dlg::loc_seq, _str::s, tm_hash, and dlg_seq::value.
Referenced by t_uac().
Generate a From tag from the callid.
| tag | tag generated tag | |
| callid | source callid |
Definition at line 128 of file tm/uac.c.
References crcitt_string_array(), from_tag, FROM_TAG_LEN, _str::len, MD5_LEN, and _str::s.
Referenced by mi_tm_uac_dlg(), req_outside(), and request().
| int req_outside | ( | str * | method, | |
| str * | to, | |||
| str * | from, | |||
| str * | headers, | |||
| str * | body, | |||
| dlg_t ** | dialog, | |||
| transaction_cb | cb, | |||
| void * | cbp | |||
| ) |
Send an initial request that will start a dialog.
| method | SIP method | |
| to | To URI | |
| from | From URI | |
| headers | SIP headers | |
| body | SIP body | |
| dialog | dialog state | |
| cb | transaction callback | |
| cbp | transaction callback parameter |
Definition at line 442 of file tm/uac.c.
References check_params(), DEFAULT_CSEQ, generate_callid(), generate_fromtag(), LM_ERR, new_dlg_uac(), and t_uac().
Referenced by load_tm().
| int req_within | ( | str * | method, | |
| str * | headers, | |||
| str * | body, | |||
| dlg_t * | dialog, | |||
| transaction_cb | completion_cb, | |||
| void * | cbp | |||
| ) |
Send a message within a dialog.
| method | SIP method | |
| headers | SIP header | |
| body | SIP body | |
| dialog | dialog state | |
| completion_cb | transaction callback | |
| cbp | transaction callback parameter |
Definition at line 406 of file tm/uac.c.
References DLG_CONFIRMED, _str::len, LM_ERR, dlg::loc_seq, _str::s, dlg::state, t_uac(), and dlg_seq::value.
Referenced by load_tm().
| int request | ( | str * | m, | |
| str * | ruri, | |||
| str * | to, | |||
| str * | from, | |||
| str * | h, | |||
| str * | b, | |||
| str * | oburi, | |||
| transaction_cb | cb, | |||
| void * | cbp | |||
| ) |
Send a transactional request, no dialogs involved.
| m | SIP method | |
| ruri | Request URI | |
| to | To URI | |
| from | From URI | |
| h | SIP headers | |
| b | SIP body | |
| oburi | outbound URI | |
| cb | transaction callback | |
| cbp | transaction callback parameter |
Definition at line 476 of file tm/uac.c.
References check_params(), DEFAULT_CSEQ, free_dlg(), generate_callid(), generate_fromtag(), dlg::hooks, _str::len, LM_ERR, new_dlg_uac(), dlg_hooks::next_hop, dlg::rem_target, dlg_hooks::request_uri, _str::s, t_uac(), and w_calculate_hooks().
Referenced by __dialog_created(), encode_msg(), end_media_session(), load_tm(), t_uac(), and use_media_proxy().
| int t_uac | ( | str * | method, | |
| str * | headers, | |||
| str * | body, | |||
| dlg_t * | dialog, | |||
| transaction_cb | cb, | |||
| void * | cbp | |||
| ) |
Send a request using data from the dialog structure.
| method | SIP method | |
| headers | SIP header | |
| body | ||
| dialog | dialog state | |
| cb | transaction callback | |
| cbp | transaction callback parameter |
Definition at line 229 of file tm/uac.c.
References sip_msg::add_rm, sip_msg::body_lumps, buf_len, retr_buf::buffer, build_cell(), build_req_buf_from_sip_req(), build_uac_req(), dlg2hash(), retr_buf::dst, sip_msg::dst_uri, E_OUT_OF_MEM, cell::flags, free_cell(), free_sip_msg(), getsflags(), dlg::hooks, insert_into_hash_table_unsafe(), insert_tmcb(), INVITE, INVITE_LEN, _str::len, LM_DBG, LM_ERR, LOCAL_ROUTE, LOCK_HASH, cell::method, MSG_TRANS_NOVIA_FLAG, MSG_TRANS_SHM_FLAG, sip_msg::new_uri, dlg_hooks::next_hop, cell::nr_of_outgoings, NULL, pass_provisional, pass_provisional_replies, pkg_free, dest_info::proto, socket_info::proto, PROTO_NONE, dest_info::proto_reserved1, remove_from_hash_table_unsafe(), ua_client::request, request(), run_top_route(), _str::s, SEND_BUFFER, dest_info::send_sock, dlg::send_sock, ser_error, set_avp_list(), set_route_type, setsflagsval(), shm_free, start_retr(), swap_route_type, dlg::T_flags, T_IS_INVITE_FLAG, T_IS_LOCAL_FLAG, cell::tmcb_hl, TMCB_LOCAL_COMPLETED, TMCB_LOCAL_RESPONSE_OUT, dest_info::to, cell::uac, UNLOCK_HASH, uri2sock(), uri2su(), cell::user_avps, and w_calculate_hooks().
Referenced by mi_tm_uac_dlg(), req_outside(), req_within(), and request().
| int uac_init | ( | void | ) |
Initialize UAC.
Definition at line 92 of file tm/uac.c.
References socket_info::address_str, bind_address, from_tag, get_first_socket(), _str::len, LM_CRIT, LM_WARN, MD5_LEN, MD5StringArray(), socket_info::port_no_str, s, _str::s, and TM_TABLE_ENTRIES.
Referenced by mod_init().
char from_tag[FROM_TAG_LEN+1] [static] |
from tag
Definition at line 83 of file tm/uac.c.
Referenced by db_restore(), EndMediaSession(), force_rtp_proxy(), generate_fromtag(), load_dialog_info_from_db(), process_mi_params(), rls_notify_callback(), rtpproxy_stop_stream(), rtpproxy_stream(), start_recording_f(), timer_send_notify(), uac_init(), unforce_rtp_proxy_f(), and use_media_proxy().
| int pass_provisional_replies = 0 |
1.5.6