Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/channel.h"
#include "asterisk/format.h"
#include "asterisk/format_cap.h"
#include "asterisk/logger.h"
#include "asterisk/sorcery.h"
#include "asterisk/stream.h"
#include "asterisk/res_pjsip.h"
#include "asterisk/res_pjsip_session.h"
#include "asterisk/res_pjsip_session_caps.h"
Go to the source code of this file.
Functions | |
struct ast_format_cap * | ast_sip_create_joint_call_cap (const struct ast_format_cap *remote, struct ast_format_cap *local, enum ast_media_type media_type, struct ast_flags codec_pref) |
Create joint capabilities. More... | |
struct ast_format_cap * | ast_sip_session_create_joint_call_cap (const struct ast_sip_session *session, enum ast_media_type media_type, const struct ast_format_cap *remote) |
Create joint capabilities. More... | |
struct ast_stream * | ast_sip_session_create_joint_call_stream (const struct ast_sip_session *session, struct ast_stream *remote_stream) |
Create a new stream of joint capabilities. More... | |
static void | log_caps (int level, const char *file, int line, const char *function, const struct ast_sip_session *session, enum ast_media_type media_type, const struct ast_format_cap *local, const struct ast_format_cap *remote, const struct ast_format_cap *joint) |
struct ast_format_cap * ast_sip_create_joint_call_cap | ( | const struct ast_format_cap * | remote, |
struct ast_format_cap * | local, | ||
enum ast_media_type | media_type, | ||
struct ast_flags | codec_pref | ||
) |
Create joint capabilities.
Creates a list of joint capabilities between the given remote capabilities, and local ones. "local" and "remote" reference the values in ast_sip_call_codec_pref.
remote | The "remote" capabilities |
local | The "local" capabilities |
media_type | The media type |
codec_pref | One or more of enum ast_sip_call_codec_pref |
A | pointer to the joint capabilities (which may be empty). NULL will be returned only if no memory was available to allocate the structure. |
Definition at line 65 of file pjsip_session_caps.c.
References ao2_cleanup, ao2_ref, ast_codec_media_type2str(), ast_format_cap_alloc, ast_format_cap_append, ast_format_cap_append_from_cap(), ast_format_cap_empty(), AST_FORMAT_CAP_FLAG_DEFAULT, ast_format_cap_get_compatible(), ast_format_cap_get_format(), ast_format_cap_remove_by_type(), ast_log, AST_MEDIA_TYPE_UNKNOWN, ast_sip_call_codec_pref_test, LOG_ERROR, and NULL.
Referenced by ast_sip_session_create_joint_call_cap(), ast_sip_session_create_joint_call_stream(), and test_create_joint().
struct ast_format_cap * ast_sip_session_create_joint_call_cap | ( | const struct ast_sip_session * | session, |
enum ast_media_type | media_type, | ||
const struct ast_format_cap * | remote | ||
) |
Create joint capabilities.
Creates a list of joint capabilities between the given session's local capabilities, and the remote capabilities. Codec selection is based on the session->endpoint's codecs, the session->endpoint's codec call preferences, and the "remote" capabilities passed by the core (for outgoing calls) or created by the incoming SDP (for incoming calls).
session | The session |
media_type | The media type |
remote | Capabilities received in an SDP offer or from the core |
A | pointer to the joint capabilities (which may be empty). NULL will be returned only if no memory was available to allocate the structure. |
Definition at line 151 of file pjsip_session_caps.c.
References ast_sip_create_joint_call_cap(), AST_SIP_SESSION_OUTGOING_CALL, log_caps(), LOG_DEBUG, and session.
Referenced by set_incoming_call_offer_cap().
struct ast_stream * ast_sip_session_create_joint_call_stream | ( | const struct ast_sip_session * | session, |
struct ast_stream * | remote | ||
) |
Create a new stream of joint capabilities.
Creates a new stream with capabilities between the given session's local capabilities, and the remote stream's. Codec selection is based on the session->endpoint's codecs, the session->endpoint's codec call preferences, and the stream passed by the core (for outgoing calls) or created by the incoming SDP (for incoming calls).
session | The session |
remote | The remote stream |
A | pointer to a new stream with the joint capabilities (which may be empty), NULL will be returned only if no memory was available to allocate the structure. |
Definition at line 130 of file pjsip_session_caps.c.
References ao2_cleanup, ast_sip_create_joint_call_cap(), AST_SIP_SESSION_OUTGOING_CALL, ast_stream_clone(), ast_stream_get_formats(), ast_stream_get_type(), ast_stream_set_formats(), log_caps(), LOG_DEBUG, NULL, and session.
Referenced by ast_sip_session_create_outgoing().
|
static |
Definition at line 32 of file pjsip_session_caps.c.
References __LOG_DEBUG, ast_channel_name(), ast_codec_media_type2str(), ast_format_cap_get_names(), AST_FORMAT_CAP_NAMES_LEN, ast_log, ast_sip_call_codec_pref_to_str(), AST_SIP_SESSION_OUTGOING_CALL, ast_sorcery_object_get_id(), ast_str_alloca, DEBUG_ATLEAST, make_ari_stubs::file, NULL, and session.
Referenced by ast_sip_session_create_joint_call_cap(), and ast_sip_session_create_joint_call_stream().