Use the configured formats for Gulp sessions if there are no joint formats between...
authorJoshua Colp <jcolp@digium.com>
Fri, 3 May 2013 11:35:14 +0000 (11:35 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 3 May 2013 11:35:14 +0000 (11:35 +0000)
(closes issue ASTERISK-21756)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@387545 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_gulp.c
res/res_sip_sdp_rtp.c

index 3959874..0b7dedf 100644 (file)
@@ -434,7 +434,7 @@ static struct ast_channel *gulp_new(struct ast_sip_session *session, int state,
        pvt->media[SIP_MEDIA_VIDEO] = ao2_find(session->media, "video", OBJ_KEY);
        ast_channel_tech_pvt_set(chan, pvt);
 
-       if (ast_format_cap_is_empty(session->req_caps)) {
+       if (ast_format_cap_is_empty(session->req_caps) || !ast_format_cap_has_joint(session->req_caps, session->endpoint->codecs)) {
                ast_format_cap_copy(ast_channel_nativeformats(chan), session->endpoint->codecs);
        } else {
                ast_format_cap_copy(ast_channel_nativeformats(chan), session->req_caps);
index 13e6aa1..d0af479 100644 (file)
@@ -556,7 +556,7 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
 
        if (direct_media_enabled) {
                ast_format_cap_joint_copy(session->endpoint->codecs, session->direct_media_cap, caps);
-       } else if (ast_format_cap_is_empty(session->req_caps)) {
+       } else if (ast_format_cap_is_empty(session->req_caps) || !ast_format_cap_has_joint(session->req_caps, session->endpoint->codecs)) {
                ast_format_cap_copy(caps, session->endpoint->codecs);
        } else {
                ast_format_cap_joint_copy(session->endpoint->codecs, session->req_caps, caps);