Re: [Asterisk-java-users] Asterisk-java-users Digest, Vol 82, Issue 5
Brought to you by:
srt
From: vinethan j. <vin...@gm...> - 2013-04-12 14:03:18
|
i stil cant get even if i tried String s= event.getDigit().toString(); i need a listener for public void onDtmfEvent(DtmfEvent e1) { String s= e1.getDigit().toString(); System.out.println("s = "+s); } my main class is like this or u can see below in my reply section public class El implements ManagerFactoryParameters,ManagerEventListener,Serializable,EventListener when ever an dtmf event is captured my prog is not calling onDtmfEvent(DtmfEvent e1); please i need help my whole program import java.io.IOException; import java.io.Serializable; import org.asteriskjava.manager.AuthenticationFailedException; import org.asteriskjava.manager.ManagerConnection; import org.asteriskjava.manager.ManagerConnectionFactory; import org.asteriskjava.manager.ManagerEventListener; import org.asteriskjava.manager.TimeoutException; import org.asteriskjava.manager.action.EventGeneratingAction; import org.asteriskjava.manager.action.StatusAction; import org.asteriskjava.manager.event.ManagerEvent; import org.asteriskjava.live.CallerId; import org.asteriskjava.*; import java.lang.Object; import java.nio.channels.Channel; import javax.net.ssl.ManagerFactoryParameters; import org.asteriskjava.live.*; import org.asteriskjava.manager.*; import org.asteriskjava.manager.action.*; import org.asteriskjava.manager.event.*; import org.asteriskjava.manager.internal.*; import org.asteriskjava.manager.response.*; import org.asteriskjava.util.*; import org.asteriskjava.util.internal.*; import org.asteriskjava.live.*; import org.asteriskjava.manager.action.PlayDtmfAction; import org.asteriskjava.live.AsteriskServer; import org.asteriskjava.live.AsteriskChannel; import org.asteriskjava.live.AsteriskQueue; import org.asteriskjava.live.MeetMeRoom; import org.asteriskjava.live.DefaultAsteriskServer; import org.asteriskjava.live.ManagerCommunicationException; import org.asteriskjava.manager.event.ManagerEvent; import org.asteriskjava.manager.event.DtmfEvent; import java.util.EventObject; import java.lang.Object; import sunw.util.EventListener; public class El implements ManagerFactoryParameters,ManagerEventListener,Serializable,EventListener { private ManagerConnection managerConnection; private AsteriskServer asteriskServer; public El() throws IOException { asteriskServer = new DefaultAsteriskServer("xx.xx.xx.xx", "asterisk", "vinethan"); ManagerConnectionFactory factory = new ManagerConnectionFactory("xx.xx.xx.xx", "asterisk", "vinethan"); this.managerConnection = factory.createManagerConnection(); } public void run() throws IOException, AuthenticationFailedException,TimeoutException, InterruptedException,ManagerCommunicationException { managerConnection.addEventListener(this); int p = managerConnection.getPort(); managerConnection.login(); // request channel state managerConnection.sendAction(new StatusAction()); Thread.sleep(100000); System.out.print("s = "); managerConnection.logoff(); } public void onManagerEvent(ManagerEvent event) { // just print received events System.out.println(event); } public void onDtmfEvent(DtmfEvent e1) { String s= e1.getDigit().toString(); System.out.println("s = "+s); } public static void main(String[] args) throws Exception { El helloEvents; helloEvents = new El(); helloEvents.run(); } } On Fri, Apr 12, 2013 at 6:15 PM, < ast...@li...> wrote: > Send Asterisk-java-users mailing list submissions to > ast...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > or, via email, send a message with subject or body 'help' to > ast...@li... > > You can reach the person managing the list at > ast...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Asterisk-java-users digest..." > > > Today's Topics: > > 1. Re: Asterisk-java-users Digest, Vol 82, Issue 3 (Diego Guimar?es) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 12 Apr 2013 09:45:02 -0300 > From: Diego Guimar?es <di...@pr...> > Subject: Re: [Asterisk-java-users] Asterisk-java-users Digest, Vol 82, > Issue 3 > To: ast...@li... > Message-ID: > <CAJWx+B5ze9jGVjcO-yXPpqvjnysC1L8vQi0Z9+7= > px9...@ma...> > Content-Type: text/plain; charset="iso-8859-1" > > you need change this: String s= e1.getDigit(); > for > > String s= e1.getDigit().toString(); > > > Diego Augusto Costa Guimar?es > Gerente TI - Praia Clube > *dCAP (Digium Certified Asterisk Professional)* > Pabx: (34) 3256-3116 > (Mobile) celular: (34) - 9268-9999 > Chat Google Talk: die...@gm... Skype: diegoacguimares MSN: > die...@gm... > > > On Fri, Apr 12, 2013 at 9:35 AM, vinethan jain <vin...@gm...> wrote: > > > i still cant get it can any one help me with full code please... > > > > > > > > On Fri, Apr 12, 2013 at 5:19 PM, < > > ast...@li...> wrote: > > > >> Send Asterisk-java-users mailing list submissions to > >> ast...@li... > >> > >> To subscribe or unsubscribe via the World Wide Web, visit > >> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > >> or, via email, send a message with subject or body 'help' to > >> ast...@li... > >> > >> You can reach the person managing the list at > >> ast...@li... > >> > >> When replying, please edit your Subject line so it is more specific > >> than "Re: Contents of Asterisk-java-users digest..." > >> > >> > >> Today's Topics: > >> > >> 1. i am to log (vinethan jain) > >> 2. need help in capturing dtmf event (vinethan jain) > >> 3. Re: (no subject) (Diego Guimar?es) > >> 4. Re: i am to log (Diego Guimar?es) > >> > >> > >> ---------------------------------------------------------------------- > >> > >> Message: 1 > >> Date: Fri, 12 Apr 2013 13:55:40 +0530 > >> From: vinethan jain <vin...@gm...> > >> Subject: [Asterisk-java-users] i am to log > >> To: ast...@li... > >> Message-ID: > >> <CALPiqmcx3KBhFKC8oDEU3NUgH3rETyQvoARL1m3hJtk6rA= > >> cc...@ma...> > >> Content-Type: text/plain; charset="iso-8859-1" > >> > >> i am able to print dtmf events but i need to capture that dtmf digit and > >> store it in a string. > >> > >> please help me with the coding > >> -------------- next part -------------- > >> An HTML attachment was scrubbed... > >> > >> ------------------------------ > >> > >> Message: 2 > >> Date: Fri, 12 Apr 2013 16:42:52 +0530 > >> From: vinethan jain <vin...@gm...> > >> Subject: [Asterisk-java-users] need help in capturing dtmf event > >> To: ast...@li... > >> Message-ID: > >> < > >> CAL...@ma...> > >> Content-Type: text/plain; charset="iso-8859-1" > >> > >> need help in capturing dtmf event, > >> i am very new to this, > >> any help will be greatly appreciated > >> > >> > >> > >> > >> > >> > >> import java.io.IOException; > >> import java.io.Serializable; > >> > >> import org.asteriskjava.manager.AuthenticationFailedException; > >> import org.asteriskjava.manager.ManagerConnection; > >> import org.asteriskjava.manager.ManagerConnectionFactory; > >> import org.asteriskjava.manager.ManagerEventListener; > >> import org.asteriskjava.manager.TimeoutException; > >> import org.asteriskjava.manager.action.EventGeneratingAction; > >> import org.asteriskjava.manager.action.StatusAction; > >> import org.asteriskjava.manager.event.ManagerEvent; > >> import org.asteriskjava.live.CallerId; > >> import org.asteriskjava.*; > >> import java.lang.Object; > >> import java.nio.channels.Channel; > >> import java.util.EventObject; > >> > >> import javax.net.ssl.ManagerFactoryParameters; > >> > >> import org.asteriskjava.live.*; > >> import org.asteriskjava.manager.*; > >> import org.asteriskjava.manager.action.*; > >> import org.asteriskjava.manager.event.*; > >> import org.asteriskjava.manager.internal.*; > >> import org.asteriskjava.manager.response.*; > >> import org.asteriskjava.util.*; > >> import org.asteriskjava.util.internal.*; > >> import org.asteriskjava.manager.event.ManagerEvent; > >> import org.asteriskjava.live.*; > >> import org.asteriskjava.manager.action.PlayDtmfAction; > >> import org.asteriskjava.live.AsteriskServer; > >> import org.asteriskjava.live.AsteriskChannel; > >> import org.asteriskjava.live.AsteriskQueue; > >> import org.asteriskjava.live.MeetMeRoom; > >> import org.asteriskjava.live.DefaultAsteriskServer; > >> import org.asteriskjava.live.ManagerCommunicationException; > >> import java.util.EventObject; > >> import com.sun.org.apache.xml.internal.dtm.DTMFilter; > >> > >> import org.asteriskjava.manager.event.DtmfEvent; > >> > >> import sunw.util.EventListener; > >> > >> > >> > >> public class El implements > >> ManagerFactoryParameters,ManagerEventListener,Serializable,EventListener > >> { > >> private ManagerConnection managerConnection; > >> > >> > >> > >> > >> public El() throws IOException > >> { > >> > >> ManagerConnectionFactory factory = new > >> ManagerConnectionFactory("10.20.52.100", "asterisk", "vinethan"); > >> this.managerConnection = factory.createManagerConnection(); > >> > >> } > >> > >> public void run() throws IOException, > >> AuthenticationFailedException,TimeoutException, > >> InterruptedException,ManagerCommunicationException > >> { > >> > >> managerConnection.addEventListener(this); > >> > >> > >> > >> > >> > >> int p = managerConnection.getPort(); > >> > >> managerConnection.login(); > >> > >> // request channel state > >> managerConnection.sendAction(new StatusAction()); > >> > >> > >> > >> Thread.sleep(100000); > >> managerConnection.logoff(); > >> } > >> > >> public void onManagerEvent(ManagerEvent event) > >> { > >> // just print received events > >> System.out.println(event); > >> } > >> > >> public void onDtmfEvent(DtmfEvent e1) > >> { > >> String s= e1.getDigit(); > >> System.out.println("s = "+s); > >> } > >> > >> public static void main(String[] args) throws Exception > >> { > >> El helloEvents; > >> helloEvents = new El(); > >> helloEvents.run(); > >> } > >> } > >> -------------- next part -------------- > >> An HTML attachment was scrubbed... > >> > >> ------------------------------ > >> > >> Message: 3 > >> Date: Fri, 12 Apr 2013 08:48:28 -0300 > >> From: Diego Guimar?es <di...@pr...> > >> Subject: Re: [Asterisk-java-users] (no subject) > >> To: ast...@li... > >> Message-ID: > >> < > >> CAJ...@ma...> > >> Content-Type: text/plain; charset="iso-8859-1" > >> > >> is, I already thought of that. But AJ is very wrong not to provide it, > >> does > >> anyone need this? I think it's essential. > >> > >> > >> Diego Augusto Costa Guimar?es > >> Gerente TI - Praia Clube > >> *dCAP (Digium Certified Asterisk Professional)* > >> Pabx: (34) 3256-3116 > >> (Mobile) celular: (34) - 9268-9999 > >> Chat Google Talk: die...@gm... Skype: diegoacguimares MSN: > >> die...@gm... > >> > >> > >> On Fri, Apr 12, 2013 at 5:17 AM, Yves A. <yv...@gm...> wrote: > >> > >> > hi, > >> > > >> > if you fire a "core show channel <channelid> command from the cli you > >> cann > >> > see every info you need. > >> > so, if you are in need of getting infos that AJ can?t provide, but the > >> cli > >> > can... then you can use > >> > CommandAction Class from AJ to fire any command as if you were on cli > >> and > >> > parse the output. > >> > > >> > yves > >> > > >> > Am 12.04.2013 09:33, schrieb Shitian Long: > >> > > >> > I think you could try AsteriskServer class. probably you will find > >> > the information you want. > >> > > >> > On Apr 1, 2013, at 8:41 PM, Diego Guimar?es <die...@gm...> > >> wrote: > >> > > >> > how can I get the value of the cdr duration in the channel? because > >> > CallDetailRecord is only created after the call is finished. > >> > > >> > Diego Augusto Costa Guimar?es > >> > Gerente TI - Praia Clube > >> > *dCAP (Digium Certified Asterisk Professional)* > >> > Pabx: (34) 3256-3116 > >> > (Mobile) celular: (34) - 9268-9999 > >> > Chat Google Talk: die...@gm... Skype: diegoacguimares MSN: > >> > die...@gm... > >> > > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Own the Future-Intel® Level Up Game Demo Contest 2013 > >> > Rise to greatness in Intel's independent game demo contest. > >> > Compete for recognition, cash, and the chance to get your game > >> > on Steam. $5K grand prize plus 10 genre and skill prizes. > >> > Submit your demo by 6/6/13. > >> > > >> > http://p.sf.net/sfu/intel_levelupd2d_______________________________________________ > >> > Asterisk-java-users mailing list > >> > Ast...@li... > >> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > >> > > >> > > >> > > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Precog is a next-generation analytics platform capable of advanced > >> > analytics on semi-structured data. The platform includes APIs for > >> building > >> > apps and a phenomenal toolset for data science. Developers can use > >> > our toolset for easy data analysis & visualization. Get a free > account! > >> http://www2.precog.com/precogplatform/slashdotnewsletter > >> > > >> > > >> > > >> > _______________________________________________ > >> > Asterisk-java-users mailing listAsterisk-java-users > >> @lists.sourceforge.nethttps:// > >> lists.sourceforge.net/lists/listinfo/asterisk-java-users > >> > > >> > > >> > > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Precog is a next-generation analytics platform capable of advanced > >> > analytics on semi-structured data. The platform includes APIs for > >> building > >> > apps and a phenomenal toolset for data science. Developers can use > >> > our toolset for easy data analysis & visualization. Get a free > account! > >> > http://www2.precog.com/precogplatform/slashdotnewsletter > >> > _______________________________________________ > >> > Asterisk-java-users mailing list > >> > Ast...@li... > >> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > >> > > >> > > >> -------------- next part -------------- > >> An HTML attachment was scrubbed... > >> > >> ------------------------------ > >> > >> Message: 4 > >> Date: Fri, 12 Apr 2013 08:49:12 -0300 > >> From: Diego Guimar?es <di...@pr...> > >> Subject: Re: [Asterisk-java-users] i am to log > >> To: ast...@li... > >> Message-ID: > >> < > >> CAJ...@ma...> > >> Content-Type: text/plain; charset="iso-8859-1" > >> > >> asteriskChannel.getDtmfReceived().toString() > >> > >> > >> Diego Augusto Costa Guimar?es > >> Gerente TI - Praia Clube > >> *dCAP (Digium Certified Asterisk Professional)* > >> Pabx: (34) 3256-3116 > >> (Mobile) celular: (34) - 9268-9999 > >> Chat Google Talk: die...@gm... Skype: diegoacguimares MSN: > >> die...@gm... > >> > >> > >> On Fri, Apr 12, 2013 at 5:25 AM, vinethan jain <vin...@gm...> > >> wrote: > >> > >> > > >> > i am able to print dtmf events but i need to capture that dtmf digit > and > >> > store it in a string. > >> > > >> > please help me with the coding > >> > > >> > > >> > > >> > > >> > ------------------------------------------------------------------------------ > >> > Precog is a next-generation analytics platform capable of advanced > >> > analytics on semi-structured data. The platform includes APIs for > >> building > >> > apps and a phenomenal toolset for data science. Developers can use > >> > our toolset for easy data analysis & visualization. Get a free > account! > >> > http://www2.precog.com/precogplatform/slashdotnewsletter > >> > _______________________________________________ > >> > Asterisk-java-users mailing list > >> > Ast...@li... > >> > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > >> > > >> > > >> -------------- next part -------------- > >> An HTML attachment was scrubbed... > >> > >> ------------------------------ > >> > >> > >> > ------------------------------------------------------------------------------ > >> Precog is a next-generation analytics platform capable of advanced > >> analytics on semi-structured data. The platform includes APIs for > building > >> apps and a phenomenal toolset for data science. Developers can use > >> our toolset for easy data analysis & visualization. Get a free account! > >> http://www2.precog.com/precogplatform/slashdotnewsletter > >> > >> ------------------------------ > >> > >> _______________________________________________ > >> Asterisk-java-users mailing list > >> Ast...@li... > >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > >> > >> > >> End of Asterisk-java-users Digest, Vol 82, Issue 3 > >> ************************************************** > >> > > > > > > > > > ------------------------------------------------------------------------------ > > Precog is a next-generation analytics platform capable of advanced > > analytics on semi-structured data. The platform includes APIs for > building > > apps and a phenomenal toolset for data science. Developers can use > > our toolset for easy data analysis & visualization. Get a free account! > > http://www2.precog.com/precogplatform/slashdotnewsletter > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > ------------------------------ > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > End of Asterisk-java-users Digest, Vol 82, Issue 5 > ************************************************** > |