Thread: [Asterisk-java-users] Access the queuelog
Brought to you by:
srt
From: AustroPretorian <aus...@gm...> - 2005-10-27 11:29:18
|
Hi, is there a different way to access/collect queuelog information other than reading out the text file? Is possible to gather the same info via Manager API? If so, how could this be done? Thx, Gerwin |
From: Stefan R. <sr...@re...> - 2005-10-27 16:37:43
|
Hi, > is there a different way to access/collect queuelog information other =20 > than reading out the text file? > Is possible to gather the same info via Manager API? yes this is possible > If so, how could this be done? have a look at the Asterisk-Java tutorial at http://www.asteriskjava.org/0.2-rc1/docs/tutorial.html There is an example that illustrates how to receive events via the Manager API. You find a documentation of all events that Asterisk exposes via the Manager API and esp. the Queue related events at http://www.asteriskjava.org/0.2-rc1/docs/apidocs/net/sf/asterisk/manager/ev= ent/package-summary.html Hope that helps you get started. =3DStefan |
From: Ines <mou...@ya...> - 2005-10-28 10:14:59
|
Hello, I've got a java class with different methods : - a method which answers the channel - a method which makes a call -a method which plays an audio file ... this is my java class : ---------------------------------------------------- import java.io.IOException; import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.BaseAGIScript; import net.sf.asterisk.fastagi.DefaultAGIServer; import net.sf.asterisk.fastagi.command.GetDataCommand; import net.sf.asterisk.fastagi.reply.AGIReply; public class AsteriskApp extends BaseAGIScript { AGIRequest request; AGIChannel channel; public AsteriskApp() { } public void service(AGIRequest request, AGIChannel channel) throws AGIException { .... } public void answerChannel() throws AGIException { answer(); } public void playAndDetect() throws IllegalArgumentException, AGIException { channel.sendCommand(new GetDataCommand("welcom", 1800, 1)); } public void hangupChannel() throws AGIException { hangup(); } public String GetDigit () throws AGIException { String f=null; char dig = waitForDigit(-1); return(f.valueOf(dig)); } ..... } --------------------------------------------------- what i want to do is : different application which calls this class and uses the methods, in different ways -an application which can make a call -an application which answers a call, plays a audio file, wait for digit, ..., hangup ..... for example : ---------------------------------------------------- import java.io.IOException; import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.DefaultAGIServer; import net.sf.asterisk.fastagi.command.GetDataCommand; import net.sf.asterisk.manager.AuthenticationFailedException; import net.sf.asterisk.manager.TimeoutException; public class Application { public static void main(String[] args) throws IllegalStateException,IOException, AGIException { AGIRequest request = null; AGIChannel channel= null; new DefaultAGIServer().startup(); AstersiskApp AA = new AsteriskApp(); AA.answerChannel(); AA.playAndDetect(); String digit=t.GetDigit(); A.hangupChannel(); } } ------------------------------------------------------ But this doesn't work, because it will only run what is in the method service(request,channel) has anyone got an idea how to do this ? thanks a lot ines ___________________________________________________________________________ Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger Téléchargez cette version sur http://fr.messenger.yahoo.com |
From: Stefan R. <sr...@re...> - 2005-10-28 10:54:51
|
If you want to originate a new call you must use the Manager API (see the tutorial for an example). FastAGI can only handle existing calls that are handed over to your Java application. =3DStefan > Hello, > > I've got a java class with different methods : > - a method which answers the channel > - a method which makes a call > -a method which plays an audio file ... > > this is my java class : > ---------------------------------------------------- > import java.io.IOException; > import net.sf.asterisk.fastagi.AGIChannel; > import net.sf.asterisk.fastagi.AGIException; > import net.sf.asterisk.fastagi.AGIRequest; > import net.sf.asterisk.fastagi.BaseAGIScript; > import net.sf.asterisk.fastagi.DefaultAGIServer; > import net.sf.asterisk.fastagi.command.GetDataCommand; > import net.sf.asterisk.fastagi.reply.AGIReply; > > > public class AsteriskApp extends BaseAGIScript > { > > AGIRequest request; > AGIChannel channel; > > public AsteriskApp() > { > } > > public void service(AGIRequest request, > AGIChannel channel) throws AGIException > { > .... > } > public void answerChannel() throws AGIException > { > answer(); > } > public void playAndDetect() throws > IllegalArgumentException, AGIException > { > channel.sendCommand(new > GetDataCommand("welcom", 1800, 1)); > } > public void hangupChannel() throws AGIException > { > hangup(); > } > > public String GetDigit () throws AGIException > { > String f=3Dnull; > char dig =3D waitForDigit(-1); > return(f.valueOf(dig)); > } > ..... > > } > --------------------------------------------------- > > what i want to do is : > > different application which calls this class and uses > the methods, in different ways > -an application which can make a call > -an application which answers a call, plays a audio > file, wait for digit, ..., hangup > ..... > > > for example : > > ---------------------------------------------------- > import java.io.IOException; > import net.sf.asterisk.fastagi.AGIChannel; > import net.sf.asterisk.fastagi.AGIException; > import net.sf.asterisk.fastagi.AGIRequest; > import net.sf.asterisk.fastagi.DefaultAGIServer; > import net.sf.asterisk.fastagi.command.GetDataCommand; > import > net.sf.asterisk.manager.AuthenticationFailedException; > import net.sf.asterisk.manager.TimeoutException; > > public class Application { > > > public static void main(String[] args) throws > IllegalStateException,IOException, AGIException > { > AGIRequest request =3D null; > AGIChannel channel=3D null; > > new DefaultAGIServer().startup(); > AstersiskApp AA =3D new AsteriskApp(); > AA.answerChannel(); > AA.playAndDetect(); > String digit=3Dt.GetDigit(); > A.hangupChannel(); > } > } > > ------------------------------------------------------ > > > But this doesn't work, because it will only run what > is in the method service(request,channel) > > has anyone got an idea how to do this ? > > thanks a lot > > ines > > > > > > > _______________________________________________________________________= ____ > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messen= ger > T=E9l=E9chargez cette version sur http://fr.messenger.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |