|
Asterisk - The Open Source Telephony Project GIT-master-57e2743
|
Channel-locked PJSIP information for CHANNEL() reads. More...
#include "asterisk.h"#include <pjsip.h>#include "asterisk/astobj2.h"#include "asterisk/channel.h"#include "asterisk/datastore.h"#include "asterisk/res_pjsip.h"#include "asterisk/res_pjsip_session.h"#include "asterisk/rtp_engine.h"#include "include/channel_info.h"
Go to the source code of this file.
Functions | |
| static void | channel_info_breakdown (void *data, struct ast_channel *old_chan, struct ast_channel *new_chan) |
| static void | channel_info_destroy (void *data) |
| static int | channel_info_incoming_request (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
| static void | channel_info_incoming_response (struct ast_sip_session *session, struct pjsip_rx_data *rdata) |
| static void | channel_info_outgoing_request (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
| static void | channel_info_outgoing_response (struct ast_sip_session *session, struct pjsip_tx_data *tdata) |
| static void | channel_info_update_locked (struct pjsip_channel_info *info, struct ast_sip_session *session) |
| static int | channel_info_update_task (void *data) |
| static int | copy_uri (struct pjsip_channel_uri *dest, pjsip_uri_context_e context, const void *uri, const char *type) |
| int | pjsip_channel_info_create (struct ast_channel *chan, struct ast_sip_session *session) |
| Create channel-owned PJSIP information before channel publication. | |
| struct pjsip_channel_info * | pjsip_channel_info_get (struct ast_channel *chan) |
| Find the channel's information, or NULL if it has none. | |
| void | pjsip_channel_info_register (void) |
| Register the channel information session supplement. | |
| void | pjsip_channel_info_schedule_update (struct ast_sip_session *session) |
| Schedule a refresh from any thread without waiting for the serializer. | |
| void | pjsip_channel_info_unregister (void) |
| Unregister the channel information session supplement. | |
| void | pjsip_channel_info_update (struct ast_sip_session *session) |
| Refresh channel information under the channel lock. | |
Variables | |
| static const struct ast_datastore_info | channel_info_datastore |
| static struct ast_sip_session_supplement | channel_info_supplement |
Channel-locked PJSIP information for CHANNEL() reads.
The channel datastore owns cached dialog URIs, the remote tag, signaling security, RTP instance references, and media security and hold flags. Readers and writers access the cache under the channel lock. A datastore lookup returns a borrowed pointer valid only while that lock is held.
Session serializer tasks refresh the cache through session->channel. SIP supplements refresh it during incoming message processing and queue refreshes for subsequent changes. Masquerades suspend the serializer while changing the channel association and move the datastore with the channel.
CHANNEL() reads use the cache for values that SIP and SDP processing can change without the channel lock. Stable identity and original request information are read directly from the session. Direct-media addresses are read under the channel lock. RTP APIs supply RTP addresses and statistics.
These reads do not wait for the session serializer or acquire the dialog lock while holding the channel lock to avoid a deadlock with masquerade processing.
Definition in file channel_info.c.
|
static |
Definition at line 67 of file channel_info.c.
References ast_channel_datastore_remove(), ast_datastore_free(), and ast_datastore::info.
|
static |
Definition at line 57 of file channel_info.c.
References ao2_cleanup, and ast_free.
|
static |
Definition at line 252 of file channel_info.c.
References pjsip_channel_info_schedule_update(), pjsip_channel_info_update(), and session.
|
static |
Definition at line 260 of file channel_info.c.
References pjsip_channel_info_schedule_update(), pjsip_channel_info_update(), and session.
|
static |
Definition at line 267 of file channel_info.c.
References pjsip_channel_info_schedule_update(), and session.
|
static |
Definition at line 273 of file channel_info.c.
References pjsip_channel_info_schedule_update(), and session.
|
static |
Definition at line 122 of file channel_info.c.
References ao2_replace, ast_free, ast_log, AST_MEDIA_TYPE_AUDIO, AST_MEDIA_TYPE_VIDEO, ast_sip_get_pjsip_endpoint(), AST_SRTP_CRYPTO_OFFER_OK, ast_strndup, ast_test_flag, copy(), copy_uri(), LOG_WARNING, NULL, ast_sip_session_media::remotely_held, ast_sip_session_media::rtp, session, and ast_sip_session_media::srtp.
Referenced by pjsip_channel_info_create(), and pjsip_channel_info_update().
|
static |
Definition at line 229 of file channel_info.c.
References ao2_ref, pjsip_channel_info_update(), and session.
Referenced by pjsip_channel_info_schedule_update().
|
static |
Definition at line 98 of file channel_info.c.
References ast_copy_string(), ast_log, pjsip_channel_uri::length, LOG_ERROR, type, pjsip_channel_uri::value, and value.
Referenced by channel_info_update_locked().
| int pjsip_channel_info_create | ( | struct ast_channel * | chan, |
| struct ast_sip_session * | session | ||
| ) |
Create channel-owned PJSIP information before channel publication.
| 0 | on success |
| -1 | on failure |
Definition at line 187 of file channel_info.c.
References ast_calloc, ast_channel_datastore_add(), ast_datastore_alloc, ast_datastore_free(), channel_info_datastore, channel_info_update_locked(), ast_datastore::data, pjsip_channel_info::datastore, NULL, and session.
Referenced by chan_pjsip_new().
| struct pjsip_channel_info * pjsip_channel_info_get | ( | struct ast_channel * | chan | ) |
Find the channel's information, or NULL if it has none.
Definition at line 89 of file channel_info.c.
References ast_channel_datastore_find(), channel_info_datastore, ast_datastore::data, and NULL.
Referenced by channel_read_pjsip(), pjsip_acf_channel_read(), and pjsip_channel_info_update().
| void pjsip_channel_info_register | ( | void | ) |
Register the channel information session supplement.
Definition at line 289 of file channel_info.c.
References ast_sip_session_register_supplement, and channel_info_supplement.
Referenced by load_module().
| void pjsip_channel_info_schedule_update | ( | struct ast_sip_session * | session | ) |
Schedule a refresh from any thread without waiting for the serializer.
Definition at line 238 of file channel_info.c.
References ao2_bump, ao2_ref, ast_log, ast_sip_push_task, ast_sip_session_get_name(), channel_info_update_task(), LOG_WARNING, and session.
Referenced by channel_info_incoming_request(), channel_info_incoming_response(), channel_info_outgoing_request(), and channel_info_outgoing_response().
| void pjsip_channel_info_unregister | ( | void | ) |
Unregister the channel information session supplement.
Definition at line 294 of file channel_info.c.
References ast_sip_session_unregister_supplement(), and channel_info_supplement.
Referenced by load_module(), and unload_module().
| void pjsip_channel_info_update | ( | struct ast_sip_session * | session | ) |
Refresh channel information under the channel lock.
Definition at line 212 of file channel_info.c.
References ast_channel_lock, ast_channel_unlock, channel_info_update_locked(), pjsip_channel_info_get(), and session.
Referenced by channel_info_incoming_request(), channel_info_incoming_response(), channel_info_update_task(), and send_direct_media_request().
|
static |
Definition at line 83 of file channel_info.c.
Referenced by pjsip_channel_info_create(), and pjsip_channel_info_get().
|
static |
Definition at line 279 of file channel_info.c.
Referenced by pjsip_channel_info_register(), and pjsip_channel_info_unregister().