Re: [Asterisk-java-users] EVENT LISTENER PROBLEM
Brought to you by:
srt
From: Daniele R. <dan...@gm...> - 2009-07-24 10:41:54
|
Hi Stefan, thanks very much for usefull information. We now with the dtmf events patch can be able to detect press of digits. We have a small problem on calls that are no asnwer, infact is throw an exception: vento new propertyChange java.beans.PropertyChangeEvent[source=AsteriskChannel[id='1248431463.961',name='SIP/101-00b7b1a8',callerId='<3470841943>',state='UP',account='null',dateOfCreation=Fri Jul 24 12:31:03 CEST 2009,dialedChannel=null,dialingChannel=null,linkedChannel=null]] 0 Evento new propertyChange java.beans.PropertyChangeEvent[source=AsteriskChannel[id='1248431463.961',name='SIP/101-00b7b1a8',callerId='<3470841943>',state='HUNGUP',account='null',dateOfCreation=Fri Jul 24 12:31:03 CEST 2009,dialedChannel=null,dialingChannel=null,linkedChannel=null]] 0 Evento new propertyChange java.beans.PropertyChangeEvent[source=AsteriskChannel[id='1248431463.962',name='SIP/ehiweb-00b7e7e8',callerId='<3400917567>',state='HUNGUP',account='null',dateOfCreation=Fri Jul 24 12:31:03 CEST 2009,dialedChannel=null,dialingChannel=null,linkedChannel=null]] 1 Server org.asteriskjava.live.internal.AsteriskServerImpl@18385e3 name null id 1248431495.963 date creation Fri Jul 24 12:31:35 CEST 2009 24/07/2009 12:31:35 DEBUG AsteriskManager2:195 - No answer 1 Exception in thread "Asterisk-Java DaemonPool-1-thread-1" java.lang.IllegalArgumentException: Parameters passed to AsteriskChannelImpl() must not be null. at org.asteriskjava.live.internal.AsteriskChannelImpl.<init>(AsteriskChannelImpl.java:142) at org.asteriskjava.live.internal.ChannelManager.addNewChannel(ChannelManager.java:129) at org.asteriskjava.live.internal.ChannelManager.handleNewChannelEvent(ChannelManager.java:332) at org.asteriskjava.live.internal.AsteriskServerImpl.onManagerEvent(AsteriskServerImpl.java:742) at org.asteriskjava.manager.ManagerEventListenerProxy$1.run(ManagerEventListenerProxy.java:77) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) We have printed the values of the channel and as you can see and the name is NULL. So is throw the exception. We have used the OriginateCallback in order to detect events in this mode: static class MyOriginateCallback implements OriginateCallback{ private final int i; private MyOriginateCallback(int i) { this.i = i; } @Override public void onDialing(AsteriskChannel channel) { channel.addPropertyChangeListener(new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { System.out.println("Evento new propertyChange " + evt + " " + i); } }); channel.addDTMFListener(new DTMFListener() { @Override public void onDtmfStart(DTMF dtmf) { log.debug("Dtmf start "+dtmf); } @Override public void onDtmfEnd(DTMF dtmf) { log.debug("Dtmf end "+dtmf); } }); log.debug("Dialing " + i); } @Override public void onSuccess(AsteriskChannel channel) { log.debug("Success " + i); } @Override public void onNoAnswer(AsteriskChannel channel) { log.debug("No answer " + i); } @Override public void onBusy(AsteriskChannel channel) { log.debug("Busy " + i); } @Override public void onFailure(LiveException cause) { log.debug("Failure" + i); } } .... .... asteriskServer.originateAsync(action, new MyOriginateCallback(i)); It's correct the use of the Callback? Is a small bug the problem or I've make a mistake? Thanks very much Best regards Daniele 2009/7/23 Stefan Reuter <ste...@re...>: > Daniele Renda wrote: >> Hi Stefan, >> yes, in my opinion, are missing these events: >> >> -Hangup Event (very important for me) > > Hangup is already available. Just register a PropertyChangeListener and > watch for changes to the state property. Hangup is indicated by > ChannelState.HUNGUP. > >> -Dtmf events (also this one is very important) > > This is in progress. You can watch > https://secure.reucon.net/issues/browse/AJ-150 to be notified by Jira > when it's fixed. > > =Stefan > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > -- Daniele Renda |