mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
Fix for chan_skinny leaving RTP ports open
Skinny wasn't closing RTP sockets. This patch includes ast_rtp_instance_stop before ast_rtp_instance_destroy which fixes the problem. Also add destroy for VRTP (which I believe is unused, but exists). Review: https://reviewboard.asterisk.org/r/2176/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@375660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -4234,6 +4234,22 @@ static void start_rtp(struct skinny_subchannel *sub)
|
||||
ast_mutex_unlock(&sub->lock);
|
||||
}
|
||||
|
||||
static void destroy_rtp(struct skinny_subchannel *sub)
|
||||
{
|
||||
if (sub->rtp) {
|
||||
SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %d - Destroying RTP\n", sub->callid);
|
||||
ast_rtp_instance_stop(sub->rtp);
|
||||
ast_rtp_instance_destroy(sub->rtp);
|
||||
sub->rtp = NULL;
|
||||
}
|
||||
if (sub->vrtp) {
|
||||
SKINNY_DEBUG(DEBUG_AUDIO, 3, "Sub %d - Destroying VRTP\n", sub->callid);
|
||||
ast_rtp_instance_stop(sub->vrtp);
|
||||
ast_rtp_instance_destroy(sub->vrtp);
|
||||
sub->vrtp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void *skinny_newcall(void *data)
|
||||
{
|
||||
struct ast_channel *c = data;
|
||||
@@ -4467,10 +4483,7 @@ static int skinny_hangup(struct ast_channel *ast)
|
||||
ast_mutex_lock(&sub->lock);
|
||||
sub->owner = NULL;
|
||||
ast_channel_tech_pvt_set(ast, NULL);
|
||||
if (sub->rtp) {
|
||||
ast_rtp_instance_destroy(sub->rtp);
|
||||
sub->rtp = NULL;
|
||||
}
|
||||
destroy_rtp(sub);
|
||||
ast_mutex_unlock(&sub->lock);
|
||||
ast_free(sub);
|
||||
ast_module_unref(ast_module_info->self);
|
||||
@@ -5092,10 +5105,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state)
|
||||
|
||||
sub->cxmode = SKINNY_CX_RECVONLY;
|
||||
sub->substate = SUBSTATE_ONHOOK;
|
||||
if (sub->rtp) {
|
||||
ast_rtp_instance_destroy(sub->rtp);
|
||||
sub->rtp = NULL;
|
||||
}
|
||||
destroy_rtp(sub);
|
||||
sub->substate = SUBSTATE_ONHOOK;
|
||||
if (sub->owner) {
|
||||
ast_queue_hangup(sub->owner);
|
||||
@@ -5205,10 +5215,7 @@ static void setsubstate(struct skinny_subchannel *sub, int state)
|
||||
|
||||
sub->cxmode = SKINNY_CX_RECVONLY;
|
||||
sub->substate = SUBSTATE_ONHOOK;
|
||||
if (sub->rtp) {
|
||||
ast_rtp_instance_destroy(sub->rtp);
|
||||
sub->rtp = NULL;
|
||||
}
|
||||
destroy_rtp(sub);
|
||||
if (sub->owner) {
|
||||
ast_queue_hangup(sub->owner);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user