Re: [Asterisk-java-users] Manager Events blocked
Brought to you by:
srt
From: Gabriel A. <gab...@gl...> - 2007-10-18 18:08:24
|
Thanks Martin ! Stefan's answer was very useful, it confirmed my assumption. Effectivly I am sending a ManagerAction when an event is dispatched. I tried using ManagerEventListenerProxy, but it didn't work. I think the last chance it would be to start a new Thread. Gabriel. -----Original Message----- From: ast...@li... [mailto:ast...@li...] On Behalf Of Martin Smith Sent: jueves, 18 de octubre de 2007 10:50 a.m. To: ast...@li... Subject: Re: [Asterisk-java-users] Manager Events blocked Hello Gabriel, Stefan's answer reproduced below might help you. It sounds like you are mixing the Live API (AsteriskServer) and the manager API (ManagerEventListener). You may also want to double check you are using OriginateAction.setAsync(true). > -----Original Message----- > From: ast...@li... > [mailto:ast...@li...] On Behalf > Of Stefan Reuter > Sent: Wednesday, September 05, 2007 4:34 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] Execute Action after connect or > reconnect > > Hi, > > you seem to be mixing the live API and the manager API. While this is > generally possible I think it would be better to just stick with the > live API. You are adding a callback to the ConnectEvent, so maybe the > best solution would be to provide a way to register a few more > callbacks like for connect and disconnect in the live API. > > The problem in this case is that a ManagerAction is send from the > event dispatching thread which is not allowed. Generally the live API > handles this problem by using a ManagerEventListenerProxy but by > registering your own listener with the underlying connection you > prevent this from working correctly. > So what you have to do is to decouple receiving the event and sending > the action on your own. One solution is starting a new Thread as > proposed by Martin. Another solution is to use > ManagerEventListenerProxy for your own listener, too. > This might look like this: > > Instead of > > managerConnection.addEventListener( > new ConnectEventListener(asteriskserver)); > > use > > managerConnection.addEventListener(new ManagerEventListenerProxy( > new ConnectEventListener(asteriskserver))); > > =Stefan Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221 ________________________________ From: ast...@li... [mailto:ast...@li...] On Behalf Of Gabriel Allasia Sent: Wednesday, October 17, 2007 9:42 PM To: ast...@li... Subject: [Asterisk-java-users] Manager Events blocked Hi, When we use AsteriskServer.originateToExtensionAsync to generate async calls to an extension and context, we have problems to listen events in a class that implements ManagerEventListener. It seems like the events are blocked until the call is finished. However if we use other extensions and contexts, everything goes ok. Any suggestions? Thanks in advance, Gabriel. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users _____________________________________________________________________ This information is private and confidential and intended for the recipient only. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and shall not be regarded neither as a proposal, acceptance nor as a statement of will or official statement from Globant. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. |