asterisk-java-users Mailing List for Asterisk-Java Library (Page 169)
Brought to you by:
srt
You can subscribe to this list here.
2005 |
Jan
|
Feb
(8) |
Mar
(33) |
Apr
(36) |
May
(19) |
Jun
(21) |
Jul
(53) |
Aug
(30) |
Sep
(36) |
Oct
(34) |
Nov
(43) |
Dec
(72) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(123) |
Feb
(75) |
Mar
(86) |
Apr
(46) |
May
(41) |
Jun
(29) |
Jul
(76) |
Aug
(38) |
Sep
(39) |
Oct
(68) |
Nov
(16) |
Dec
(17) |
2007 |
Jan
(34) |
Feb
(18) |
Mar
(39) |
Apr
(30) |
May
(20) |
Jun
(10) |
Jul
(59) |
Aug
(54) |
Sep
(60) |
Oct
(22) |
Nov
(14) |
Dec
(10) |
2008 |
Jan
(34) |
Feb
(67) |
Mar
(65) |
Apr
(67) |
May
(60) |
Jun
(51) |
Jul
(88) |
Aug
(75) |
Sep
(47) |
Oct
(143) |
Nov
(54) |
Dec
(42) |
2009 |
Jan
(46) |
Feb
(80) |
Mar
(162) |
Apr
(159) |
May
(200) |
Jun
(34) |
Jul
(46) |
Aug
(59) |
Sep
(5) |
Oct
(35) |
Nov
(73) |
Dec
(30) |
2010 |
Jan
(23) |
Feb
(50) |
Mar
(8) |
Apr
(24) |
May
(19) |
Jun
(49) |
Jul
(56) |
Aug
(35) |
Sep
(26) |
Oct
(79) |
Nov
(39) |
Dec
(34) |
2011 |
Jan
(27) |
Feb
(22) |
Mar
(28) |
Apr
(12) |
May
(16) |
Jun
(19) |
Jul
(1) |
Aug
(64) |
Sep
(19) |
Oct
(11) |
Nov
(17) |
Dec
(12) |
2012 |
Jan
(6) |
Feb
(8) |
Mar
(15) |
Apr
(43) |
May
(41) |
Jun
(14) |
Jul
(32) |
Aug
(3) |
Sep
(4) |
Oct
(7) |
Nov
(11) |
Dec
(11) |
2013 |
Jan
(35) |
Feb
(11) |
Mar
(23) |
Apr
(25) |
May
(37) |
Jun
(47) |
Jul
(25) |
Aug
(21) |
Sep
|
Oct
(1) |
Nov
(9) |
Dec
|
2014 |
Jan
(26) |
Feb
(2) |
Mar
(18) |
Apr
(41) |
May
(7) |
Jun
(7) |
Jul
(24) |
Aug
(5) |
Sep
(6) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(7) |
Feb
(15) |
Mar
(8) |
Apr
(12) |
May
(7) |
Jun
|
Jul
|
Aug
(5) |
Sep
(1) |
Oct
(3) |
Nov
(30) |
Dec
(3) |
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(9) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jcc...@is...> - 2005-11-02 09:20:34
|
Hello. First of all, please forgive my bad english. I'm a new user of asterisk-java. I decided to use fastagi because I = think it fits perfect in my project. I followed the tutorial, but I had an error. C:\ASTERISK-JAVA>java -classpath asterisk-java-0.2-rc2.jar;. = net.sf.asterisk.fa tagi.DefaultAGIServer 02-nov-2005 9:45:18 net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Thread pool started. 02-nov-2005 9:45:19 net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Listening on *:4573. 02-nov-2005 9:45:20 net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Received connection. 02-nov-2005 9:45:21 net.sf.asterisk.util.impl.JavaLoggingLog error GRAVE: No script configured for agi://192.168.0.202/hello.agi I think this means the connection between my machine and asterisk's = machine works well, but not the script... Asterisk runs in a linux = machine, and asterisk-java DefaultAGIServer runs in a Windows one. The = fastagi-mapping.properties is located in the directory where I started = running the AGIserver. The content of this file is: hello.agi =3D HelloAGIScript Finally, the content of the HelloAGIScript.java file is: import net.sf.asterisk.fastagi.AGIChannel; import net.sf.asterisk.fastagi.AGIException; import net.sf.asterisk.fastagi.AGIRequest; import net.sf.asterisk.fastagi.BaseAGIScript; public class HelloAGIScript extends BaseAGIScript { public void service(AGIRequest request, AGIChannel channel) throws AGIException { // Answer the channel... answer(); =20 // ...say hello... streamFile("welcome"); =20 // ...and hangup. hangup(); } } Somebody can help me?=20 Thanks |
From: Stefan R. <sr...@re...> - 2005-10-29 13:07:19
|
Asterisk-Java 0.2-rc2, a Java control for the Asterisk PBX, has been=20 released. The Asterisk-Java package consists of a set of Java classes that allow you to easily build Java applications that interact with an Asterisk PBX Server. Asterisk-Java supports both interfaces that Asterisk=20 provides for this scenario: The FastAGI protocol and the Manager API. The 0.2-rc2 release candidate focuses on the new features of=20 the Asterisk 1.2 series though it still supports Asterisk 1.0.x. The changes include * Bug fix for variables in OriginateAction (AJ-15) * Support for FaxReceived event from spandsp (AJ-20) * Better integration with Spring Framework via SimpleMappingStrategy and AGIServerThread Asterisk-Java is used in several commercial environments and by the following Open Source projects: * Asterisk-IM A plugin for the Jive Messenger XMPP (jabber) server. It provides integrated presence between your IM client and phone, notification=20 of incoming calls by IM and originate calls from supported IM=20 clients. * Asterisk Desktop Manager (ADM) A desktop application that will allow for automatic on-call volume=20 reduction, one click dial from clipboard, integrated phonebook and more. Asterisk-Java is available under Apache 2.0 license at http://www.asteriskjava.org |
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 > |
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-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: 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 00:06:56
|
hmm at least with Asterisk-Java 0.2-rc1 I cant reproduce this problem. Are you sure you run the latest version of Asterisk-Java (i.e. 0.2-rc1) ? Asterisk-Java 0.1 has some issues when using Asterisk 1.2. =3DStefan |
From: Samant N. <sa...@ai...> - 2005-10-26 01:06:19
|
CVS Head - 10/10/2005 ----- Original Message ----- From: <ast...@li...> To: <ast...@li...> Sent: Saturday, October 22, 2005 3:31 PM Subject: Asterisk-java-users digest, Vol 1 #99 - 2 msgs > 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. Little help with the Command Action (Samant Nagpaul) > 2. Re: Little help with the Command Action (Stefan Reuter) > > --__--__-- > > Message: 1 > From: "Samant Nagpaul" <sa...@ai...> > To: <ast...@li...> > Date: Fri, 21 Oct 2005 14:07:54 +1000 > Subject: [Asterisk-java-users] Little help with the Command Action > Reply-To: ast...@li... > > This is a multi-part message in MIME format. > > ------=_NextPart_000_0026_01C5D648.D4F71880 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Hello, > > I am getting an error when I try sending a CLI command through the = > command action.=20 > > Has anybody experienced this before? If I run any other action it works = > except CommandAction. > > > INFO: Connecting to 203.62.158.26 port 5038 > # event : net.sf.asterisk.manager.event.ConnectEvent: dateReceived=3DFri = > Oct 21 14:05:33 EST 2005; systemHashcode=3D32019423 > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Connected via Asterisk Call Manager/1.0 > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Successfully logged in > Logged in > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog error > SEVERE: Unable to retrieve internalActionId from response: asterisk sent = > actionId 'null': > net.sf.asterisk.manager.response.CommandResponse: actionId=3D'null'; = > message=3D'null'; response=3D'Follows'; uniqueId=3D'null'; = > systemHashcode=3D2917593 > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: responseHandler not found > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog warn > WARNING: buffer contains neither response nor event > Exception in thread "main" net.sf.asterisk.manager.TimeoutException: = > Timeout waiting for response to Command > at = > net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= > rConnection.java:421) > at = > net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= > rConnection.java:397) > at CManager.runCommand(CManager.java:56) > at CManager.main(CManager.java:27) > > This is the code I am using > > public class CManager implements ManagerEventHandler, = > ManagerResponseHandler > { > private ManagerConnection managerConnection; > =20 > public static void main(String[] args) throws Exception > { > CManager recordingManager; > > recordingManager =3D new CManager(); > recordingManager.runCommand("4003","samant123"); > } > =20 > public CManager() throws IOException > { > ManagerConnectionFactory factory =3D new = > ManagerConnectionFactory(); > this.managerConnection =3D = > factory.getManagerConnection("locahost", "manager", "asterisk"); > } > > public CManager(String ip, String manager_username, String = > manager_password) throws IOException > { > ManagerConnectionFactory factory =3D new = > ManagerConnectionFactory(); > this.managerConnection =3D factory.getManagerConnection(ip, = > manager_username, manager_password); > } > =20 > public String runCommand(String channel, String fileName)=20 > throws IOException, AuthenticationFailedException, TimeoutException > { > this.managerConnection.addEventHandler(this); > > ManagerResponse originateResponse; > > CommandAction commandAction =3D new CommandAction(); > commandAction.setCommand("show voicemail users"); > > managerConnection.login(); > System.out.println("Logged in"); > > originateResponse =3D = > this.managerConnection.sendAction(commandAction); > > String response =3D originateResponse.getResponse(); =20 > =20 > managerConnection.logoff(); > System.out.println("Logged out"); > System.out.println(response); > return response; > } > > > public void handleEvent(ManagerEvent event) > { > System.out.println ("# event : " + event); > } > =20 > public void handleResponse(ManagerResponse response) > { > System.out.println ("# response : " + response); > System.out.println ("# response : " + response.getAttributes()); > } > =20 > } > > ------=_NextPart_000_0026_01C5D648.D4F71880 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <HTML><HEAD> > <META http-equiv=3DContent-Type content=3D"text/html; = > charset=3Diso-8859-1"> > <META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR> > <STYLE></STYLE> > </HEAD> > <BODY bgColor=3D#ffffff><FONT face=3DArial size=3D2> > <DIV>Hello,</DIV> > <DIV> </DIV> > <DIV>I am getting an error when I try sending a CLI command through the = > command=20 > action. </DIV> > <DIV> </DIV> > <DIV>Has anybody experienced this before? If I run any other action it = > works=20 > except CommandAction.</DIV> > <DIV> </DIV> > <DIV> </DIV> > <DIV>INFO: Connecting to 203.62.158.26 port 5038<BR># event :=20 > net.sf.asterisk.manager.event.ConnectEvent: dateReceived=3DFri Oct 21 = > 14:05:33 EST=20 > 2005; systemHashcode=3D32019423<BR>21/10/2005 14:05:33=20 > net.sf.asterisk.util.impl.JavaLoggingLog info<BR>INFO: Connected via = > Asterisk=20 > Call Manager/1.0<BR>21/10/2005 14:05:33 = > net.sf.asterisk.util.impl.JavaLoggingLog=20 > info<BR>INFO: Successfully logged in<BR>Logged in<BR>21/10/2005 14:05:33 = > > net.sf.asterisk.util.impl.JavaLoggingLog error<BR>SEVERE: Unable to = > retrieve=20 > internalActionId from response: asterisk sent actionId=20 > 'null':<BR>net.sf.asterisk.manager.response.CommandResponse: = > actionId=3D'null';=20 > message=3D'null'; response=3D'Follows'; uniqueId=3D'null';=20 > systemHashcode=3D2917593<BR>21/10/2005 14:05:33=20 > net.sf.asterisk.util.impl.JavaLoggingLog info<BR>INFO: responseHandler = > not=20 > found<BR>21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog=20 > warn<BR>WARNING: buffer contains neither response nor event<BR>Exception = > in=20 > thread "main" net.sf.asterisk.manager.TimeoutException: Timeout waiting = > for=20 > response to Command<BR> at=20 > net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= > rConnection.java:421)<BR> =20 > at=20 > net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= > rConnection.java:397)<BR> =20 > at=20 > CManager.runCommand(CManager.java:56)<BR> &n= > bsp; =20 > at CManager.main(CManager.java:27)</DIV> > <DIV> </DIV> > <DIV>This is the code I am using</DIV> > <DIV><BR>public class CManager implements ManagerEventHandler,=20 > ManagerResponseHandler<BR>{<BR> private ManagerConnection=20 > managerConnection;<BR> <BR> public static void main(String[] = > args)=20 > throws Exception<BR> {<BR> CManager = > recordingManager;</DIV> > <DIV> </DIV> > <DIV> recordingManager =3D new=20 > CManager();<BR> recordingManager.runCommand("4003","samant123"= > );<BR> }<BR> <BR> public=20 > CManager() throws IOException<BR> =20 > {<BR> ManagerConnectionFactory = > factory=20 > =3D new = > ManagerConnectionFactory();<BR> = > =20 > this.managerConnection =3D factory.getManagerConnection("locahost", = > "manager",=20 > "asterisk");<BR> }</DIV> > <DIV> </DIV> > <DIV> public CManager(String ip, String manager_username, String=20 > manager_password) throws IOException<BR> =20 > {<BR> ManagerConnectionFactory = > factory=20 > =3D new = > ManagerConnectionFactory();<BR> = > =20 > this.managerConnection =3D factory.getManagerConnection(ip, = > manager_username,=20 > manager_password);<BR> = > }<BR> <BR> =20 > public String runCommand(String channel, String fileName) = > <BR> =20 > throws IOException, AuthenticationFailedException,=20 > TimeoutException<BR> =20 > {<BR> this.managerConnection.addEventHandler(this);</DIV> > <DIV> </DIV> > <DIV> ManagerResponse=20 > originateResponse;</DIV> > <DIV> </DIV> > <DIV> CommandAction = > commandAction =3D=20 > new CommandAction();<BR> commandAction.setCommand("show = > voicemail=20 > users");</DIV> > <DIV> </DIV> > <DIV> managerConnection.login();<BR> &n= > bsp; =20 > System.out.println("Logged in");</DIV> > <DIV> </DIV> > <DIV> originateResponse =3D=20 > this.managerConnection.sendAction(commandAction);</DIV> > <DIV> </DIV> > <DIV> String response =3D=20 > originateResponse.getResponse(); =20 > <BR> =20 > <BR> =20 > managerConnection.logoff();<BR> = > =20 > System.out.println("Logged = > out");<BR> =20 > System.out.println(response);<BR> &nbs= > p;=20 > return response;<BR> }</DIV> > <DIV> </DIV> > <DIV><BR> public void handleEvent(ManagerEvent = > event)<BR> =20 > {<BR> System.out.println ("# event : = > " +=20 > event);<BR> }<BR> <BR> public void=20 > handleResponse(ManagerResponse response)<BR> =20 > {<BR> System.out.println ("# = > response : " +=20 > response);<BR> System.out.println = > ("#=20 > response : " + response.getAttributes());<BR> =20 > }<BR> <BR>}<BR></DIV></FONT></BODY></HTML> > > ------=_NextPart_000_0026_01C5D648.D4F71880-- > > > > --__--__-- > > Message: 2 > Subject: Re: [Asterisk-java-users] Little help with the Command Action > From: Stefan Reuter <sr...@re...> > To: ast...@li... > Date: Fri, 21 Oct 2005 06:29:34 +0000 > Reply-To: ast...@li... > > > --=-KlynJpwKZIRhTb3fM7Bl > Content-Type: text/plain > Content-Transfer-Encoding: quoted-printable > > Hi, > > what version of Asterisk do you use? > > =3DStefan > > On Fri, 2005-10-21 at 14:07 +1000, Samant Nagpaul wrote: >> Hello, >> =20 >> I am getting an error when I try sending a CLI command through the >> command action.=20 >> =20 >> Has anybody experienced this before? If I run any other action it >> works except CommandAction. >> =20 >> =20 >> INFO: Connecting to 203.62.158.26 port 5038 >> # event : net.sf.asterisk.manager.event.ConnectEvent: dateReceived=3DFri >> Oct 21 14:05:33 EST 2005; systemHashcode=3D32019423 >> 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info >> INFO: Connected via Asterisk Call Manager/1.0 >> 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info >> INFO: Successfully logged in >> Logged in >> 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog error >> SEVERE: Unable to retrieve internalActionId from response: asterisk >> sent actionId 'null': >> net.sf.asterisk.manager.response.CommandResponse: actionId=3D'null'; >> message=3D'null'; response=3D'Follows'; uniqueId=3D'null'; >> systemHashcode=3D2917593 >> 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info >> INFO: responseHandler not found >> 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog warn >> WARNING: buffer contains neither response nor event >> Exception in thread "main" net.sf.asterisk.manager.TimeoutException: >> Timeout waiting for response to Command >> at >> net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= > rConnection.java:421) >> at >> net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= > rConnection.java:397) >> at CManager.runCommand(CManager.java:56) >> at CManager.main(CManager.java:27) >> =20 >> This is the code I am using >>=20 >> public class CManager implements ManagerEventHandler, >> ManagerResponseHandler >> { >> private ManagerConnection managerConnection; >> =20 >> public static void main(String[] args) throws Exception >> { >> CManager recordingManager; >> =20 >> recordingManager =3D new CManager(); >> recordingManager.runCommand("4003","samant123"); >> } >> =20 >> public CManager() throws IOException >> { >> ManagerConnectionFactory factory =3D new >> ManagerConnectionFactory(); >> this.managerConnection =3D >> factory.getManagerConnection("locahost", "manager", "asterisk"); >> } >> =20 >> public CManager(String ip, String manager_username, String >> manager_password) throws IOException >> { >> ManagerConnectionFactory factory =3D new >> ManagerConnectionFactory(); >> this.managerConnection =3D factory.getManagerConnection(ip, >> manager_username, manager_password); >> } >> =20 >> public String runCommand(String channel, String fileName)=20 >> throws IOException, AuthenticationFailedException, >> TimeoutException >> { >> this.managerConnection.addEventHandler(this); >> =20 >> ManagerResponse originateResponse; >> =20 >> CommandAction commandAction =3D new CommandAction(); >> commandAction.setCommand("show voicemail users"); >> =20 >> managerConnection.login(); >> System.out.println("Logged in"); >> =20 >> originateResponse =3D >> this.managerConnection.sendAction(commandAction); >> =20 >> String response =3D originateResponse.getResponse(); =20 >> =20 >> managerConnection.logoff(); >> System.out.println("Logged out"); >> System.out.println(response); >> return response; >> } >> =20 >>=20 >> public void handleEvent(ManagerEvent event) >> { >> System.out.println ("# event : " + event); >> } >> =20 >> public void handleResponse(ManagerResponse response) >> { >> System.out.println ("# response : " + response); >> System.out.println ("# response : " + >> response.getAttributes()); >> } >> =20 >> } >>=20 > > --=-KlynJpwKZIRhTb3fM7Bl > Content-Type: application/pgp-signature; name=signature.asc > Content-Description: This is a digitally signed message part > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.2 (GNU/Linux) > > iD8DBQBDWIrOTUZ7XZofpgURAiziAJ0dx8xrjGfbI9cwPIH3DtPZFFmgXwCfZCr0 > 6aA3qKxAtOilS/JpuF3mPg8= > =8/u2 > -----END PGP SIGNATURE----- > > --=-KlynJpwKZIRhTb3fM7Bl-- > > > > > --__--__-- > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > End of Asterisk-java-users Digest |
From: Stefan R. <sr...@re...> - 2005-10-21 06:29:47
|
Hi, what version of Asterisk do you use? =3DStefan On Fri, 2005-10-21 at 14:07 +1000, Samant Nagpaul wrote: > Hello, > =20 > I am getting an error when I try sending a CLI command through the > command action.=20 > =20 > Has anybody experienced this before? If I run any other action it > works except CommandAction. > =20 > =20 > INFO: Connecting to 203.62.158.26 port 5038 > # event : net.sf.asterisk.manager.event.ConnectEvent: dateReceived=3DFri > Oct 21 14:05:33 EST 2005; systemHashcode=3D32019423 > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Connected via Asterisk Call Manager/1.0 > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Successfully logged in > Logged in > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog error > SEVERE: Unable to retrieve internalActionId from response: asterisk > sent actionId 'null': > net.sf.asterisk.manager.response.CommandResponse: actionId=3D'null'; > message=3D'null'; response=3D'Follows'; uniqueId=3D'null'; > systemHashcode=3D2917593 > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: responseHandler not found > 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog warn > WARNING: buffer contains neither response nor event > Exception in thread "main" net.sf.asterisk.manager.TimeoutException: > Timeout waiting for response to Command > at > net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= rConnection.java:421) > at > net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= rConnection.java:397) > at CManager.runCommand(CManager.java:56) > at CManager.main(CManager.java:27) > =20 > This is the code I am using >=20 > public class CManager implements ManagerEventHandler, > ManagerResponseHandler > { > private ManagerConnection managerConnection; > =20 > public static void main(String[] args) throws Exception > { > CManager recordingManager; > =20 > recordingManager =3D new CManager(); > recordingManager.runCommand("4003","samant123"); > } > =20 > public CManager() throws IOException > { > ManagerConnectionFactory factory =3D new > ManagerConnectionFactory(); > this.managerConnection =3D > factory.getManagerConnection("locahost", "manager", "asterisk"); > } > =20 > public CManager(String ip, String manager_username, String > manager_password) throws IOException > { > ManagerConnectionFactory factory =3D new > ManagerConnectionFactory(); > this.managerConnection =3D factory.getManagerConnection(ip, > manager_username, manager_password); > } > =20 > public String runCommand(String channel, String fileName)=20 > throws IOException, AuthenticationFailedException, > TimeoutException > { > this.managerConnection.addEventHandler(this); > =20 > ManagerResponse originateResponse; > =20 > CommandAction commandAction =3D new CommandAction(); > commandAction.setCommand("show voicemail users"); > =20 > managerConnection.login(); > System.out.println("Logged in"); > =20 > originateResponse =3D > this.managerConnection.sendAction(commandAction); > =20 > String response =3D originateResponse.getResponse(); =20 > =20 > managerConnection.logoff(); > System.out.println("Logged out"); > System.out.println(response); > return response; > } > =20 >=20 > public void handleEvent(ManagerEvent event) > { > System.out.println ("# event : " + event); > } > =20 > public void handleResponse(ManagerResponse response) > { > System.out.println ("# response : " + response); > System.out.println ("# response : " + > response.getAttributes()); > } > =20 > } >=20 |
From: Samant N. <sa...@ai...> - 2005-10-21 04:10:07
|
Hello, I am getting an error when I try sending a CLI command through the = command action.=20 Has anybody experienced this before? If I run any other action it works = except CommandAction. INFO: Connecting to 203.62.158.26 port 5038 # event : net.sf.asterisk.manager.event.ConnectEvent: dateReceived=3DFri = Oct 21 14:05:33 EST 2005; systemHashcode=3D32019423 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Connected via Asterisk Call Manager/1.0 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Successfully logged in Logged in 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog error SEVERE: Unable to retrieve internalActionId from response: asterisk sent = actionId 'null': net.sf.asterisk.manager.response.CommandResponse: actionId=3D'null'; = message=3D'null'; response=3D'Follows'; uniqueId=3D'null'; = systemHashcode=3D2917593 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog info INFO: responseHandler not found 21/10/2005 14:05:33 net.sf.asterisk.util.impl.JavaLoggingLog warn WARNING: buffer contains neither response nor event Exception in thread "main" net.sf.asterisk.manager.TimeoutException: = Timeout waiting for response to Command at = net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= rConnection.java:421) at = net.sf.asterisk.manager.DefaultManagerConnection.sendAction(DefaultManage= rConnection.java:397) at CManager.runCommand(CManager.java:56) at CManager.main(CManager.java:27) This is the code I am using public class CManager implements ManagerEventHandler, = ManagerResponseHandler { private ManagerConnection managerConnection; =20 public static void main(String[] args) throws Exception { CManager recordingManager; recordingManager =3D new CManager(); recordingManager.runCommand("4003","samant123"); } =20 public CManager() throws IOException { ManagerConnectionFactory factory =3D new = ManagerConnectionFactory(); this.managerConnection =3D = factory.getManagerConnection("locahost", "manager", "asterisk"); } public CManager(String ip, String manager_username, String = manager_password) throws IOException { ManagerConnectionFactory factory =3D new = ManagerConnectionFactory(); this.managerConnection =3D factory.getManagerConnection(ip, = manager_username, manager_password); } =20 public String runCommand(String channel, String fileName)=20 throws IOException, AuthenticationFailedException, TimeoutException { this.managerConnection.addEventHandler(this); ManagerResponse originateResponse; CommandAction commandAction =3D new CommandAction(); commandAction.setCommand("show voicemail users"); managerConnection.login(); System.out.println("Logged in"); originateResponse =3D = this.managerConnection.sendAction(commandAction); String response =3D originateResponse.getResponse(); =20 =20 managerConnection.logoff(); System.out.println("Logged out"); System.out.println(response); return response; } public void handleEvent(ManagerEvent event) { System.out.println ("# event : " + event); } =20 public void handleResponse(ManagerResponse response) { System.out.println ("# response : " + response); System.out.println ("# response : " + response.getAttributes()); } =20 } |
From: Stefan R. <sr...@re...> - 2005-10-20 11:33:51
|
Just for the archives and anybody who might encounter a similar problem i= n the future: > The problem i was having was that the connection was refused. [...] > ******************************* > Here is the error message from java: > ******************************* > Oct 19, 2005 2:19:03 AM net.sf.asterisk.util.impl.JavaLoggingLog info > INFO: Connecting to localhost port 5038 > java.net.ConnectException: Connection refused > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:1= 71) [...] > ******************************* > telnet from another console > ******************************* > cm@laptop:~> telnet 127.0.0.1 5038 > Trying 127.0.0.1... > Connected to 127.0.0.1. > Escape character is '^]'. > Asterisk Call Manager/1.0 so using telnet worked but using the Manager API via Asterisk-Java did no= t. After some investigation it turned out that the cause of this strange behaviour was that the Asterisk-Java code tried to connect to 'localhost'= . Given the following in /etc/hosts (the default for SuSE Linux): 127.0.0.1 localhost # special IPv6 addresses ::1 localhost ipv6-localhost ipv6-loopback localhost could resolve to either 127.0.0.1 or ::1. As Asterisk does not yet support IPV6 out of the box the Manager API is only available on 127.0.0.1 and not on ::1. Asterisk-Java currently does not try to connect to every IP that a hostname may resolve to. So whenever 'localhost' resolved to ::1 it cause= d a connection refused. The solution to this problem is to change /etc/hosts to something like: 127.0.0.1 localhost # special IPv6 addresses ::1 ipv6-localhost ipv6-loopback i.e. mapping localhost only to 127.0.0.1. Another option is to comment out the ::1 completely (if you dont need it for any other purposes). =3DStefan |
From: christopher m. <cm...@mb...> - 2005-10-18 16:25:28
|
Hello, I submitted a query a week or so ago regarding connecting a problem i was having with connecting my csta implementation with asterisk with asterisk-java. I've again checked my work and i'm sure everything is how it is supposed to be. my source code at http://sourceforge.net/projects/oscsta if anyone is interested. It's messy code at the moment because I've just been hacking at it willy nilly. In the coming weeks I'll neaten it up and get the javadocs and other accompanying docs in order. it works, with the serial port code in place, on siemens hipath 3000 pbxs. There is a class in the csta.server.asterisk package called BogusAsteriskConnection.java which is copied at the bottom of the page. The problem i was having was that the connection was refused. Following is: * the error message from java * the config of manager.conf * show manager connected from asterisk CLI after telnet is done * telnet from another console * the code from BogusAsteriskConnection.java * no firewall is running ******************************* Here is the error message from java: ******************************* Oct 19, 2005 2:19:03 AM net.sf.asterisk.util.impl.JavaLoggingLog info INFO: Connecting to localhost port 5038 java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:124) at net.sf.asterisk.io.SocketConnectionFacadeImpl.<init>(SocketConnectionFacadeImpl.java:34) at net.sf.asterisk.manager.DefaultManagerConnection.createSocket(DefaultManagerConnection.java:343) at net.sf.asterisk.manager.DefaultManagerConnection.connect(DefaultManagerConnection.java:332) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:253) at net.sf.asterisk.manager.DefaultManagerConnection.login(DefaultManagerConnection.java:221) at csta.server.asterisk.BogusAsteriskConnection.run(BogusAsteriskConnection.java:141) at csta.server.asterisk.BogusAsteriskConnection.<init>(BogusAsteriskConnection.java:51) at csta.server.CSTAServer.<init>(CSTAServer.java:109) at start_CSTAServer.start_application(start_CSTAServer.java:46) at start_CSTAServer.main(start_CSTAServer.java:31) ******************************** manager.conf ******************************* [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 permit = 0.0.0.0/0.0.0.0 ;displayconnects = yes [mylo] secret=password permit=0.0.0.0/0.0.0.0 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user ******************************** show manager connected before telnet ******************************** *CLI> show manager connected Username IP Address ******************************* and after connection with telnet ******************************* *CLI> show manager connected Username IP Address 127.0.0.1 *CLI> ******************************* telnet from another console ******************************* cm@laptop:~> telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. Asterisk Call Manager/1.0 ***************************** the BogusAsteriskConnection.java ****************************** /* * oscsta -- Open Source CSTA. * * oscsta-j - Open Source CSTA - java. * * Copyright (C) 2003-2005, Christopher Mylonas * * Christopher Mylonas <osc...@mr...> * * This program is free software, distributed under the terms of * the GNU General Public License */ /* * BogusAsteriskConnection.java * * Created on September 10, 2005, 2:39 PM */ package csta.server.asterisk; import csta.stack.callControl.events.ServiceInitiated ; import csta.stack.callControl.events.ConnectionCleared ; 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.TimeoutException; import net.sf.asterisk.manager.action.OriginateAction; import net.sf.asterisk.manager.response.ManagerResponse; /** * * @author cm * What's gonna happen here is this class has the connection to asterisk. * It will receive the events from whatever channels, and fire off the * CSTA events. This class will then handover to the CSTAServer most of * the CSTA string. The remainder of the string needs to be completed by * the server from the MonitorCrossReferenceID backwards - that is, all * the administrative stuff a server has to do e.g. callid_id and wrap * the string up. */ public class BogusAsteriskConnection implements AsteriskEvents{ int callid_a, callid_b, callid_c, callid_d = 0 ; public static final int INTEGER = 0x02 ; private ManagerConnection managerConnection ; /** Creates a new instance of BogusAsteriskConnection */ public BogusAsteriskConnection() { try{ ManagerConnectionFactory factory = new ManagerConnectionFactory(); this.managerConnection = factory.getManagerConnection("localhost", "mylo", "password"); run() ; }catch(IOException e){ e.printStackTrace() ; }catch(AuthenticationFailedException e2){ e2.printStackTrace() ; }catch(TimeoutException e3){ e3.printStackTrace() ; } } //probably get an extension and a cause from asterisk. //have to get a valid call_id from CSTAServer if asterisk doesn't //provide one. public void fire_ServiceInitiated(String ext){ System.out.println("Firing asterisk service initiated") ; //get a call_id from the csta server String call_id = CallIDGeneration() ; String time = "20050922121555" ; ServiceInitiated si = new ServiceInitiated(ext, call_id,time) ; } public void fire_ConnectionCleared(String ext){ System.out.println("Firing asterisk service initiated") ; //get a call_id from the csta server String call_id = CallIDGeneration() ; String time = "20050922121555" ; ConnectionCleared cc = new ConnectionCleared(ext, call_id,time) ; } private String CallIDGeneration(){ String callid_id = new String() ; callid_a++ ; if( callid_a > 255 ){ callid_a = 0 ; callid_b++ ; if( callid_b > 255 ){ callid_b = 0 ; callid_c++ ; if( callid_c > 255 ){ callid_c = 0 ; callid_d++ ; if( callid_d > 255 ){ callid_d = 0 ; callid_a = 1 ; } } } } if( callid_d > 0 ){ char[] invID = { (char)callid_d, (char)callid_c, (char)callid_b, (char)callid_a } ; callid_id = new String(invID) ; return callid_id ; } else if( callid_c > 0 ){ char[] invID = { (char)callid_c, (char)callid_b, (char)callid_a } ; callid_id = new String(invID) ; return callid_id ; } else if( callid_b >= 0 ){ char[] invID = { (char)callid_b, (char)callid_a } ; callid_id = new String(invID) ; return callid_id ; } //commenting below ensures a call id with length of 2 is mandatory // else if( callid_a > 0 ){ // char[] invID = { (char)callid_a } ; // callid_id = new String(invID) ; // return callid_id ; // } return callid_id ; } public StringBuffer GetCallID(){ StringBuffer sb = new StringBuffer() ; String inv_id = CallIDGeneration() ; sb = sb.insert(0, inv_id).insert(0,(char)inv_id.length()).insert(0, (char)INTEGER) ; return sb ; } public void run() throws IOException, AuthenticationFailedException, TimeoutException{ OriginateAction originateAction; ManagerResponse originateResponse; originateAction = new OriginateAction(); originateAction.setChannel("SIP/John"); originateAction.setContext("default"); originateAction.setExten("1300"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Integer(30000)); // connect to Asterisk and log in managerConnection.login(); // send the originate action and wait for a maximum of 30 seconds for Asterisk // to send a reply originateResponse = managerConnection.sendAction(originateAction, 30000); // print out whether the originate succeeded or not System.out.println(originateResponse.getResponse()); // and finally log off and disconnect managerConnection.logoff(); } } *********************** and i repeat no firewall running *********************** from within yast (on SuSE 9.3) whatever the message says along the lines of "firewall is not currently running Many thanks :) mylo |
From: Jan E. <jan...@pl...> - 2005-10-13 05:55:04
|
On Wednesday 05 October 2005 17:07, Stefan Reuter wrote: > Hi Christopher, > > > There is no firewall set, asterisk is running and the manager is enabled > > as > > per the instructions. I get this from the stack trace though........ > > > > at > > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at > > java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at > > java.net.Socket.connect(Socket.java:452) > > hmm you did not include the exception message, that makes things a little > bit harder... I suppose what you got was a "Connection refused" exception > that means you supplied a wrong hostname/ip address or port or the > Asterisk server does not listen on the manager port (or there _is_ a > firewall ;). > Make sure your asterisk is configured properly (and restarted afterwards) > and test the connection from the machine running Asterisk-Java via telnet > (port 5038). Also make sure Asterisk allows connects to the AMI from your system. On our 1.09 the file to check is /etc/asterisk/manager.conf and the setting "permit" and "deny" in [admin]. I wondered a while why I got "Connection refused" until I understood to check and change that setting (the default seems to be to only allow 127.0.0.1 to connect). -- Jan Ekholm jan...@pl... |
From: Stefan R. <sr...@re...> - 2005-10-13 00:44:21
|
Hi Christopher, > There is no firewall set, asterisk is running and the manager is enable= d > as > per the instructions. I get this from the stack trace though........ > > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:1= 71) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) > at java.net.Socket.connect(Socket.java:452) hmm you did not include the exception message, that makes things a little bit harder... I suppose what you got was a "Connection refused" exception that means you supplied a wrong hostname/ip address or port or the Asterisk server does not listen on the manager port (or there _is_ a firewall ;). Make sure your asterisk is configured properly (and restarted afterwards) and test the connection from the machine running Asterisk-Java via telnet (port 5038). =3DStefan |
From: Stefan R. <sr...@re...> - 2005-10-10 21:42:58
|
On Mon, 2005-10-10 at 00:51 -0400, Robert Augustyn wrote: > Stefan, > Thanks, how about running it as mbean? > This way all the calls to rmi will be in the same jvm ... i dont know much about mbeans and if they are allowed to create threads. if yes thats a valid alternative. =3DStefan |
From: Robert A. <aug...@ya...> - 2005-10-10 04:51:13
|
Stefan, Thanks, how about running it as mbean? This way all the calls to rmi will be in the same jvm ... robert > -----Original Message----- > From: ast...@li... > [mailto:ast...@li...] On > Behalf Of Stefan Reuter > Sent: Sunday, October 09, 2005 10:56 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] Is it possible to > integrateasterisk-java into jboss? > > On Sun, 2005-10-09 at 21:05 -0400, Robert Augustyn wrote: > > Hi, > > Is it possible to run asterisk-java from jboss? > > If so how to accomplish this? What would be the best solution? > > I believe that j2ee container should not allow applications manage > > threads > > it is possible but it violates the spec. the "correct" way is > to run you agi server in a seperate vm and let it talk to > your ejbs via rmi. > > =Stefan > |
From: Stefan R. <sr...@re...> - 2005-10-10 02:59:24
|
On Fri, 2005-10-07 at 11:20 +0200, Laurent Salagaras wrote: > I had already done that: > Call call =3D astManager.originateCall( origCall ); > Channel ch =3D call.getChannel(); >=20 > But the problem is that once the call has been established > the the result return by the 'call.getChannel();' sentence > is null.=20 thats probably a bug. I created http://jira.reucon.org/browse/AJ-17 to keep track of it. =3DStefan |
From: Stefan R. <sr...@re...> - 2005-10-10 02:57:11
|
On Sun, 2005-10-09 at 21:07 -0400, Robert Augustyn wrote: > Hi, > I have looked through the list and the site but did not see anything that > would help solving this ... > Any pointers would be greatly appreciated. If it is a static message just configure an extension in your dialplan to play that message an originate a call to that extension (via OriginateAction) if it is dynamic create an AGIScript that plays the message and originate a call to that AGIScript. =3DStefan |
From: Stefan R. <sr...@re...> - 2005-10-10 02:55:38
|
On Sun, 2005-10-09 at 21:05 -0400, Robert Augustyn wrote: > Hi, > Is it possible to run asterisk-java from jboss? > If so how to accomplish this? What would be the best solution? > I believe that j2ee container should not allow applications manage thread= s it is possible but it violates the spec. the "correct" way is to run you agi server in a seperate vm and let it talk to your ejbs via rmi. =3DStefan |
From: Robert A. <aug...@ya...> - 2005-10-10 01:07:48
|
Hi, I have looked through the list and the site but did not see anything that would help solving this ... Any pointers would be greatly appreciated. Thanks. robert |
From: Robert A. <aug...@ya...> - 2005-10-10 01:05:26
|
Hi, Is it possible to run asterisk-java from jboss? If so how to accomplish this? What would be the best solution? I believe that j2ee container should not allow applications manage threads ... Thanks, robert |
From: Pablo I. <pmi...@ya...> - 2005-10-07 11:58:20
|
Hi, Setting an action ID solved the problem, I thought that it will use the internal one if none was provided. Thanks, Stefan ___________________________________________________________ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar |
From: Laurent S. <lau...@pr...> - 2005-10-07 09:20:37
|
Hello Stefan, First thank you for your quick answer. I had already done that: Call call = astManager.originateCall( origCall ); Channel ch = call.getChannel(); But the problem is that once the call has been established the the result return by the 'call.getChannel();' sentence is null. Using the debuger I saw that most of the fields of the 'Call ' objects are null. None of them allows me to make an association between the originateCall and the resultant call. Furthermore I tried to use the following method: public void displayChannels( AsteriskManager astManager ) { Map map = astManager.getChannels(); if( map.isEmpty() == true ) System.out.println( "The MAP is empty." ); System.out.println("Map content: " + map ); } ... but in my big surprise despite the fact that a call was established no calls were available in the list. Do you have any suggestions? Please find hereafter my configuration: - asterisk v1.0.9 - Asterisk-Java 0.2-rc1 For your question: Indeed I know that I could hangup the application inside the diaplan. But I want to keep the control logic at manager level in order to be able to add other commands as transfers, queueing ... Thanking you in advance, Laurent ----- Original Message ----- From: "Stefan Reuter" <sr...@re...> To: <ast...@li...> Sent: Thursday, October 06, 2005 9:42 PM Subject: Re: [Asterisk-java-users] Originating calls On Thu, 2005-10-06 at 17:37 +0200, Laurent Salagaras wrote: > Currently I am encoutering the following problem. I succeed > to login to Asterisk and initiate a call (both with the > OriginateAction > and with the originateCall method of AsteriskManager). > [...] > However in both methods I do not have as return value the identifier > of the call (or channel). > (e.g.: SIP/laurent-b7485# ) originateCall() in AsteriskManager returns a Call object. call.getChannel().getName() will return what you are looking for. But another question: Do you really need to hangup the call via the Manager API or wouldn't it be easier to just hang up after playing the sound file (via dialplan or AGI or whatever you use) =Stefan |
From: Stefan R. <sr...@re...> - 2005-10-06 19:42:31
|
On Thu, 2005-10-06 at 17:37 +0200, Laurent Salagaras wrote: > Currently I am encoutering the following problem. I succeed > to login to Asterisk and initiate a call (both with the > OriginateAction > and with the originateCall method of AsteriskManager). > =20 [...] > However in both methods I do not have as return value the identifier > of the call (or channel). > (e.g.: SIP/laurent-b7485# ) originateCall() in AsteriskManager returns a Call object. call.getChannel().getName() will return what you are looking for. But another question: Do you really need to hangup the call via the Manager API or wouldn't it be easier to just hang up after playing the sound file (via dialplan or AGI or whatever you use) =3DStefan |
From: Stefan R. <sr...@re...> - 2005-10-06 19:31:50
|
Hi, > actionID. I followed the trace to this point: >=20 > if (actionId !=3D null) > { > internalActionId =3D > Util.getInternalActionId(actionId); =20 > response.setActionId(Util.stripInternalActionId(actionId)); > } >=20 > , on DefaultManagerConnection. > The problem is that the first call to > Util.getInternalActionId(actionId) erases the final # > from the actionID, so the second call doesn't > recognize the format, and returns null. Util.getInternalActionId(actionId) does not change the actionId (actually it can't even do so as Strings in Java are immutable objects) it assigns the part before the first # to internalActionId. response.setActionId(Util.stripInternalActionId(actionId)); assigns the part following the first # to the actionId property of the response object, so that should contain the actionId you set on the corresponding Action object, if any. Did you set the actionId on your Action before sending it to asterisk? If you did your response should contain exactly that id. If not thats a bug. Can you provide a short test case that demonstrates your problem and open a bug in jira? (http://jira.reucon.com) Thanks =3DStefan |