Re: [Asterisk-java-users] Intergrating DefaultAsteriskManager
Brought to you by:
srt
From: Jan E. <jan...@pl...> - 2005-07-06 09:59:43
|
Hi, Thank you for the quick response! See my comments below. On Wednesday 06 July 2005 12:18, Stefan Reuter wrote: > let me try to clarify the design of the Manager API of Asterisk-Java: > > The foundation is the ManagerConnection, it repesents a connection to an > Asterisk Server and is capable to send actions and receive responses and > events. It doesn't add any valuable functionality but rather provides a > "Java" view to the Manager API (freeing you from TCP/IP connection and > parsing stuff). > > The AsteriskManager is built on top of the ManagerConnection and is an > attempt to simplify interaction with Asterisk by abstracting the > interface. > You will certainly have less freedom using AsteriskManager but it will > make life easier for easy things (like originating a call or getting a > list of open channels). > AsteriskManager is still in an early state of development as I am kinda > unsure about the abstraction level that is appropriate. > So, when using AsteriskManager be aware that it might change in the future. This little brief should go in the docs somewhere, it gives a better understanding of what is what. I missed some kind of short overview of the relations between the major classes. > That said it is perfectly valid to combine ManagerConnection and > AsteriskManager in your application. > You get a ManagerConnection (from the factory, or by using spring or > whatever), register your own event handler > (ManagerConnection.addEventHandler()) and then pass the connection it to > the DefaultAsteriskManager. Yes, so true. I had used ManagerConnection.addEventHandler() in my first tests, but then somehow got the idea that I couldn't use it anymore once I used an AsteriskManager. Of course I can, and it works ok too. I assume that AsteriskManager gets to handle the event before my own event handler does, so the new channels etc are already in place. > For future releases I would like to extend the AsteriskManager and the > Domain object to perform event handling at a higher level of abstraction. > So you will be able to register a handler to be notified about new > Channels (or Calls?) and you will be able to register with the instance of > the domain object (say a specific Channel or Queue) to be informed about > changes of that particular object (a Channel being hung up or an Agent > joining a Queue). This sounds like a good idea. As a lazy programmer I like higher level abstractions. > If you'd like to provide some information about the application you are > building and the kind of events you need that will be valuable input. Well, my application will basically do similar tasks to the Flash Operator Panel (http://www.asternic.org/), although with a very different UI. So monitoring what is going and changing active channels/queues etc is very central. I like the action/event/response framework, it is quite handy for my case, especially a notification based one. Best regards, Jan Ekholm -- Jan Ekholm jan...@pl... |