diff --git a/src/channels/chan_voicemngr.c b/src/channels/chan_voicemngr.c index ecb496b02d36271bcc384273ff030c077bd6a96b..fe1bf6833631cafadd9f60ae84c66e6be6efa21d 100644 --- a/src/channels/chan_voicemngr.c +++ b/src/channels/chan_voicemngr.c @@ -802,7 +802,7 @@ static void chan_voicemngr_modify_codec(struct chan_voicemngr_subchannel *sub) { ast_channel_codec_set(sub->owner, !ast_strlen_zero(ast_channel_codec_get(bridged_chan)) ? ast_channel_codec_get(bridged_chan) : ast_format_get_name(ast_channel_writeformat(bridged_chan))); } - ao2_ref(bridged_chan, -1); + ast_channel_unref(bridged_chan); } else if (ast_strlen_zero(ast_channel_codec_get(sub->owner))) { //return if has no codec set ast_channel_unlock(sub->owner); @@ -929,6 +929,7 @@ static int chan_voicemngr_indicate(struct ast_channel *ast, int condition, const ast_log(LOG_ERROR, "ast_transfer() is not supported on the peer channel\n"); } ast_channel_unlock(bridged_chan); + ast_channel_unref(bridged_chan); } else { ast_log(LOG_ERROR, "can't get the peer channel, unattended call transfer will not be proceeded\n"); } @@ -5611,6 +5612,13 @@ static void chan_voicemngr_attended_call_transfer(struct chan_voicemngr_subchann } else { ast_log(LOG_ERROR, "can't get the peer channel\n"); } + + if (bridged_chan_inactive) { + ast_channel_unref(bridged_chan_inactive); + } + if (bridged_chan_active) { + ast_channel_unref(bridged_chan_active); + } } } else @@ -5921,7 +5929,7 @@ static int chan_voicemngr_get_sip_client_id(struct chan_voicemngr_subchannel *su bridged_chan = ast_channel_bridge_peer(sub->owner); if (bridged_chan) { res = sscanf(ast_channel_name(bridged_chan), "PJSIP/sip%d", &sip_client_id); - ao2_ref(bridged_chan, -1); + ast_channel_unref(bridged_chan); if (sip_client_id >= 0 && sip_client_id < MAX_SIP_CLIENTS && res == 1) { sub->sip_client_id = sip_client_id; }