Thread: Re: [Asterisk-java-users] deciphering events
Brought to you by:
srt
From: Forte, G. \(GFORTE\) <gf...@ar...> - 2006-01-20 20:58:09
|
Nice, that makes things alot clearer! Thanks again Stefan! =20 Stefan, could you offer some advice? I want to broadcast most of the events via Ajax so I was wondering if it = was wise to: Leave HelloEvents.java as an executable without a timeout specified and = just let it run or convert it to a servlet. Basically I think I will be building a XML doc from specific events that = are generated by HelloEvents.java..... although I am new to Ajax as = well. =20 Any advice would be greatly appreciated!! Thanks again. ________________________________ From: ast...@li... on behalf of = Stefan Reuter Sent: Fri 1/20/2006 5:27 AM To: ast...@li... Subject: Re: [Asterisk-java-users] deciphering events sure, you can cast them to concrete instances and use the getters of = that event. for example: public void handleEvent(ManagerEvent event) { if (event instanceof JoinEvent) { handleJoinEvent((JoinEvent) event);=20 } } protected void handleJoinEvent(JoinEvent event) { System.out.println(event.getChannel() + " joined " + = event.getQueue()); } =3DStefan On 1/19/06, Forte, Graham (GFORTE) <gf...@ar...> wrote:=20 Hello, =20 I wanted to know if there was a way to further decipher events that are = passed from the helloEvents script. I get the following from this script: =20 = *************************************************************************= ************************************************** net.sf.asterisk.manager.event.StatusCompleteEvent: dateReceived=3DThu = Jan 19 15:11:53 CST 2006; systemHashcode=3D20989238 unique=3D20989238 net.sf.asterisk.manager.event.OriginateSuccessEvent: dateReceived=3DThu = Jan 19 15:12:19 CST 2006; privilege=3Dcall,all; = systemHashcode=3D19727353 unique=3D19727353 net.sf.asterisk.manager.event.ExtensionStatusEvent: dateReceived=3DThu = Jan 19 15:12:19 CST 2006; privilege=3Dcall,all; systemHashcode=3D6290200 unique=3D6290200 net.sf.asterisk.manager.event.NewCallerIdEvent: dateReceived=3DThu Jan = 19 15:12:20 CST 2006; privilege=3Dcall,all; systemHashcode=3D22936951 unique=3D22936951 net.sf.asterisk.manager.event.NewStateEvent: dateReceived=3DThu Jan 19 = 15:12:25 CST 2006; privilege=3Dcall,all; systemHashcode=3D28064776 unique=3D28064776 net.sf.asterisk.manager.event.MeetMeJoinEvent: dateReceived=3DThu Jan = 19 15:12:25 CST 2006; privilege=3Dcall,all; systemHashcode=3D14451727 unique=3D14451727 net.sf.asterisk.manager.event.MeetMeLeaveEvent: dateReceived=3DThu Jan = 19 15:12:41 CST 2006; privilege=3Dcall,all; systemHashcode=3D1026511 unique=3D1026511 net.sf.asterisk.manager.event.HangupEvent: dateReceived=3DThu Jan 19 = 15:12:41 CST 2006; privilege=3Dcall,all; systemHashcode=3D13271847 unique=3D13271847 = *************************************************************************= ************************************************** Is there a way to get more detail. More like a chatroom where when a person leaves or joins everyone in = the room is alerted that <newUserName> has joined. I want to do something similar to that with the conference call. =20 So that when a new caller joins or leaves the conferencees are alerted = .... JoeSchmoe SIP number 20022 has joined the conference. I guess what I am saying is can I return something other than the = systemHashcode or dateReceived etc.... An example would be greatly appreciated. =20 Thanks again Stefan!! =09 |
From: Stefan R. <sr...@re...> - 2006-01-23 23:34:28
|
> could you offer some advice? > I want to broadcast most of the events via Ajax so I was wondering if > it was wise to: > Leave HelloEvents.java as an executable without a timeout specified > and just let it run or convert it to a servlet. > Basically I think I will be building a XML doc from specific events > that are generated by HelloEvents.java..... although I am new to Ajax > as well. I would run a just register an EventHandler (like the one in HelloEvents that receives events and places them into some kind of queue. Then you can have a servlet that polls that queue and transmits the events to your ajax client. =3DStefan >=20 |
From: Brett S. <bs...@no...> - 2006-01-24 02:59:40
|
Just a thought. I might be a good idea to mark the ManagerReader threads as daemons as daemon threads won't stop an application shutting down if they are left hanging around. You can just add the following line just before you start the thread. (I usually just add it to the constructor). this.setDaemon(true); |
From: Brett S. <bs...@no...> - 2006-01-24 06:55:55
|
Currently when ManagerReader terminates it outputs an log4j INFO message as follows: 17:52:50,960 INFO Reached end of stream, terminating reader. IMHO I think this should be a DEBUG message not an INFO message. Regards, Brett. |
From: Stefan R. <sr...@re...> - 2006-01-24 13:41:24
Attachments:
signature.asc
|
Brett, thanks for your suggestions regarding the log level and the manager reader threads. they will be included in Asterisk-Java 0.3. =Stefan Brett Sutton schrieb: > Currently when ManagerReader terminates it outputs an log4j INFO message > as follows: > > 17:52:50,960 INFO Reached end of stream, terminating reader. > > IMHO I think this should be a DEBUG message not an INFO message. > > Regards, > Brett. > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |