res_pjsip_sdp_rtp.c: Fix native formats containing formats that were not negotiated.

Outgoing PJSIP calls can result in non-negotiated formats listed in the
channel's native formats if video formats are listed in the endpoint's
configuration.  The resulting call could then use a non-negotiated format
resulting in one way audio.

* Simplified the update of session->req_caps in set_caps().  Why do
something in five steps when only one is needed?

AFS-162 #close

Review: https://reviewboard.asterisk.org/r/4000/
........

Merged revisions 423561 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@423563 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2014-09-19 17:16:32 +00:00
parent 6dae345674
commit ec0313c411
2 changed files with 18 additions and 5 deletions

View File

@@ -417,6 +417,11 @@ static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int s
}
ast_channel_nativeformats_set(chan, caps);
/*
* XXX Probably should pick the first audio codec instead
* of simply the first codec. The first codec may be video.
*/
fmt = ast_format_cap_get_format(caps, 0);
ast_channel_set_writeformat(chan, fmt);
ast_channel_set_rawwriteformat(chan, fmt);