Re: [Asterisk-java-users] DTMF DETECT( Manager Events)
Brought to you by:
srt
From: Yves A. <yv...@gm...> - 2013-03-20 20:40:58
|
sekar, how did you test? your program runs for 10 seconds and then quits. so you have to start your programm, during the call is running and press your keys on the phone to see the event... i would suggest to : - modify your programm, so that it keeps running, until you kill the process, so you have more time for setting up the call, test some things and see the upcoming events... keep in mind, that: -you have to configure your phone (sip.conf) to use dtmf correctly... most common setting is "dtmfmode=inband" -detecting dtmf works only for bridged channels... (just picking up the phone and typing some numbers does not fire any events..) -you will receive ANY dtfm-detected event... so if you have an asterisk where more than one call is running at one time, you must take care to store the user input for the correct call... (therefore watch the uniqueIDs or at least channelIDs) -(not) receiving events may be an issue of userprivileges... the user "manager" you refer in your code must have appropriate userrights configured in "manager.conf" - if you want to realize some kind of IVR, you should develop an agi-script. regards, yves Am 20.03.2013 13:46, schrieb sekar: > 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: > > 201...@f4..." > type="cite">I have completely read > > *http://www.voip-info.org/wiki/view/Asterisk+DTMF * > > > article but couldn't find an example anywhere online regarding > capturing DTMF events on asterisk . Having this problem for 2 > weeks . It would be very helpful if you reply with an example > > Cheers > > > > > > <http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?> > Get your own *FREE* website and domain with business email > solutions, click here > <http://www.rediffmail.com/cgi-bin/red.cgi?red=http%3A%2F%2Ftrack%2Erediff%2Ecom%2Fclick%3Furl%3D%5F%5F%5Fhttp%3A%2F%2Fhosting%2Erediff%2Ecom%2Frediffmailpro%2Fbusiness%2Demail%3Fsc%5Fcid%3Dsig%5F%5F%5F%26amp%3Bcmp%3Dsig%26amp%3Blnk%3Dsig%26amp%3Bnsrv1%3Dhost&isImage=0&BlockImage=0&rediffng=0> > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > <http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?> > Get your own *FREE* website and domain with business email solutions, > click here > <http://track.rediff.com/click?url=___http://hosting.rediff.com/rediffmailpro/business-email?sc_cid=sig___&cmp=sig&lnk=sig&nsrv1=host> > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |