Re: [Asterisk-java-users] DTMF DETECT( Manager Events)
Brought to you by:
srt
From: sekar <che...@re...> - 2013-03-20 12:46:31
|
Hi Yves,Thanks for the reply.!! My problem : I have been working in asterisk for past one month. My code: import java.io.IOException; import net.sf.asterisk.manager.AuthenticationFailedException; import net.sf.asterisk.manager.ManagerConnection; import net.sf.asterisk.manager.ManagerConnectionFactory; import net.sf.asterisk.manager.ManagerEventHandler; import net.sf.asterisk.manager.TimeoutException; import net.sf.asterisk.manager.action.StatusAction; import net.sf.asterisk.manager.event.ManagerEvent; public class HelloEvents implements ManagerEventHandler { private ManagerConnection managerConnection; public HelloEvents() throws IOException { ManagerConnectionFactory factory = new ManagerConnectionFactory(); this.managerConnection = factory.getManagerConnection("localhost", "manager", "pa55w0rd"); } public void run() throws IOException, AuthenticationFailedException, TimeoutException, InterruptedException { // register for events managerConnection.addEventHandler(this); // connect to Asterisk and log in managerConnection.login(); // request channel state managerConnection.sendAction(new StatusAction()); // wait 10 seconds for events to come in Thread.sleep(10000); // and finally log off and disconnect managerConnection.logoff(); } public void handleEvent(ManagerEvent event) { // just print received events System.out.println(event); } public static void main(String[] args) throws Exception { HelloEvents helloEvents; helloEvents = new HelloEvents(); helloEvents.run(); } }This is the code given on asterisk java example. Manager Event recognizes connector event, log in and log out actions are detected. DtmfEvent is a subclass of manager event. Does public void handleEvent(ManagerEvent event) listens to DTMF ? If not prescribe me with the listener and the corresponding event . 1. I have found DTMFEvent on the api but haven't found any corresponding listener for that DTMFEvent extends ManagerEvent 2.My application should store the keypress of the user in the database. Two ways of doing it: 1. Read Appication 2. DTMF events Suggest me which is the efficient way of doing it. From: "Yves A." <yv...@gm...> Sent: Wed, 20 Mar 2013 16:53:31 To: ast...@li... Subject: Re: [Asterisk-java-users] DTMF DETECT( Manager Events) hi, are you writing to the correct mailinglist? this list is for questions regarding asterisk-java... so if you have problems reading dtmf tones via asterisk-java... you´re in the right place, but you should be a bit more specific... and post your code / efforts so far. If it is a general asterisk question, this is the wrong place... there is a general asterisk-users mailing list... but i am sure, this question was asked 100 times before. On the voip-info page you refer to is a link at the bottom of the page in the "see also" section...: http://www.voip-info.org/wiki/view/Asterisk+cmd+Read regards, yves Am 20.03.2013 07:40, schrieb sekar: |