mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Fix stuck channel in ARI through the introduction of synchronous bridge actions.
Playing back a file to a channel in an ARI bridge would attempt to wait until the playback concluded before returning. The method used involved signaling the waiting thread in the ARI custom playback function. The problem with this is that there were some corner cases that were not accounted for: * If a bridge channel could not be found, then we never would attempt the playback but would still attempt to wait for the playback to complete. * If the bridge playfile action failed to queue, we would still attempt to wait for the playback to complete. * If the bridge playfile action were queued but some circumstance caused the playback not to occur (the bridge dies, the channel is removed from the bridge), then we would never be notified. The solution to this is to move the waiting logic into the bridge code. A new bridge API function is added to queue a synchronous action on a bridge. The waiting thread is notified when the queued frame has been freed, either due to an error occurring or due to successful playback. As a failsafe, the waiting thread has a 10 minute timeout just in case there is a frame leak somewhere. Review: https://reviewboard.asterisk.org/r/3338 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@410673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -639,6 +639,10 @@ void ast_frame_subclass2str(struct ast_frame *f, char *subclass, size_t slen, ch
|
||||
/* Should never happen */
|
||||
snprintf(subclass, slen, "Bridge Frametype %d", f->subclass.integer);
|
||||
break;
|
||||
case AST_FRAME_BRIDGE_ACTION_SYNC:
|
||||
/* Should never happen */
|
||||
snprintf(subclass, slen, "Synchronous Bridge Frametype %d", f->subclass.integer);
|
||||
break;
|
||||
case AST_FRAME_TEXT:
|
||||
ast_copy_string(subclass, "N/A", slen);
|
||||
if (moreinfo) {
|
||||
@@ -730,6 +734,10 @@ void ast_frame_type2str(enum ast_frame_type frame_type, char *ftype, size_t len)
|
||||
/* Should never happen */
|
||||
ast_copy_string(ftype, "Bridge Specific", len);
|
||||
break;
|
||||
case AST_FRAME_BRIDGE_ACTION_SYNC:
|
||||
/* Should never happen */
|
||||
ast_copy_string(ftype, "Bridge Specific", len);
|
||||
break;
|
||||
case AST_FRAME_TEXT:
|
||||
ast_copy_string(ftype, "Text", len);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user