[Asterisk-java-users] asteriskServer.getChannelByName Timeout waiting for events from StatusAction
Brought to you by:
srt
From: Jorge <gus...@gm...> - 2014-03-11 14:03:37
|
Hi: I have the next scenario. I am triying to call from pstn to a conference in Asterisk server. I have set up the dial plan so the main telephone number is the the conference so calling for example 555-555555 you get into the conference. My objective is capturing this channel from java to send tones from Asterisk to the phone. What I am triying to do is the next thing : managerEventListener = new ManagerEventListener(){ public void onManagerEvent(ManagerEvent event) { if(event instanceof MeetMeJoinEvent ){ MeetMeJoinEvent meetMeJoinEvent = (MeetMeJoinEvent) event; String server = meetMeJoinEvent.getServer(); meetMeJoinEvent.getCallerIdNum(); System.out.println(meetMeJoinEvent.getChannel()); try{ AsteriskChannel asteriskChannel = asteriskServer.getChannelByName(meetMeJoinEvent.getChannel()); System.out.println(asteriskChannel); //asteriskChannel.playDtmf("1"); System.out.println("terminado"); }catch(ManagerCommunicationException e){ logger.error("Error al obtener el canal " + e); System.out.println("Error " + e); } } } }; That is to say I am capturing the MeetMeJoinEvent to see when this phone has been connected to the conference. With this event I am able to get the channel name and with the instruction the channel structure but I get : "org.asteriskjava.live.ManagerCommunicationException: Timeout waiting for events from StatusAction" The great thing is that when I originate the call from Asterisk with "asteriskChannel = asteriskServer.originateToExtension("DAHDI/g0/" + numero, contexto , conferenciaNumeroSip, 1, 10000);" it is able to get the channel. Could you let me know what I am doing wrong? Thank you very much for your help. |