summaryrefslogtreecommitdiff
path: root/res/res_pjsip_session.c
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2017-07-10 18:17:44 -0500
committerKevin Harwell <kharwell@digium.com>2017-07-13 18:19:35 -0500
commit7da6ddda30ab9291ec810fa88d4219145616bae8 (patch)
tree89ad7fa5ae53b18a0a6412e85903ff7d8cd9d58b /res/res_pjsip_session.c
parent0f45c979a3de00b320e05ba93309cf412e9e2702 (diff)
res_pjsip: Add "webrtc" configuration option
This patch creates a new configuration option called "webrtc". When enabled it defaults and enables the following options that are needed in order for webrtc to work in Asterisk: rtcp-mux, use_avpf, ice_support, and use_received_transport=enabled media_encryption=dtls dtls_verify=fingerprint dtls_setup=actpass When "webrtc" is enabled, this patch also parses the "msid" media level attribute from an SDP. It will also appropriately add it onto the outgoing session when applicable. Lastly, when "webrtc" is enabled h264 RTCP FIR feedback frames are now sent. ASTERISK-27119 #close Change-Id: I5ec02e07c5d5b9ad86a34fdf31bf2f9da9aac6fd
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r--res/res_pjsip_session.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c
index 315db6df5..fe3680f3b 100644
--- a/res/res_pjsip_session.c
+++ b/res/res_pjsip_session.c
@@ -395,6 +395,7 @@ static void session_media_dtor(void *obj)
}
ast_free(session_media->mid);
+ ast_free(session_media->msid);
}
struct ast_sip_session_media *ast_sip_session_media_state_add(struct ast_sip_session *session,
@@ -3573,15 +3574,17 @@ static int add_bundle_groups(struct ast_sip_session *session, pj_pool_t *pool, p
int index, mid_id;
struct sip_session_media_bundle_group *bundle_group;
+ if (session->endpoint->media.webrtc) {
+ attr = pjmedia_sdp_attr_create(pool, "msid-semantic", pj_cstr(&stmp, "WMS *"));
+ pjmedia_sdp_attr_add(&answer->attr_count, answer->attr, attr);
+ }
+
if (!session->endpoint->media.bundle) {
return 0;
}
memset(bundle_groups, 0, sizeof(bundle_groups));
- attr = pjmedia_sdp_attr_create(pool, "msid-semantic", pj_cstr(&stmp, "WMS *"));
- pjmedia_sdp_attr_add(&answer->attr_count, answer->attr, attr);
-
/* Build the bundle group layout so we can then add it to the SDP */
for (index = 0; index < AST_VECTOR_SIZE(&session->pending_media_state->sessions); ++index) {
struct ast_sip_session_media *session_media = AST_VECTOR_GET(&session->pending_media_state->sessions, index);