Asterisk - The Open Source Telephony Project
18.5.0
|
sip dialog management header file More...
#include "sip.h"
Go to the source code of this file.
Macros | |
#define | dialog_ref(dialog, tag) ao2_t_bump(dialog, tag) |
when we create or delete references, make sure to use these functions so we keep track of the refcounts. To simplify the code, we allow a NULL to be passed to dialog_unref(). More... | |
#define | dialog_unref(dialog, tag) ({ ao2_t_cleanup(dialog, tag); (NULL); }) |
#define | sip_alloc(callid, addr, useglobal_nat, intended_method, req, logger_callid) __sip_alloc(callid, addr, useglobal_nat, intended_method, req, logger_callid, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Functions | |
int | __sip_ack (struct sip_pvt *p, uint32_t seqno, int resp, int sipmethod) |
Acknowledges receipt of a packet and stops retransmission called with p locked. More... | |
struct sip_pvt * | __sip_alloc (ast_string_field callid, struct ast_sockaddr *sin, int useglobal_nat, const int intended_method, struct sip_request *req, ast_callid logger_callid, const char *file, int line, const char *func) |
Allocate sip_pvt structure, set defaults and link in the container. Returns a reference to the object so whoever uses it later must remember to release the reference. More... | |
void | __sip_pretend_ack (struct sip_pvt *p) |
Pretend to ack all packets called with p locked. More... | |
int | __sip_semi_ack (struct sip_pvt *p, uint32_t seqno, int resp, int sipmethod) |
Acks receipt of packet, keep it around (used for provisional responses) More... | |
void | dialog_unlink_all (struct sip_pvt *dialog) |
Unlink a dialog from the dialogs container, as well as any other places that it may be currently stored. More... | |
void | sip_cancel_destroy (struct sip_pvt *pvt) |
Cancel destruction of SIP dialog. More... | |
void | sip_scheddestroy (struct sip_pvt *p, int ms) |
Schedule destruction of SIP dialog. More... | |
void | sip_scheddestroy_final (struct sip_pvt *p, int ms) |
Schedule final destruction of SIP dialog. More... | |
sip dialog management header file
Definition in file dialog.h.
#define dialog_ref | ( | dialog, | |
tag | |||
) | ao2_t_bump(dialog, tag) |
when we create or delete references, make sure to use these functions so we keep track of the refcounts. To simplify the code, we allow a NULL to be passed to dialog_unref().
Definition at line 32 of file dialog.h.
Referenced by __find_call(), __sip_reliable_xmit(), __sip_scheddestroy(), __start_session_timer(), __start_t38_abort_timer(), __update_provisional_keepalive_full(), AST_TEST_DEFINE(), dialog_unlink_all(), handle_cc_subscribe(), handle_request_subscribe(), handle_response_invite(), sched_check_pendings(), sip_call(), sip_cancel_destroy(), sip_hangup(), sip_new(), sip_poke_peer(), sip_scheddestroy_full(), sip_send_mwi_to_peer(), start_session_timer(), start_t38_abort_timer(), stop_provisional_keepalive(), stop_reinvite_retry(), stop_reinviteid(), stop_session_timer(), stop_t38_abort_timer(), transmit_register(), and update_provisional_keepalive().
#define dialog_unref | ( | dialog, | |
tag | |||
) | ({ ao2_t_cleanup(dialog, tag); (NULL); }) |
Definition at line 33 of file dialog.h.
Referenced by __cleanup_registration(), __dialog_unlink_sched_items(), __find_call(), __sched_check_pendings(), __sip_autodestruct(), __sip_cancel_destroy(), __sip_scheddestroy(), __sip_subscribe_mwi_do(), __start_session_timer(), __start_t38_abort_timer(), __stop_provisional_keepalive(), __stop_reinvite_retry(), __stop_reinviteid(), __stop_session_timer(), __stop_t38_abort_timer(), __update_provisional_keepalive_full(), AST_TEST_DEFINE(), auto_congest(), cb_extensionstate_destroy(), complete_sipch(), dialog_unlink_all(), do_cancel_destroy(), do_dialog_unlink_sched_items(), do_stop_session_timer(), forked_invite_init(), handle_request_subscribe(), handle_response_invite(), handle_response_peerpoke(), handle_response_register(), manager_sipnotify(), proc_session_timer(), reinvite_timeout(), sched_check_pendings(), send_provisional_keepalive_full(), sip_call(), sip_cancel_destroy(), sip_cc_agent_destructor(), sip_cli_notify(), sip_destroy_peer(), sip_hangup(), sip_monitor_instance_destructor(), sip_msg_send(), sip_pkt_dtor(), sip_poke_noanswer(), sip_poke_peer(), sip_pvt_dtor(), sip_reg_timeout(), sip_registry_destroy(), sip_reinvite_retry(), sip_request_call(), sip_scheddestroy_full(), sip_send_mwi_to_peer(), sip_subscribe_mwi_destroy(), sip_t38_abort(), start_session_timer(), start_t38_abort_timer(), stop_provisional_keepalive(), stop_reinvite_retry(), stop_reinviteid(), stop_session_timer(), stop_t38_abort_timer(), transmit_publish(), transmit_register(), and update_provisional_keepalive().
#define sip_alloc | ( | callid, | |
addr, | |||
useglobal_nat, | |||
intended_method, | |||
req, | |||
logger_callid | |||
) | __sip_alloc(callid, addr, useglobal_nat, intended_method, req, logger_callid, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Definition at line 39 of file dialog.h.
Referenced by __find_call(), __sip_subscribe_mwi_do(), AST_TEST_DEFINE(), forked_invite_init(), manager_sipnotify(), sip_cc_monitor_request_cc(), sip_cli_notify(), sip_msg_send(), sip_poke_peer(), sip_request_call(), sip_send_mwi_to_peer(), transmit_publish(), and transmit_register().
int __sip_ack | ( | struct sip_pvt * | p, |
uint32_t | seqno, | ||
int | resp, | ||
int | sipmethod | ||
) |
Acknowledges receipt of a packet and stops retransmission called with p locked.
Definition at line 4570 of file chan_sip.c.
References ao2_t_ref, ast_debug, sip_pvt::callid, FALSE, sip_proxy::force, sip_pkt::is_resp, sip_pkt::method, sip_pkt::next, NULL, sip_pvt::outboundproxy, sip_pvt::packets, sip_pvt::pendinginvite, ref_proxy(), sip_pkt::retransid, sip_pkt::seqno, sipdebug, stop_retrans_pkt(), TRUE, and UNLINK.
Referenced by __sip_pretend_ack(), handle_incoming(), handle_request_invite(), handle_request_publish(), and handle_response().
struct sip_pvt* __sip_alloc | ( | ast_string_field | callid, |
struct ast_sockaddr * | sin, | ||
int | useglobal_nat, | ||
const int | intended_method, | ||
struct sip_request * | req, | ||
ast_callid | logger_callid, | ||
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Allocate sip_pvt structure, set defaults and link in the container. Returns a reference to the object so whoever uses it later must remember to release the reference.
Definition at line 8942 of file chan_sip.c.
References __ao2_alloc(), sip_pvt::allowed_methods, sip_settings::allowtransfer, sip_pvt::allowtransfer, AO2_ALLOC_OPT_LOCK_MUTEX, ao2_cleanup, ao2_t_link, ao2_t_ref, ast_cc_config_params_init, ast_copy_flags, ast_copy_string(), ast_debug, ast_format_cap_alloc, ast_format_cap_append_from_cap(), AST_FORMAT_CAP_FLAG_DEFAULT, AST_LIST_HEAD_INIT_NOLOCK, AST_MEDIA_TYPE_UNKNOWN, ast_random(), AST_RTP_DTMF, ast_sip_ouraddrfor(), ast_sockaddr_copy(), ast_string_field_init, ast_string_field_set, ast_strlen_zero, ast_test_flag, AST_TRANSPORT_UDP, sip_pvt::autoframing, sip_pvt::autokillid, sip_via::branch, sip_pvt::branch, build_callid_pvt(), build_via(), sip_pvt::callid, sip_settings::caps, sip_pvt::caps, sip_pvt::cc_params, check_via(), context, sip_settings::default_context, default_engine, default_fromdomain, default_fromdomainport, sip_settings::default_max_forwards, default_maxcallbitrate, default_mohinterpret, default_mohsuggest, default_parkinglot, default_zone, sip_pvt::do_history, do_setnat(), sip_socket::fd, sip_pvt::flags, free_via(), sip_pvt::fromdomainport, global_autoframing, global_t1, global_timer_b, sip_pvt::init_icseq, INITIAL_CSEQ, sip_pvt::initid, internip, sip_pvt::jointcaps, make_our_tag(), sip_pvt::maxcallbitrate, sip_pvt::maxforwards, sip_pvt::method, mohinterpret, mohsuggest, sip_pvt::noncodeccapability, NONE, NULL, sip_pvt::ocseq, sip_pvt::offered_media, sip_pvt::ourip, parkinglot, parse_via(), sip_pvt::peercaps, sip_pvt::prefcaps, sip_pvt::provisional_keepalive_sched_id, recordhistory, sip_pvt::recv, sip_pvt::redircaps, sip_pvt::reinviteid, sip_pvt::request_queue, sip_pvt::request_queue_sched_id, sip_pvt::rtp, sip_pvt::sa, sip_via::sent_by, sip_pvt::session_modify, sip_pvt::sessionversion_remote, set_socket_transport(), sip_cfg, SIP_DTMF, SIP_DTMF_AUTO, SIP_DTMF_RFC2833, SIP_FLAGS_TO_COPY, sip_get_header(), sip_methods, SIP_OPTIONS, SIP_PAGE2_FLAGS_TO_COPY, SIP_PAGE3_FLAGS_TO_COPY, sip_pvt_callid_set(), sip_pvt_dtor(), SIP_REGISTER, sip_request::socket, sip_pvt::socket, sip_pvt::stateid, sip_pvt::stimer, sip_pvt::subscribed, sip_pvt::t38id, cfsip_methods::text, sip_pvt::timer_b, sip_pvt::timer_t1, TRUE, sip_socket::type, sip_pvt::waitid, and sip_pvt::zone.
void __sip_pretend_ack | ( | struct sip_pvt * | p | ) |
Pretend to ack all packets called with p locked.
Definition at line 4615 of file chan_sip.c.
References __sip_ack(), ast_log, ast_str_buffer(), sip_pkt::data, find_sip_method(), sip_pkt::is_resp, LOG_WARNING, sip_pkt::method, method, NULL, sip_pvt::packets, sip_pkt::seqno, sip_methods, and cfsip_methods::text.
Referenced by __sip_autodestruct(), handle_request_bye(), handle_request_cancel(), and sip_reg_timeout().
int __sip_semi_ack | ( | struct sip_pvt * | p, |
uint32_t | seqno, | ||
int | resp, | ||
int | sipmethod | ||
) |
Acks receipt of packet, keep it around (used for provisional responses)
Definition at line 4632 of file chan_sip.c.
References ast_debug, ast_str_buffer(), sip_pvt::callid, sip_pkt::data, FALSE, sip_pkt::is_resp, method_match(), sip_pkt::next, sip_pvt::packets, sip_pkt::retransid, sip_pkt::seqno, sip_methods, sipdebug, stop_retrans_pkt(), cfsip_methods::text, and TRUE.
Referenced by handle_response(), and sip_hangup().
void dialog_unlink_all | ( | struct sip_pvt * | dialog | ) |
Unlink a dialog from the dialogs container, as well as any other places that it may be currently stored.
Definition at line 3367 of file chan_sip.c.
References __dialog_unlink_sched_items(), ao2_t_replace, ao2_t_unlink, append_history_full(), ast_channel_name(), ast_channel_tech_pvt(), ast_channel_tech_pvt_set(), ast_channel_unlock, ast_channel_unref, ast_debug, ast_extension_state_del(), ast_sched_add(), sip_peer::call, sip_registry::call, cb_extensionstate(), dialog_ref, dialog_unref, do_dialog_unlink_sched_items(), format, sip_peer::mwipvt, NULL, sip_pvt::registry, sip_pvt::relatedpeer, sip_pvt_lock_full(), sip_pvt_unlock, sip_set_owner(), and sip_pvt::stateid.
Referenced by __cleanup_registration(), __sip_autodestruct(), __sip_subscribe_mwi_do(), AST_TEST_DEFINE(), dialog_needdestroy(), handle_request_subscribe(), manager_sipnotify(), sip_cli_notify(), sip_destroy_peer(), sip_msg_send(), sip_poke_noanswer(), sip_poke_peer(), sip_registry_destroy(), sip_request_call(), sip_send_mwi_to_peer(), transmit_publish(), transmit_register(), and unload_module().
void sip_cancel_destroy | ( | struct sip_pvt * | pvt | ) |
Cancel destruction of SIP dialog.
Definition at line 4464 of file chan_sip.c.
References __sip_cancel_destroy(), ast_log, ast_sched_add(), dialog_ref, dialog_unref, sip_pvt::final_destruction_scheduled, and LOG_WARNING.
Referenced by handle_request_invite(), handle_request_subscribe(), handle_response(), handle_response_invite(), register_verify(), and sip_hangup().
void sip_scheddestroy | ( | struct sip_pvt * | p, |
int | ms | ||
) |
Schedule destruction of SIP dialog.
Definition at line 4549 of file chan_sip.c.
References sip_pvt::final_destruction_scheduled, and sip_scheddestroy_full().
Referenced by __sip_autodestruct(), auto_congest(), check_auth(), check_pendings(), extensionstate_update(), handle_incoming(), handle_invite_replaces(), handle_request_cancel(), handle_request_info(), handle_request_invite(), handle_request_notify(), handle_request_options(), handle_request_publish(), handle_request_register(), handle_request_subscribe(), handle_response_invite(), manager_sipnotify(), receive_message(), sip_cli_notify(), sip_hangup(), sip_msg_send(), sip_send_mwi_to_peer(), sip_sipredirect(), transmit_fake_auth_response(), and transmit_publish().
void sip_scheddestroy_final | ( | struct sip_pvt * | p, |
int | ms | ||
) |
Schedule final destruction of SIP dialog.
This function is used to keep a dialog around for a period of time in order to properly respond to any retransmits.
Definition at line 4557 of file chan_sip.c.
References sip_pvt::final_destruction_scheduled, and sip_scheddestroy_full().
Referenced by handle_request_bye().