aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 72af50aca..459d17d30 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -4132,10 +4132,10 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
return &ast_null_frame;
/* We already hold the channel lock */
- if (!p->owner || f->frametype != AST_FRAME_VOICE)
+ if (!p->owner || (f && f->frametype != AST_FRAME_VOICE))
return f;
- if (f->subclass != (p->owner->nativeformats & AST_FORMAT_AUDIO_MASK)) {
+ if (f && f->subclass != (p->owner->nativeformats & AST_FORMAT_AUDIO_MASK)) {
if (!(f->subclass & p->jointcapability)) {
if (option_debug) {
ast_log(LOG_DEBUG, "Bogus frame of format '%s' received from '%s'!\n",
@@ -4150,7 +4150,7 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
ast_set_write_format(p->owner, p->owner->writeformat);
}
- if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) && p->vad) {
+ if (f && (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) && p->vad) {
f = ast_dsp_process(p->owner, p->vad, f);
if (f && f->frametype == AST_FRAME_DTMF) {
if (ast_test_flag(&p->t38.t38support, SIP_PAGE2_T38SUPPORT_UDPTL) && f->subclass == 'f') {