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
This commit is contained in:
Kevin Harwell
2017-07-10 18:17:44 -05:00
parent 0f45c979a3
commit 7da6ddda30
9 changed files with 151 additions and 7 deletions

View File

@@ -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);