Re: [Asterisk-java-users] event casting
Brought to you by:
srt
From: Brett S. <bs...@no...> - 2006-02-05 06:20:36
|
try: if (event instanceof NewChannelEvent) ... else if event instanceof HangupEvent) ... Jason Wolfe wrote: > When my handleEvent method recieves an event, how can I tell what type of > event it is... > > > temporarily, I'm just casting it in a try catch so that I can access the > methods, but this, of course, isn't the right way to do it. > > try{ NewChannelObject = (NewChannelEvent)event; > System.out.println("NewChannelEvent"); > System.out.println(NewChannelObject.getCallerId()); > System.out.println(NewChannelObject.getCallerIdName()); > System.out.println(NewChannelObject.getChannel()); > System.out.println(NewChannelObject.getState()); > }catch(Exception e){} } > > > Jason > > > > ------------------------------------------------------- > 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 > 0 |