Re: [Asterisk-java-users] Asynchrnous calls
Brought to you by:
srt
From: Martin S. <ma...@be...> - 2008-04-23 13:49:42
|
James, Try using just eventConnection.sendAction(originateAction....) like the tutorial at http://asterisk-java.org/development/tutorial.html. I don't think I've ever even noticed that originate *was* an event generating action. Either way, the "send event generating action" code is commented with: /* * Implements synchronous sending of event generating actions. */ I'd say use the regular sendAction unless you're expecting a bunch of events back that you want to wait for, like listing all existing channels or sip peers or something else that generates events as a cheap way to return synchronously-available data. Let us know how that works out for you :) 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 James Heggs Sent: Tuesday, April 22, 2008 4:10 PM To: Asterisk Java Subject: [Asterisk-java-users] Asynchrnous calls Hi there I am currently working with Asterisk Java and trying to make a dynamic web interface. Within the system from a widget on a web page I call a servlet that begins to make the call this is all working ok but what I need the servlet to do is begin to make the call then return back to the client side immediately. So basically need to make the call to the Asterisk Server to make the call asynchrnously. Does that make sense? So far I have tried an originate action with the following details: originateAction.setChannel("whatever"); //originateAction.setChannel("foo/44444"); originateAction.setContext("context"); originateAction.setCallerId("\"Test Company\" <SOMENUMBER>"); originateAction.setExten("9"+exten); originateAction.setAccount("account"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(15000L); originateAction.setAsync(true); final ResponseEvents responseEvents; final Iterator<ResponseEvent> responseEventIterator; AsteriskChannel channel = null; responseEvents = eventConnection.sendEventGeneratingAction(originateAction,originateActio n.getTimeout() + 2000); But this doesn't return to the client UNTIL the call is answered is there something else I need to do other than setting the action to async - if people need to see more of the code please let me know Regards Eggsy ________________________________ Messenger's gone Mobile! Get it now! <http://messengergonemobile.com> |