Re: [Asterisk-java-users] asteriskServer.getChannelByName Timeout waiting for events from StatusAct
Brought to you by:
srt
From: Jorge <gus...@gm...> - 2014-03-13 14:09:37
|
Hi, Sorry :( . Let´s start again, I will try to clarify a bit the scenario. I am really new to Asterisk I will try to do my best. I want to talk to a device using DTMF tones using Asterisk. The main problem is that the device can call o receive a call to/from Asterisk. The main problem is that if the device is not connected to an extension (SIP extension) or to a conference, the device hang up the call so it is finished. My idea taken from here ( http://blogtech.cardosi.net/2014/01/15/tutorial-on-lamj-part-4/) is connecting the device to a conference. And sending the DTMF tones using the channel that has been created. Is it right? Do you have a better solution? First case, If Asterisk calls I use (from http://blogtech.cardosi.net/2014/01/15/tutorial-on-lamj-part-4) : AsteriskChannel asteriskChannel = asteriskServer.originateToExtension(channelName, "default", "8600", 1, 10000); asteriskChannel.playDtmf("1"); And a listener that detects the DTMF event that arrives. Like this (more or less, it is not the exact code I am using) : ManagerConnectionFactory factory = new ManagerConnectionFactory( ip, user, password); managerConnection = factory.createManagerConnection(); // login to Asterisk managerConnection.login(); // Instantiate a new AsteriskServer asteriskServer = new AsteriskServerImpl(managerConnection); managerConnection.addEventListener(new ManagerEventListener(){ public void onManagerEvent(ManagerEvent event) { if (event instanceof DtmfEvent) { ... Second case and here is the problem. What I have done is setting up the incoming calls to the conference. So when the device calls the input is directed to the conference and starts sending DTMF tones. With the DTMF tone I get the channel name (DtmfEvent.getChannel()) but when I try to get the channel object from the channel name (asteriskServer.getChannelByName(mensaje.getCanal());) is where I have the error. "org.asteriskjava.live.ManagerCommunicationException: Timeout waiting for events from StatusAction" Please, let me know what is not explained and done properly. Kind regards and thank you for your help. |