diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 47b90d7240bf149995880910172b83500ecd3904..780168181a0ce0413a46121d97fd49c0969baffb 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -8153,12 +8153,17 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit We also check for vrtp. If it's not there, we are not allowed do any video anyway. */ if (i->vrtp) { - if (ast_test_flag(&i->flags[1], SIP_PAGE2_VIDEOSUPPORT)) + if (ast_test_flag(&i->flags[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS)) needvideo = 1; else if (ast_format_cap_count(i->prefcaps)) needvideo = ast_format_cap_has_type(i->prefcaps, AST_MEDIA_TYPE_VIDEO); /* Outbound call */ else needvideo = ast_format_cap_has_type(i->jointcaps, AST_MEDIA_TYPE_VIDEO); /* Inbound call */ + + if (!needvideo) { + ast_rtp_instance_destroy(i->vrtp); + i->vrtp = NULL; + } } if (i->trtp) {