[asterisk-commits] jrose: trunk r424358 - in /trunk: ./ channels/chan_pjsip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Oct 2 10:33:56 CDT 2014
Author: jrose
Date: Thu Oct 2 10:33:50 2014
New Revision: 424358
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=424358
Log:
chan_pjsip: Fix an assertion for channels that lack formats on creation
ASTERISK-24222 #close
Reported by: Mark Michelson
Review: https://reviewboard.asterisk.org/r/4017/
........
Merged revisions 424333 from http://svn.asterisk.org/svn/asterisk/branches/13
Modified:
trunk/ (props changed)
trunk/channels/chan_pjsip.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.
Modified: trunk/channels/chan_pjsip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_pjsip.c?view=diff&rev=424358&r1=424357&r2=424358
==============================================================================
--- trunk/channels/chan_pjsip.c (original)
+++ trunk/channels/chan_pjsip.c Thu Oct 2 10:33:50 2014
@@ -371,7 +371,6 @@
{
struct ast_channel *chan;
struct ast_format_cap *caps;
- struct ast_format *fmt;
RAII_VAR(struct chan_pjsip_pvt *, pvt, NULL, ao2_cleanup);
struct ast_sip_channel_pvt *channel;
struct ast_variable *var;
@@ -418,16 +417,20 @@
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);
- ast_channel_set_readformat(chan, fmt);
- ast_channel_set_rawreadformat(chan, fmt);
- ao2_ref(fmt, -1);
+ if (!ast_format_cap_empty(caps)) {
+ /*
+ * XXX Probably should pick the first audio codec instead
+ * of simply the first codec. The first codec may be video.
+ */
+ struct ast_format *fmt = ast_format_cap_get_format(caps, 0);
+
+ ast_channel_set_writeformat(chan, fmt);
+ ast_channel_set_rawwriteformat(chan, fmt);
+ ast_channel_set_readformat(chan, fmt);
+ ast_channel_set_rawreadformat(chan, fmt);
+ ao2_ref(fmt, -1);
+ }
+
ao2_ref(caps, -1);
if (state == AST_STATE_RING) {
More information about the asterisk-commits
mailing list