Purpose of Call#controllers

37 views
Skip to first unread message

James Le Cuirot

unread,
Apr 25, 2017, 10:29:24 AM4/25/17
to Adhearsion
The description of Call#controllers is as follows:

# @return [Array<Adhearsion::CallController>] the set of call controllers executing on the call

I filed a pull request a few years back because this description led me to believe that controllers should be removed from this array once they have finished executing. It didn't get merged in the end.


What I didn't notice at the time was that controllers are not even added to this array when they are executed with invoke. Despite the existence of unit tests concerning multiple registered controllers, I cannot see where more than one would normally be registered. The register_controller method is only called from CallController#execute! and this is generally only used for the initial controller instantiated by the router. Was it accidentally missed for invoke?

In my case, I have an asynchronous CPA detector that needs to stop all components but by the time this triggers, the call has already moved onto a different controller. I can probably find a way around this but it would be handy if this just worked.

call.controllers.each(&:stop_all_components)

Ben Langfeld

unread,
Jul 29, 2017, 4:53:39 PM7/29/17
to Adhearsion
I know you asked me to comment here, but I have nothing conclusive I can say. It does appear to be some kind of mistake.
Reply all
Reply to author
Forward
0 new messages