[asterisk-dev] [Code Review] 2535: Add ability to call a function when a channel leaves the bridging system.

rmudgett reviewboard at asterisk.org
Mon May 13 14:12:47 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2535/
-----------------------------------------------------------

Review request for Asterisk Developers, David Lee, Matt Jordan, and Mark Michelson.


Bugs: ASTERISK-21640
    https://issues.asterisk.org/jira/browse/ASTERISK-21640


Repository: Asterisk


Description
-------

There are times when a module would like to gain control of a channel that is already in the bridging system but the module does not want the channel in the bridging system when it gains control.

1) The mythical app_queue holding priority bridge when the channel is selected to dial an agent.
2) Stasis-HTTP when it needs to gain control before it initiates dialing.
3) Attended transferring a bridged channel to an application.

Example usage:
ast_after_bridge_callback_set(chan, callback_fn, failed_fn, data);
ast_bridge_remove(bridge, chan)

When the channel leaves the bridge the callback_fn(chan, data) will be made.


Diffs
-----

  /team/group/bridge_construction/include/asterisk/bridging.h 388574 
  /team/group/bridge_construction/main/bridging.c 388574 

Diff: https://reviewboard.asterisk.org/r/2535/diff/


Testing
-------

Added test code to add a callback when a channel leaves a bridge.
1) The callback was called when the channel left the bridge and was not hung up.
2) The failed callback was called when the channel simply hung up.

Added an explicit remove of the callback datastore.
The failed callback was called as expected.


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130513/6b0ce279/attachment-0001.htm>


More information about the asterisk-dev mailing list