Thread: [Asterisk-java-users] Events blocked by Responses?
Brought to you by:
srt
From: Andy B. <and...@pr...> - 2007-08-23 17:19:36
Attachments:
andy.burns.vcf
|
Using asterisk-java 0.3 to talk to the Manager API of asterisk 1.4 I based my code off the tutorial and have expanded from there I connect to the manager add an event handler which just prints out the event send an originateaction with a callback handler the callback handler prints out the response the action has a 30 second timeout set if the origiated call is connected my extension will play an asterisk sound file and then hangup all this works ok now I'm trying to track the progress of the call through the response callback and the events delivered to my listener For example when the originate action is sent, I do NOT answer the external SIP call after the timout period I get my callback with an "Error" response and with "Originate failed" as the message, this is expected. However only after the response callback do I get the stream of events to my listener for NewChannelEvent,NewCallerIdEvent,NewStateEvent(Ringing) and finally HangupEvent Should events be delivered synchronously, rather than being blocked by the pending response to my action? If so is this a manager API limitation or an asterisk-java limitiation? Thanks for any help |
From: Stefan R. <ste...@re...> - 2007-08-24 01:11:36
Attachments:
signature.asc
|
In this case you sould send the originate action asynchronously (i.e. provide a callback to sendAction), then nothing will be blocked. As an alternative you might want to look at the originateAsync methods in DefaultAsteriskServer. =3DStefan Andy Burns wrote: > Using asterisk-java 0.3 to talk to the Manager API of asterisk 1.4 >=20 > I based my code off the tutorial and have expanded from there >=20 > I connect to the manager > add an event handler which just prints out the event > send an originateaction with a callback handler > the callback handler prints out the response > the action has a 30 second timeout set > if the origiated call is connected my extension will play an asterisk > sound file and then hangup > all this works ok >=20 > now I'm trying to track the progress of the call through the response > callback and the events delivered to my listener >=20 > For example when the originate action is sent, I do NOT answer the > external SIP call >=20 > after the timout period I get my callback with an "Error" response and > with "Originate failed" as the message, this is expected. >=20 > However only after the response callback do I get the stream of events > to my listener for > NewChannelEvent,NewCallerIdEvent,NewStateEvent(Ringing) and finally > HangupEvent >=20 > Should events be delivered synchronously, rather than being blocked by > the pending response to my action? >=20 > If so is this a manager API limitation or an asterisk-java limitiation?= >=20 > Thanks for any help >=20 >=20 >=20 > -----------------------------------------------------------------------= -- > 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/ >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Andy B. <and...@pr...> - 2007-08-24 08:54:07
Attachments:
andy.burns.vcf
|
On 24/08/2007 02:12, Stefan Reuter wrote: > In this case you sould send the originate action asynchronously (i.e. > provide a callback to sendAction), then nothing will be blocked. Thank you, but perhaps I didn't describe my code well enough. I *am* passing a callback to sendaction rather than waiting with a timeout, and no events are delivered to my listener method until after the response is delivered to my callback method, then all the "buffered" events get delivered at once. > As an alternative you might want to look at the originateAsync methods > in DefaultAsteriskServer. I wasn't sure how mature those classes were? |
From: Andy B. <and...@pr...> - 2007-09-06 10:07:24
Attachments:
andy.burns.vcf
|
On 24/08/2007 09:54, Andy Burns wrote: > I *am* passing a callback to sendaction rather than waiting with a > timeout, and no events are delivered to my listener method until after > the response is delivered to my callback method, then all the "buffered" > events get delivered at once. A belated follow up to this one ... I was running my test app from a command line, with various println output from my main thread and my event listener and response methods intermingled with the "INFO:" logging from asterisk java and evidently this was causing buffering issues. Today I've moved to running my application inside netbeans and it's now clear the events listener calls being delivered in realtime, without waiting for the response callback ... Thanks. |
From: Andy B. <and...@pr...> - 2007-09-07 18:21:02
Attachments:
andy.burns.vcf
|
On 24/08/2007 09:54, Andy Burns wrote: > I *am* passing a callback to sendaction rather than waiting with a > timeout, and no events are delivered to my listener method until after > the response is delivered to my callback method, then all the "buffered" > events get delivered at once. Using OriginateAction.setAsync(true) was instumental too :-) |