* originated from and update the frame to include it.
*/
stream = default_stream = ast_channel_get_default_stream(chan, ast_format_get_type(f->subclass.format));
- f->stream_num = ast_stream_get_position(stream);
+ /* In order to allow media to be passed up the underlying media type has to have a format negotiated on
+ * the channel itself. In cases where this hasn't happened the channel driver is incorrectly passing up
+ * a frame for a format that has not been negotiated. If this occurs just drop the frame as we have no
+ * stream that it came from.
+ */
+ if (!stream) {
+ ast_frfree(f);
+ f = &ast_null_frame;
+ } else {
+ f->stream_num = ast_stream_get_position(stream);
+ }
}
}
} else {
*/
if (f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO)) {
stream = default_stream = ast_channel_get_default_stream(chan, ast_format_get_type(f->subclass.format));
- f->stream_num = ast_stream_get_position(stream);
+ if (!stream) {
+ ast_frfree(f);
+ f = &ast_null_frame;
+ } else {
+ f->stream_num = ast_stream_get_position(stream);
+ }
}
}
else
}
ast_rwlock_unlock(&codecs->codecs_lock);
- if (!type) {
+ if (!type && payload <= AST_RTP_PT_LAST_STATIC) {
ast_rwlock_rdlock(&static_RTP_PT_lock);
type = ao2_bump(static_RTP_PT[payload]);
ast_rwlock_unlock(&static_RTP_PT_lock);