Asterisk - The Open Source Telephony Project GIT-master-a358458
res_pjsip_session_caps.h
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (C) 2020, Sangoma Technologies Corporation
5 *
6 * Kevin Harwell <kharwell@sangoma.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18#ifndef RES_PJSIP_SESSION_CAPS_H
19#define RES_PJSIP_SESSION_CAPS_H
20
21struct ast_format_cap;
22struct ast_sip_session;
23
24/*!
25 * \brief Create joint capabilities
26 * \since 18.0.0
27 *
28 * Creates a list of joint capabilities between the given remote capabilities, and local ones.
29 * "local" and "remote" reference the values in ast_sip_call_codec_pref.
30 *
31 * \param remote The "remote" capabilities
32 * \param local The "local" capabilities
33 * \param media_type The media type
34 * \param codec_pref One or more of enum ast_sip_call_codec_pref
35 *
36 * \retval A pointer to the joint capabilities (which may be empty).
37 * NULL will be returned only if no memory was available to allocate the structure.
38 * \note Returned object's reference must be released at some point,
39 */
41 struct ast_format_cap *local, enum ast_media_type media_type,
42 struct ast_flags codec_pref);
43
44/*!
45 * \brief Create a new stream of joint capabilities
46 * \since 18.0.0
47 *
48 * Creates a new stream with capabilities between the given session's local capabilities,
49 * and the remote stream's. Codec selection is based on the session->endpoint's codecs, the
50 * session->endpoint's codec call preferences, and the stream passed by the core (for
51 * outgoing calls) or created by the incoming SDP (for incoming calls).
52 *
53 * \param session The session
54 * \param remote The remote stream
55 *
56 * \retval A pointer to a new stream with the joint capabilities (which may be empty),
57 * NULL will be returned only if no memory was available to allocate the structure.
58 */
60 struct ast_stream *remote);
61
62/*!
63 * \brief Create joint capabilities
64 * \since 18.0.0
65 *
66 * Creates a list of joint capabilities between the given session's local capabilities,
67 * and the remote capabilities. Codec selection is based on the session->endpoint's codecs, the
68 * session->endpoint's codec call preferences, and the "remote" capabilities passed by the core (for
69 * outgoing calls) or created by the incoming SDP (for incoming calls).
70 *
71 * \param session The session
72 * \param media_type The media type
73 * \param remote Capabilities received in an SDP offer or from the core
74 *
75 * \retval A pointer to the joint capabilities (which may be empty).
76 * NULL will be returned only if no memory was available to allocate the structure.
77 * \note Returned object's reference must be released at some point,
78 */
80 enum ast_media_type media_type, const struct ast_format_cap *remote);
81
82#endif /* RES_PJSIP_SESSION_CAPS_H */
static struct ast_mansession session
ast_media_type
Types of media.
Definition: codec.h:30
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.
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.
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.
Structure used to handle boolean flags.
Definition: utils.h:199
Format capabilities structure, holds formats + preference order + etc.
Definition: format_cap.c:54
A structure describing a SIP session.