[Asterisk-java-users] event casting
Brought to you by:
srt
From: Jason W. <jas...@be...> - 2006-02-05 04:03:46
|
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 |