[asterisk-dev] [Code Review] bridging: Interval hooks continued

Kaloyan Kovachev kkovachev at varna.net
Wed Feb 13 03:32:15 CST 2013


On Tue, 12 Feb 2013 23:25:51 -0000, "jrose" <reviewboard at asterisk.org>
wrote:

<snip>

> 4) ast_bridge_features_set_limits() must not save a pointer to the
limits
> struct in the hook.  In this case the peer channel will likely have a
> stale pointer when ast_bridge_call() is changed to not expect to get the
> peer back.  Also transfers could move the peer channel to another
bridge.
> ast_bridge_features_set_limits() should copy the limits information into
> its own structure so it is independent.
> 
> * ast_bridge_features_set_limits now copies the contents of the limits
> struct into a freshly allocated struct and applies it to the bridge
> channel's
> features struct. Only one can be applied to a bridge channel at a time
> right
> now and I'm unsure if that should be changed or if a mechanism for
> overwriting
> it should be provided.
> 

in an old issue (https://issues.asterisk.org/jira/browse/ASTERISK-6175) i
have tried to add real-time call control, which will allow updating the
call limit from an external check (Curl or database). The issue was closed
waiting for this exact functionality from the bridge.

Using an one time write struct will not allow this and there should be
more than one possible. Probably it will be more convenient to have the
data in a datastore attached to the channel as this will accompany the
channel over all bridges it passes and we may have
BRIDGE_LIMIT_START_SOUND, BRIDGE_LIMIT_WARNING_SOUND, BRIDGE_LIMIT_RTTC
etc. each with its own data and processing callback, with only common
fields for duration and frequency



More information about the asterisk-dev mailing list