Use correct function for getting bridged peer when doing direct media checks.
authorMark Michelson <mmichelson@digium.com>
Tue, 9 Jul 2013 20:07:21 +0000 (20:07 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 9 Jul 2013 20:07:21 +0000 (20:07 +0000)
(closes issue ASTERISK-21947)
reported by Matt Jordan

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@393897 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_gulp.c

index 144fb6a..b4a5368 100644 (file)
@@ -488,12 +488,14 @@ static int gulp_set_rtp_peer(struct ast_channel *chan,
        struct gulp_pvt *pvt = ast_channel_tech_pvt(chan);
        struct ast_sip_session *session = pvt->session;
        int changed = 0;
+       struct ast_channel *bridge_peer;
 
-       /* BUGBUG - ast_bridged_channel will always return NULL, meaning direct media will never occur */
        /* Don't try to do any direct media shenanigans on early bridges */
-       if ((rtp || vrtp || tpeer) && !ast_bridged_channel(chan)) {
+       bridge_peer = ast_channel_bridge_peer(chan);
+       if ((rtp || vrtp || tpeer) && !bridge_peer) {
                return 0;
        }
+       ast_channel_cleanup(bridge_peer);
 
        if (nat_active && session->endpoint->disable_direct_media_on_nat) {
                return 0;