Re: [Asterisk-java-users] Help with sendEventGenerationAction
Brought to you by:
srt
From: Karien Du P. <kar...@gm...> - 2006-11-01 05:35:24
|
Hi. The sendEventGenerationAction method returns ResponseEvents. From the returned ResponseEvents one can retrieve all the events from it by using getEvents(). The getEvents returns a collection of ResponseEvent. Look through the collection with the instanceof function to find OriginateSucessEvent and OriginateFailureEvent. There is usually only one event in the event collection, which is the failure or success event. Code example: ResponseEvents responseEvents =3D this.managerConnection.sendEventGeneratingAction(orginateAction, orginateAction.getTimeout() + 2000); //Check the response event for failure or success for(ResponseEvent event : responseEvents.getEvents()) { if(event instanceof OriginateSuccessEvent //do success stuff eles if (event instanceof OriginateFailureEvent) //do failure stuff. } Hope it helps. Cheers. On 10/31/06, H=E9ctor Maldonado <ham...@gm...> wrote: > > Hello, > > I'm having a problem with sendEventGenerationAction. I've read the > documentation but, because of the lack of examples, I can't figure how to > make it work. > > The fact is that I need to capture the events that an OriginateAction > raises: OriginateSucess and OriginateFailure, in special the last one > because I need to track the reason of the failure (Congestion, Busy, Inva= lid > number, etc.) > > Could you please send me an example of how to use it?. How can I can sen= d > an OriginateAction in a way that I can process the events? > > Thanks in advance, > > Hector. > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > |