[asterisk-bugs] [Asterisk 0012513]: RTP is not reinvited back to Asterisk when a native bridge is broken by AMI redirect on both channels
noreply at bugs.digium.com
noreply at bugs.digium.com
Thu Apr 24 07:47:03 CDT 2008
The following issue has been SUBMITTED.
======================================================================
http://bugs.digium.com/view.php?id=12513
======================================================================
Reported By: mneuhauser
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 12513
Category: Channels/chan_sip/General
Reproducibility: always
Severity: major
Priority: normal
Status: new
Asterisk Version: SVN
SVN Branch (only for SVN checkouts, not tarball releases): 1.4
SVN Revision (number only!): 114602
Disclaimer on File?: N/A
Request Review:
======================================================================
Date Submitted: 04-24-2008 07:47 CDT
Last Modified: 04-24-2008 07:47 CDT
======================================================================
Summary: RTP is not reinvited back to Asterisk when a native
bridge is broken by AMI redirect on both channels
Description:
Two SIP channels are natively bridged, i.e., RTP flows directly between
them and not through Asterisk. A Redirect command is received on AMI that
redirects both channels of the bridge to some extension (to add both to a
conference, but it does not matter). The problem is. that the RTP of only
one of the channels is reinvited back to Asterisk but not the other's.
This happens:
* manager.c:action_redirect() locks both channels and calls
ast_async_goto() on both of them
* pbx.c:ast_async_goto() does a
ast_explicit_goto()/ast_softhangup_nolock() on one channel (the one with
chan->pbx set) and a masquerade on the other
* the redirected channels are both handled by one thread in
rtp.c:bridge_native_loop()
* rtp.c:bridge_native_loop() terminates because a softhangup was performed
on the non-masqueraded channel and prX->set_rtp_peer(cX, NULL, NULL, 0, 0)
is called on both channels (to reinvited RTP back to Asterisk), but one of
the channels has already been masqueraded and is a zombie, i.e.,
set_rtp_peer() is NOT called for this channel and RTP is not reinvited back
to Asterisk.
I think the easiest way to fix this is to perform the
re-invite-back-to-Asterisk in the chan_sip.c:sip_fixup() function that is
called during all masquerade operations performed on SIP channels (see
attached patch). I think this is save to do there because a channel can not
be masqueraded *into* a native bridge, only *out* of one. So there is no
danger that this breaks a native bridge that should stay up.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
04-24-08 07:47 mneuhauser Asterisk Version => SVN
04-24-08 07:47 mneuhauser SVN Branch (only for SVN checkou => 1.4
04-24-08 07:47 mneuhauser SVN Revision (number only!) => 114602
======================================================================
More information about the asterisk-bugs
mailing list