asterisk-java-cvs Mailing List for Asterisk-Java Library (Page 96)
Brought to you by:
srt
You can subscribe to this list here.
| 2005 |
Jan
(4) |
Feb
(75) |
Mar
(211) |
Apr
(70) |
May
(12) |
Jun
(7) |
Jul
(96) |
Aug
(90) |
Sep
(11) |
Oct
(42) |
Nov
(45) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(20) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(32) |
Aug
|
Sep
(4) |
Oct
(2) |
Nov
(10) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(3) |
Aug
(73) |
Sep
(13) |
Oct
(4) |
Nov
(1) |
Dec
(7) |
| 2009 |
Jan
(1) |
Feb
(2) |
Mar
(48) |
Apr
(21) |
May
(14) |
Jun
(11) |
Jul
(9) |
Aug
(2) |
Sep
(11) |
Oct
(14) |
Nov
(6) |
Dec
(4) |
| 2010 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
|
May
(3) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(12) |
| 2011 |
Jan
(1) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(10) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2012 |
Jan
(3) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(2) |
Dec
(2) |
| 2013 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
| 2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(5) |
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(25) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(3) |
Dec
(1) |
| 2016 |
Jan
|
Feb
(42) |
Mar
(6) |
Apr
(15) |
May
(3) |
Jun
(1) |
Jul
(11) |
Aug
|
Sep
|
Oct
(17) |
Nov
(2) |
Dec
|
| 2017 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(3) |
May
(2) |
Jun
(3) |
Jul
(7) |
Aug
(11) |
Sep
(5) |
Oct
(7) |
Nov
(4) |
Dec
(4) |
| 2018 |
Jan
(11) |
Feb
(11) |
Mar
(3) |
Apr
|
May
(9) |
Jun
(6) |
Jul
(17) |
Aug
(9) |
Sep
(2) |
Oct
(4) |
Nov
(3) |
Dec
(3) |
| 2019 |
Jan
(13) |
Feb
(1) |
Mar
(1) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(6) |
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2020 |
Jan
(2) |
Feb
(72) |
Mar
(8) |
Apr
(11) |
May
(12) |
Jun
(3) |
Jul
(12) |
Aug
(3) |
Sep
(5) |
Oct
(4) |
Nov
|
Dec
(9) |
| 2021 |
Jan
|
Feb
(31) |
Mar
(6) |
Apr
(3) |
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
(9) |
Nov
|
Dec
(32) |
| 2022 |
Jan
(5) |
Feb
(7) |
Mar
(2) |
Apr
(3) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(2) |
Oct
(111) |
Nov
(105) |
Dec
(26) |
| 2023 |
Jan
(25) |
Feb
(6) |
Mar
(10) |
Apr
(54) |
May
(41) |
Jun
(24) |
Jul
(6) |
Aug
(11) |
Sep
(9) |
Oct
(8) |
Nov
(55) |
Dec
(34) |
| 2024 |
Jan
(6) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(89) |
Sep
(48) |
Oct
(31) |
Nov
(9) |
Dec
(19) |
| 2025 |
Jan
(12) |
Feb
(18) |
Mar
(9) |
Apr
(7) |
May
|
Jun
(7) |
Jul
(7) |
Aug
(3) |
Sep
(22) |
Oct
(23) |
Nov
(7) |
Dec
(55) |
|
From: Stefan R. <sr...@us...> - 2005-03-10 13:45:13
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16151/src/test/net/sf/asterisk/util Log Message: Directory /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/util added to the repository |
|
From: Stefan R. <sr...@us...> - 2005-03-10 13:44:44
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16005/src/test/net/sf/asterisk/fastagi Added Files: DefaultAGIServerTest.java Log Message: Added DefaultAGIServer --- NEW FILE: DefaultAGIServerTest.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import org.easymock.MockControl; import net.sf.asterisk.io.ServerSocketFacade; import net.sf.asterisk.io.SocketConnectionFacade; import junit.framework.TestCase; public class DefaultAGIServerTest extends TestCase { private DefaultAGIServer server; private MockControl serverSocketMC; private ServerSocketFacade serverSocket; protected void setUp() throws Exception { super.setUp(); serverSocketMC = MockControl.createControl(ServerSocketFacade.class); serverSocket = (ServerSocketFacade) serverSocketMC.getMock(); server = new MockedDefaultAGIServer(); } protected void tearDown() throws Exception { super.tearDown(); server.shutdown(); } public void testStartup() throws Exception { MockControl socketMC; SocketConnectionFacade socket; socketMC = MockControl.createControl(SocketConnectionFacade.class); socket = (SocketConnectionFacade) socketMC.getMock(); socket.readLine(); socketMC.setReturnValue(null); socket.close(); socketMC.replay(); serverSocket.accept(); serverSocketMC.setReturnValue(socket); serverSocket.accept(); serverSocketMC.setThrowable(new IOException()); serverSocket.close(); serverSocketMC.replay(); server.startup(); serverSocketMC.verify(); socketMC.verify(); } class MockedDefaultAGIServer extends DefaultAGIServer { protected ServerSocketFacade createServerSocket() { return serverSocket; } } } |
|
From: Stefan R. <sr...@us...> - 2005-03-10 13:44:44
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16005/src/java/net/sf/asterisk/fastagi Added Files: DefaultAGIServer.java Log Message: Added DefaultAGIServer --- NEW FILE: DefaultAGIServer.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import net.sf.asterisk.io.ServerSocketFacade; import net.sf.asterisk.io.ServerSocketFacadeImpl; import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.util.ThreadPool; public class DefaultAGIServer implements AGIServer { private static final int DEFAULT_PORT = 4573; private static final int DEFAULT_POOL_SIZE = 10; /** * Instance logger. */ private final Log logger = LogFactory.getLog(DefaultAGIServer.class); private ServerSocketFacade serverSocket; /** * The port to listen on. */ protected int port = DEFAULT_PORT; /** * The thread pool that contains the worker threads to process incoming * requests. */ private ThreadPool pool; /** * The number of worker threads in the thread pool. This equals the maximum * number of concurrent requests this AGIServer can serve. */ private int poolSize = DEFAULT_POOL_SIZE; private boolean die; public DefaultAGIServer() { this.pool = new ThreadPool("AGIServer", poolSize); } protected ServerSocketFacade createServerSocket() throws IOException { return new ServerSocketFacadeImpl(port); } public void startup() throws IOException, IllegalStateException { run(); } public void run() { SocketConnectionFacade socket; AGIConnectionHandler connectionHandler; die = false; try { serverSocket = createServerSocket(); logger.info("Waiting for new connections."); while ((socket = serverSocket.accept()) != null) { logger.info("Received connection."); connectionHandler = new AGIConnectionHandler(socket); pool.addJob(connectionHandler); } } catch (IOException e) { // swallow if shutdown if (die) { logger.error("IOException while waiting for connections.", e); } } finally { try { serverSocket.close(); } catch (IOException e) { // swallow } serverSocket = null; } } public void die() throws IOException { die = true; if (serverSocket != null) { serverSocket.close(); } logger.info("AGIServer shut down."); } public void shutdown() throws IOException, IllegalStateException { pool.shutdown(); die(); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-10 07:35:18
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721/src/test/net/sf/asterisk/fastagi Added Files: AGIResponseImplTest.java Log Message: Added AGIResponseImpl --- NEW FILE: AGIResponseImplTest.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import net.sf.asterisk.fastagi.command.NoopCommand; import net.sf.asterisk.fastagi.reply.AGIReply; import org.easymock.MockControl; import junit.framework.TestCase; public class AGIResponseImplTest extends TestCase { private MockControl agiWriterMC; private AGIWriter agiWriter; private MockControl agiReaderMC; private AGIReader agiReader; private AGIResponse agiResponse; protected void setUp() throws Exception { super.setUp(); this.agiWriterMC = MockControl.createControl(AGIWriter.class); this.agiWriter = (AGIWriter) agiWriterMC.getMock(); this.agiReaderMC = MockControl.createControl(AGIReader.class); this.agiReader = (AGIReader) agiReaderMC.getMock(); this.agiResponse = new AGIResponseImpl(agiWriter, agiReader); } public void testSendCommand() throws Exception { AGIReply reply; NoopCommand command; reply = new AGIReply(); reply.setStatus(AGIReply.SC_SUCCESS); reply.setResult(0); command = new NoopCommand(); agiWriter.sendCommand(command); agiReader.readReply(); agiReaderMC.setReturnValue(reply); agiWriterMC.replay(); agiReaderMC.replay(); assertEquals(reply, agiResponse.sendCommand(command)); agiWriterMC.verify(); agiReaderMC.verify(); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-10 07:35:17
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1721/src/java/net/sf/asterisk/fastagi Added Files: AGIResponseImpl.java Log Message: Added AGIResponseImpl --- NEW FILE: AGIResponseImpl.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import net.sf.asterisk.fastagi.command.AGICommand; import net.sf.asterisk.fastagi.reply.AGIReply; import net.sf.asterisk.io.SocketConnectionFacade; /** * Default implementation of the AGIResponse interface. * * @author srt * @version $Id: AGIResponseImpl.java,v 1.1 2005/03/10 07:35:07 srt Exp $ */ public class AGIResponseImpl implements AGIResponse { private AGIWriter agiWriter; private AGIReader agiReader; private SocketConnectionFacade socket; public AGIResponseImpl(SocketConnectionFacade socket) { this.socket = socket; this.agiWriter = new AGIWriterImpl(socket); this.agiReader = new AGIReaderImpl(socket); } public AGIResponseImpl(AGIWriter agiWriter, AGIReader agiReader) { this.agiWriter = agiWriter; this.agiReader = agiReader; } public synchronized AGIReply sendCommand(AGICommand command) throws IOException { AGIReply reply; agiWriter.sendCommand(command); reply = agiReader.readReply(); return reply; } } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:52:59
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22613/src/test/net/sf/asterisk/fastagi Added Files: AGIWriterImplTest.java Log Message: Added AGIWriter --- NEW FILE: AGIWriterImplTest.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import net.sf.asterisk.fastagi.command.StreamFileCommand; import net.sf.asterisk.io.SocketConnectionFacade; import org.easymock.MockControl; import junit.framework.TestCase; public class AGIWriterImplTest extends TestCase { private AGIWriter agiWriter; private MockControl socketMC; private SocketConnectionFacade socket; protected void setUp() throws Exception { super.setUp(); this.socketMC = MockControl.createControl(SocketConnectionFacade.class); this.socket = (SocketConnectionFacade) socketMC.getMock(); this.agiWriter = new AGIWriterImpl(socket); } public void testSendCommand() throws Exception { StreamFileCommand command; command = new StreamFileCommand("welcome"); socket.write("STREAM FILE \"welcome\" \"\"\n"); socket.flush(); socketMC.replay(); agiWriter.sendCommand(command); socketMC.verify(); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:52:57
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22613/src/java/net/sf/asterisk/fastagi Added Files: AGIWriter.java AGIWriterImpl.java Log Message: Added AGIWriter --- NEW FILE: AGIWriter.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import net.sf.asterisk.fastagi.command.AGICommand; /** * The AGIWriter sends commands to Asterisk. * * @author srt * @version $Id: AGIWriter.java,v 1.1 2005/03/09 23:52:48 srt Exp $ */ public interface AGIWriter { /** * Sends the given command to the Asterisk server. * * @param command the command to send. * @throws IOException if the command can't be sent. */ void sendCommand(AGICommand command) throws IOException; } --- NEW FILE: AGIWriterImpl.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import net.sf.asterisk.fastagi.command.AGICommand; import net.sf.asterisk.io.SocketConnectionFacade; /** * Default implementation of the AGIWriter interface. * * @author srt * @version $Id: AGIWriterImpl.java,v 1.1 2005/03/09 23:52:48 srt Exp $ */ public class AGIWriterImpl implements AGIWriter { private SocketConnectionFacade socket; public AGIWriterImpl(SocketConnectionFacade socket) { this.socket = socket; } public void sendCommand(AGICommand command) throws IOException { socket.write(command.buildCommand() + "\n"); socket.flush(); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:45:34
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20740/src/java/net/sf/asterisk/fastagi/reply Modified Files: AGIReply.java Log Message: Fixed formatting Index: AGIReply.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/AGIReply.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- AGIReply.java 9 Mar 2005 23:42:09 -0000 1.7 +++ AGIReply.java 9 Mar 2005 23:45:23 -0000 1.8 @@ -103,13 +103,14 @@ public class AGIReply implements Seriali /** * Returns the return code as character. + * * @return the return code as character. */ public char getResultAsChar() { return (char) result; } - + /** * Returns the status code.<br> * Supported status codes are: |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:45:15
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20682/src/java/net/sf/asterisk/fastagi Modified Files: AGIReader.java Log Message: Fixed javadoc for IOException thrown by readReply() Index: AGIReader.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIReader.java 9 Mar 2005 23:33:03 -0000 1.1 +++ AGIReader.java 9 Mar 2005 23:45:06 -0000 1.2 @@ -33,7 +33,7 @@ public interface AGIReader * Reads one reply from the network. * * @return the reply read. - * @throws IOException if the reply can be read. + * @throws IOException if the reply can't be read. */ AGIReply readReply() throws IOException; } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:42:23
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20105/src/java/net/sf/asterisk/fastagi/reply Modified Files: AGIReply.java Log Message: Added getResultAsChar() to AGIReply Index: AGIReply.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/AGIReply.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- AGIReply.java 9 Mar 2005 23:29:46 -0000 1.6 +++ AGIReply.java 9 Mar 2005 23:42:09 -0000 1.7 @@ -102,6 +102,15 @@ public class AGIReply implements Seriali } /** + * Returns the return code as character. + * @return the return code as character. + */ + public char getResultAsChar() + { + return (char) result; + } + + /** * Returns the status code.<br> * Supported status codes are: * <ul> |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:42:23
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20105/src/test/net/sf/asterisk/fastagi Modified Files: ReplyBuilderImplTest.java Log Message: Added getResultAsChar() to AGIReply Index: ReplyBuilderImplTest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/ReplyBuilderImplTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ReplyBuilderImplTest.java 9 Mar 2005 20:31:36 -0000 1.1 +++ ReplyBuilderImplTest.java 9 Mar 2005 23:42:09 -0000 1.2 @@ -44,6 +44,7 @@ public class ReplyBuilderImplTest extend assertEquals("Incorrect status", AGIReply.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 49, reply.getResult()); + assertEquals("Incorrect result as character", '1', reply.getResultAsChar()); } public void testBuildReplyInvalidOrUnknownCommand() |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:33:15
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17393/src/java/net/sf/asterisk/fastagi Added Files: AGIReader.java AGIReaderImpl.java Log Message: Added AGIReader --- NEW FILE: AGIReader.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import net.sf.asterisk.fastagi.reply.AGIReply; /** * The AGIReader reads the replies from the network and parses them using a * ReplyBuilder. * * @author srt * @version $Id: AGIReader.java,v 1.1 2005/03/09 23:33:03 srt Exp $ */ public interface AGIReader { /** * Reads one reply from the network. * * @return the reply read. * @throws IOException if the reply can be read. */ AGIReply readReply() throws IOException; } --- NEW FILE: AGIReaderImpl.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.sf.asterisk.fastagi.reply.AGIReply; import net.sf.asterisk.io.SocketConnectionFacade; /** * Default implementation of the AGIReader implementation. * * @author srt * @version $Id: AGIReaderImpl.java,v 1.1 2005/03/09 23:33:03 srt Exp $ */ public class AGIReaderImpl implements AGIReader { private SocketConnectionFacade socket; private ReplyBuilder replyBuilder; public AGIReaderImpl(SocketConnectionFacade socket) { this.socket = socket; this.replyBuilder = new ReplyBuilderImpl(); } public AGIReply readReply() throws IOException { AGIReply reply; List lines; String line; lines = new ArrayList(); line = socket.readLine(); lines.add(line); // read synopsis and usage if statuscode is 520 if (line.startsWith(Integer .toString(AGIReply.SC_INVALID_COMMAND_SYNTAX))) { while ((line = socket.readLine()) != null) { lines.add(line); if (line.startsWith(Integer .toString(AGIReply.SC_INVALID_COMMAND_SYNTAX))) { break; } } } reply = replyBuilder.buildReply(lines); return reply; } } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:33:14
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17393/src/test/net/sf/asterisk/fastagi Added Files: AGIReaderImplTest.java Log Message: Added AGIReader --- NEW FILE: AGIReaderImplTest.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import net.sf.asterisk.fastagi.reply.AGIReply; import net.sf.asterisk.io.SocketConnectionFacade; import org.easymock.MockControl; import junit.framework.TestCase; public class AGIReaderImplTest extends TestCase { private AGIReader agiReader; private MockControl socketMC; private SocketConnectionFacade socket; protected void setUp() throws Exception { super.setUp(); this.socketMC = MockControl.createControl(SocketConnectionFacade.class); this.socket = (SocketConnectionFacade) socketMC.getMock(); this.agiReader = new AGIReaderImpl(socket); } public void testReadReply() throws Exception { AGIReply reply; socket.readLine(); socketMC.setReturnValue("200 result=49 endpos=2240"); socketMC.replay(); reply = agiReader.readReply(); assertEquals("Incorrect status", AGIReply.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 49, reply.getResult()); socketMC.verify(); } public void testReadReplyInvalidOrUnknownCommand() throws Exception { AGIReply reply; socket.readLine(); socketMC.setReturnValue("510 Invalid or unknown command"); socketMC.replay(); reply = agiReader.readReply(); assertEquals("Incorrect status", AGIReply.SC_INVALID_OR_UNKNOWN_COMMAND, reply.getStatus()); socketMC.verify(); } public void testReadReplyInvalidCommandSyntax() throws Exception { AGIReply reply; socket.readLine(); socketMC .setReturnValue("520-Invalid command syntax. Proper usage follows:"); socket.readLine(); socketMC.setReturnValue(" Usage: DATABASE DEL <family> <key>"); socket.readLine(); socketMC .setReturnValue(" Deletes an entry in the Asterisk database for a"); socket.readLine(); socketMC.setReturnValue(" given family and key."); socket.readLine(); socketMC.setReturnValue(" Returns 1 if succesful, 0 otherwise"); socket.readLine(); socketMC.setReturnValue("520 End of proper usage."); socketMC.replay(); reply = agiReader.readReply(); assertEquals("Incorrect status", AGIReply.SC_INVALID_COMMAND_SYNTAX, reply.getStatus()); assertEquals("Incorrect synopsis", "DATABASE DEL <family> <key>", reply .getSynopsis()); socketMC.verify(); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 23:29:56
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16393/src/java/net/sf/asterisk/fastagi/reply Modified Files: AGIReply.java Log Message: Fixed comment for SC_INVALID_COMMAND_SYNTAX Index: AGIReply.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/AGIReply.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- AGIReply.java 9 Mar 2005 20:30:08 -0000 1.5 +++ AGIReply.java 9 Mar 2005 23:29:46 -0000 1.6 @@ -45,7 +45,7 @@ public class AGIReply implements Seriali public static int SC_INVALID_OR_UNKNOWN_COMMAND = 510; /** - * Status code (510) indicating Asterisk was unable to process the + * Status code (520) indicating Asterisk was unable to process the * AGICommand because the syntax used was not correct. This is most likely * due to missing required parameters or additional parameters sent that are * not understood.<br> |
|
From: Stefan R. <sr...@us...> - 2005-03-09 20:31:47
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31610/src/test/net/sf/asterisk/fastagi Added Files: ReplyBuilderImplTest.java Log Message: Added ReplyBuilder --- NEW FILE: ReplyBuilderImplTest.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.util.ArrayList; import java.util.List; import net.sf.asterisk.fastagi.reply.AGIReply; import junit.framework.TestCase; public class ReplyBuilderImplTest extends TestCase { private ReplyBuilderImpl replyBuilder; private List lines; protected void setUp() { this.replyBuilder = new ReplyBuilderImpl(); this.lines = new ArrayList(); } public void testBuildReply() { AGIReply reply; lines.add("200 result=49 endpos=2240"); reply = replyBuilder.buildReply(lines); assertEquals("Incorrect status", AGIReply.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 49, reply.getResult()); } public void testBuildReplyInvalidOrUnknownCommand() { AGIReply reply; lines.add("510 Invalid or unknown command"); reply = replyBuilder.buildReply(lines); assertEquals("Incorrect status", AGIReply.SC_INVALID_OR_UNKNOWN_COMMAND, reply.getStatus()); } public void testBuildReplyInvalidCommandSyntax() { AGIReply reply; lines.add("520-Invalid command syntax. Proper usage follows:"); lines.add(" Usage: DATABASE DEL <family> <key>"); lines.add(" Deletes an entry in the Asterisk database for a"); lines.add(" given family and key."); lines.add(" Returns 1 if succesful, 0 otherwise"); lines.add("520 End of proper usage."); reply = replyBuilder.buildReply(lines); assertEquals("Incorrect status", AGIReply.SC_INVALID_COMMAND_SYNTAX, reply.getStatus()); assertEquals("Incorrect synopsis", "DATABASE DEL <family> <key>", reply .getSynopsis()); assertEquals( "Incorrect usage", "Deletes an entry in the Asterisk database for a given family and key. Returns 1 if succesful, 0 otherwise", reply.getUsage()); } public void testBuildReplyNoLines() { AGIReply reply; reply = replyBuilder.buildReply(lines); assertNull(reply); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 20:31:47
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31610/src/java/net/sf/asterisk/fastagi Added Files: ReplyBuilderImpl.java ReplyBuilder.java Log Message: Added ReplyBuilder --- NEW FILE: ReplyBuilderImpl.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sf.asterisk.fastagi.reply.AGIReply; /** * Default implementation of the ReplyBuilder interface. * * @author srt * @version $Id: ReplyBuilderImpl.java,v 1.1 2005/03/09 20:31:35 srt Exp $ */ public class ReplyBuilderImpl implements ReplyBuilder { private static final Pattern STATUS_PATTERN = Pattern .compile("^(\\d{3})[ -]"); private static final Pattern RESULT_PATTERN = Pattern .compile("^200 result=(\\d+) "); private static final Pattern SYNOPSIS_PATTERN = Pattern .compile("^\\s*Usage:\\s*(.*)\\s*$"); private static final String END_OF_PROPER_USAGE = "520 End of proper usage."; public AGIReply buildReply(List lines) { String firstLine; AGIReply reply; Matcher statusMatcher; Matcher resultMatcher; if (lines.size() == 0) { return null; } reply = new AGIReply(); firstLine = (String) lines.get(0); statusMatcher = STATUS_PATTERN.matcher(firstLine); if (statusMatcher.find()) { reply.setStatus(Integer.parseInt(statusMatcher.group(1))); } resultMatcher = RESULT_PATTERN.matcher(firstLine); if (resultMatcher.find()) { reply.setResult(Integer.parseInt(resultMatcher.group(1))); } if (reply.getStatus() == AGIReply.SC_INVALID_COMMAND_SYNTAX) { StringBuffer usageSB; if (lines.size() > 1) { String secondLine; Matcher synopsisMatcher; secondLine = (String) lines.get(1); synopsisMatcher = SYNOPSIS_PATTERN.matcher(secondLine); if (synopsisMatcher.find()) { reply.setSynopsis(synopsisMatcher.group(1)); } } usageSB = new StringBuffer(); for (int i = 2; i < lines.size(); i++) { String line; line = (String) lines.get(i); if (END_OF_PROPER_USAGE.equals(line)) { break; } usageSB.append(line.trim()); usageSB.append(" "); } reply.setUsage(usageSB.toString().trim()); } return reply; } } --- NEW FILE: ReplyBuilder.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.fastagi; import java.util.List; import net.sf.asterisk.fastagi.reply.AGIReply; /** * Transforms a List of lines to instances of AGIReply. * * @author srt * @version $Id: ReplyBuilder.java,v 1.1 2005/03/09 20:31:35 srt Exp $ */ public interface ReplyBuilder { /** * Transforms a List of lines read from Asterisk to an appropriate AGIReply. * * @param lines the lines read from Asterisk * @return the appropriate AGIReply */ AGIReply buildReply(List lines); } |
|
From: Stefan R. <sr...@us...> - 2005-03-09 20:30:21
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31178/src/java/net/sf/asterisk/fastagi/reply Modified Files: AGIReply.java Log Message: Added synopsis property Index: AGIReply.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/AGIReply.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- AGIReply.java 8 Mar 2005 16:48:35 -0000 1.4 +++ AGIReply.java 9 Mar 2005 20:30:08 -0000 1.5 @@ -73,6 +73,12 @@ public class AGIReply implements Seriali * In case of status == 520 (invalid command syntax) this attribute contains * the synopsis of the command. */ + private String synopsis; + + /** + * In case of status == 520 (invalid command syntax) this attribute contains + * the usage of the command. + */ private String usage; /** @@ -126,7 +132,29 @@ public class AGIReply implements Seriali * syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX). * * @return the synopsis of the command sent, <code>null</code> if there - * were no syntax errors. + * were no syntax errors. + */ + public String getSynopsis() + { + return synopsis; + } + + /** + * Sets the synopsis of the command sent. + * + * @param synopsis the synopsis of the command sent. + */ + public void setSynopsis(String synopsis) + { + this.synopsis = synopsis; + } + + /** + * Returns the usage of the command sent if Asterisk expected a different + * syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX). + * + * @return the usage of the command sent, <code>null</code> if there were + * no syntax errors. */ public String getUsage() { @@ -136,7 +164,7 @@ public class AGIReply implements Seriali /** * Sets the synopsis of the command sent. * - * @param usage the synopsis of the command sent. + * @param usage the usage of the command sent. */ public void setUsage(String usage) { |
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21514/src/test/net/sf/asterisk/manager Modified Files: ManagerReaderImplTest.java ManagerWriterMock.java ManagerWriterImplTest.java ManagerReaderMock.java DefaultManagerConnectionTest.java Log Message: Moved io facades to net.sf.asterisk.io as they can also be used for fastagi Index: ManagerReaderImplTest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/ManagerReaderImplTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ManagerReaderImplTest.java 5 Mar 2005 01:39:51 -0000 1.3 +++ ManagerReaderImplTest.java 9 Mar 2005 15:50:28 -0000 1.4 @@ -22,10 +22,10 @@ import java.util.Date; import java.util.List; import junit.framework.TestCase; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.event.ConnectEvent; import net.sf.asterisk.manager.event.DisconnectEvent; import net.sf.asterisk.manager.event.StatusCompleteEvent; -import net.sf.asterisk.manager.io.SocketConnectionFacade; import net.sf.asterisk.manager.response.CommandResponse; import net.sf.asterisk.manager.response.ManagerResponse; import net.sf.asterisk.manager.util.DateUtil; Index: ManagerWriterMock.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/ManagerWriterMock.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ManagerWriterMock.java 5 Mar 2005 00:33:16 -0000 1.3 +++ ManagerWriterMock.java 9 Mar 2005 15:50:28 -0000 1.4 @@ -18,12 +18,12 @@ package net.sf.asterisk.manager; import java.io.IOException; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.action.ChallengeAction; import net.sf.asterisk.manager.action.LoginAction; import net.sf.asterisk.manager.action.LogoffAction; import net.sf.asterisk.manager.action.ManagerAction; import net.sf.asterisk.manager.event.ConnectEvent; -import net.sf.asterisk.manager.io.SocketConnectionFacade; import net.sf.asterisk.manager.response.ChallengeResponse; import net.sf.asterisk.manager.response.ManagerError; import net.sf.asterisk.manager.response.ManagerResponse; Index: ManagerWriterImplTest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/ManagerWriterImplTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ManagerWriterImplTest.java 5 Mar 2005 04:18:53 -0000 1.2 +++ ManagerWriterImplTest.java 9 Mar 2005 15:50:28 -0000 1.3 @@ -18,8 +18,8 @@ package net.sf.asterisk.manager; import org.easymock.MockControl; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.action.StatusAction; -import net.sf.asterisk.manager.io.SocketConnectionFacade; import junit.framework.TestCase; public class ManagerWriterImplTest extends TestCase Index: ManagerReaderMock.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/ManagerReaderMock.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ManagerReaderMock.java 5 Mar 2005 01:39:51 -0000 1.2 +++ ManagerReaderMock.java 9 Mar 2005 15:50:28 -0000 1.3 @@ -16,7 +16,7 @@ */ package net.sf.asterisk.manager; -import net.sf.asterisk.manager.io.SocketConnectionFacade; +import net.sf.asterisk.io.SocketConnectionFacade; public class ManagerReaderMock implements ManagerReader { Index: DefaultManagerConnectionTest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/DefaultManagerConnectionTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- DefaultManagerConnectionTest.java 5 Mar 2005 02:58:24 -0000 1.6 +++ DefaultManagerConnectionTest.java 9 Mar 2005 15:50:28 -0000 1.7 @@ -19,10 +19,10 @@ package net.sf.asterisk.manager; import java.io.IOException; import junit.framework.TestCase; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.action.StatusAction; import net.sf.asterisk.manager.event.ConnectEvent; import net.sf.asterisk.manager.event.DisconnectEvent; -import net.sf.asterisk.manager.io.SocketConnectionFacade; import net.sf.asterisk.manager.response.ManagerResponse; import org.easymock.MockControl; |
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23526/src/java/net/sf/asterisk/manager Modified Files: ManagerReader.java ManagerWriterImpl.java ManagerWriter.java DefaultManagerConnection.java ManagerReaderImpl.java Log Message: Aoved io facades to net.sf.asterisk.io as they can also be used for fastagi Index: ManagerReader.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerReader.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- ManagerReader.java 5 Mar 2005 13:34:23 -0000 1.8 +++ ManagerReader.java 9 Mar 2005 09:59:03 -0000 1.9 @@ -16,8 +16,8 @@ */ package net.sf.asterisk.manager; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.event.ManagerEvent; -import net.sf.asterisk.manager.io.SocketConnectionFacade; /** * The ManagerReader reads events and responses from the asterisk server, parses them using Index: ManagerWriterImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerWriterImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ManagerWriterImpl.java 5 Mar 2005 13:34:23 -0000 1.3 +++ ManagerWriterImpl.java 9 Mar 2005 09:59:03 -0000 1.4 @@ -18,8 +18,8 @@ package net.sf.asterisk.manager; import java.io.IOException; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.action.ManagerAction; -import net.sf.asterisk.manager.io.SocketConnectionFacade; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; Index: ManagerWriter.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerWriter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ManagerWriter.java 5 Mar 2005 13:34:23 -0000 1.2 +++ ManagerWriter.java 9 Mar 2005 09:59:03 -0000 1.3 @@ -18,8 +18,8 @@ package net.sf.asterisk.manager; import java.io.IOException; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.action.ManagerAction; -import net.sf.asterisk.manager.io.SocketConnectionFacade; /** * The ManagerWriter transforms actions using an ActionBuilder and sends them to the asterisk Index: DefaultManagerConnection.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/DefaultManagerConnection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -p -r1.9 -r1.10 --- DefaultManagerConnection.java 5 Mar 2005 04:15:34 -0000 1.9 +++ DefaultManagerConnection.java 9 Mar 2005 09:59:03 -0000 1.10 @@ -26,6 +26,8 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; +import net.sf.asterisk.io.SocketConnectionFacade; +import net.sf.asterisk.io.SocketConnectionFacadeImpl; import net.sf.asterisk.manager.action.ChallengeAction; import net.sf.asterisk.manager.action.LoginAction; import net.sf.asterisk.manager.action.LogoffAction; @@ -33,8 +35,6 @@ import net.sf.asterisk.manager.action.Ma import net.sf.asterisk.manager.event.ConnectEvent; import net.sf.asterisk.manager.event.DisconnectEvent; import net.sf.asterisk.manager.event.ManagerEvent; -import net.sf.asterisk.manager.io.SocketConnectionFacade; -import net.sf.asterisk.manager.io.SocketConnectionFacadeImpl; import net.sf.asterisk.manager.response.ChallengeResponse; import net.sf.asterisk.manager.response.ManagerError; import net.sf.asterisk.manager.response.ManagerResponse; Index: ManagerReaderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerReaderImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ManagerReaderImpl.java 5 Mar 2005 13:34:23 -0000 1.3 +++ ManagerReaderImpl.java 9 Mar 2005 09:59:03 -0000 1.4 @@ -22,10 +22,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.event.ConnectEvent; import net.sf.asterisk.manager.event.DisconnectEvent; import net.sf.asterisk.manager.event.ManagerEvent; -import net.sf.asterisk.manager.io.SocketConnectionFacade; import net.sf.asterisk.manager.response.CommandResponse; import net.sf.asterisk.manager.response.ManagerResponse; import net.sf.asterisk.manager.util.DateUtil; |
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22302/src/java/net/sf/asterisk/fastagi/command Modified Files: DatabaseDelCommand.java SetPriorityCommand.java AGICommand.java DatabaseDelTreeCommand.java SayTimeCommand.java SayNumberCommand.java SetMusicOnCommand.java GetVariableCommand.java DatabasePutCommand.java SetVariableCommand.java SetAutoHangupCommand.java GetDataCommand.java SayPhoneticCommand.java SendImageCommand.java ExecCommand.java SetExtensionCommand.java SendTextCommand.java HangupCommand.java SayDigitsCommand.java ChannelStatusCommand.java StreamFileCommand.java VerboseCommand.java TDDModeCommand.java WaitForDigitCommand.java ReceiveCharCommand.java DatabaseGetCommand.java RecordFileCommand.java Log Message: Index: DatabaseDelCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/DatabaseDelCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- DatabaseDelCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ DatabaseDelCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,7 +17,8 @@ package net.sf.asterisk.fastagi.command; /** - * Deletes a family or specific keytree within a family in the Asterisk database.<br> + * Deletes a family or specific keytree within a family in the Asterisk + * database.<br> * Returns 1 if successful, 0 otherwise. * * @author srt @@ -105,6 +106,7 @@ public class DatabaseDelCommand extends public String buildCommand() { - return "DATABASE DELTREE " + escapeAndQuote(family) + (keyTree == null ? "" : " " + escapeAndQuote(keyTree)); + return "DATABASE DELTREE " + escapeAndQuote(family) + + (keyTree == null ? "" : " " + escapeAndQuote(keyTree)); } } Index: SetPriorityCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SetPriorityCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SetPriorityCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SetPriorityCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -37,7 +37,8 @@ public class SetPriorityCommand extends /** * Creates a new SetPriorityCommand. * - * @param priority the priority for continuation upon exiting the application. + * @param priority the priority for continuation upon exiting the + * application. */ public SetPriorityCommand(int priority) { @@ -57,7 +58,8 @@ public class SetPriorityCommand extends /** * Sets the priority for continuation upon exiting the application. * - * @param priority the priority for continuation upon exiting the application. + * @param priority the priority for continuation upon exiting the + * application. */ public void setPriority(int priority) { Index: AGICommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/AGICommand.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- AGICommand.java 5 Mar 2005 23:22:05 -0000 1.2 +++ AGICommand.java 8 Mar 2005 16:48:34 -0000 1.3 @@ -60,7 +60,8 @@ public abstract class AGICommand impleme public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); + return ToStringBuilder.reflectionToString(this, + ToStringStyle.MULTI_LINE_STYLE); } public boolean equals(Object o) Index: DatabaseDelTreeCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/DatabaseDelTreeCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- DatabaseDelTreeCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ DatabaseDelTreeCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -94,6 +94,7 @@ public class DatabaseDelTreeCommand exte public String buildCommand() { - return "DATABASE DEL " + escapeAndQuote(family) + " " + escapeAndQuote(key); + return "DATABASE DEL " + escapeAndQuote(family) + " " + + escapeAndQuote(key); } } Index: SayTimeCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SayTimeCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SayTimeCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SayTimeCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,11 +17,12 @@ package net.sf.asterisk.fastagi.command; /** - * Say a given time, returning early if any of the given DTMF digits are received on the channel.<br> - * Time is the number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal - * Time (UTC).<br> - * Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of - * the digit if one was pressed or -1 on error/hangup. + * Say a given time, returning early if any of the given DTMF digits are + * received on the channel.<br> + * Time is the number of seconds elapsed since 00:00:00 on January 1, 1970, + * Coordinated Universal Time (UTC).<br> + * Returns 0 if playback completes without a digit being pressed, or the ASCII + * numerical value of the digit if one was pressed or -1 on error/hangup. * * @author srt * @version $Id$ @@ -58,7 +59,8 @@ public class SayTimeCommand extends AGIC * Creates a new SayTimeCommand. * * @param time the time to say in seconds since 00:00:00 on January 1, 1970. - * @param escapeDigits contains the digits that allow the user to interrupt this command. + * @param escapeDigits contains the digits that allow the user to interrupt + * this command. */ public SayTimeCommand(long time, String interruptDigits) { @@ -99,8 +101,8 @@ public class SayTimeCommand extends AGIC /** * Sets the digits that allow the user to interrupt this command. * - * @param escapeDigits the time that allow the user to interrupt this command or - * <code>null</code> for none. + * @param escapeDigits the time that allow the user to interrupt this + * command or <code>null</code> for none. */ public void setEscapeDigits(String escapeDigits) { Index: SayNumberCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SayNumberCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SayNumberCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SayNumberCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,9 +17,10 @@ package net.sf.asterisk.fastagi.command; /** - * Say a given number, returning early if any of the given DTMF number are received on the channel.<br> - * Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of - * the digit if one was pressed or -1 on error/hangup. + * Say a given number, returning early if any of the given DTMF number are + * received on the channel.<br> + * Returns 0 if playback completes without a digit being pressed, or the ASCII + * numerical value of the digit if one was pressed or -1 on error/hangup. * * @author srt * @version $Id$ @@ -56,7 +57,8 @@ public class SayNumberCommand extends AG * Creates a new SayNumberCommand. * * @param number the number to say. - * @param interruptDigits contains the number that allow the user to interrupt this command. + * @param interruptDigits contains the number that allow the user to + * interrupt this command. */ public SayNumberCommand(String number, String interruptDigits) { @@ -97,8 +99,8 @@ public class SayNumberCommand extends AG /** * Sets the number that allow the user to interrupt this command. * - * @param interruptDigits the number that allow the user to interrupt this command or - * <code>null</code> for none. + * @param interruptDigits the number that allow the user to interrupt this + * command or <code>null</code> for none. */ public void setInterruptDigits(String interruptDigits) { @@ -107,6 +109,7 @@ public class SayNumberCommand extends AG public String buildCommand() { - return "SAY NUMBER " + escapeAndQuote(number) + " " + escapeAndQuote(interruptDigits); + return "SAY NUMBER " + escapeAndQuote(number) + " " + + escapeAndQuote(interruptDigits); } } Index: SetMusicOnCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SetMusicOnCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SetMusicOnCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SetMusicOnCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -36,7 +36,8 @@ public class SetMusicOnCommand extends A private String musicOnHoldClass; /** - * Creates a new SetMusicOnCommand playing music from the default music on hold class. + * Creates a new SetMusicOnCommand playing music from the default music on + * hold class. */ public SetMusicOnCommand() { @@ -46,8 +47,8 @@ public class SetMusicOnCommand extends A /** * Returns the music on hold class to play music from. * - * @return the music on hold class to play music from or <code>null</code> for the default - * class. + * @return the music on hold class to play music from or <code>null</code> + * for the default class. */ public String getMusicOnHoldClass() { @@ -57,8 +58,8 @@ public class SetMusicOnCommand extends A /** * Sets the music on hold class to play music from. * - * @param musicOnHoldClass the music on hold class to play music from or <code>null</code> for - * the default class. + * @param musicOnHoldClass the music on hold class to play music from or + * <code>null</code> for the default class. */ public void setMusicOnHoldClass(String musicOnHoldClass) { @@ -67,6 +68,8 @@ public class SetMusicOnCommand extends A public String buildCommand() { - return "SET MUSIC ON" + (musicOnHoldClass == null ? "" : " " + escapeAndQuote(musicOnHoldClass)); + return "SET MUSIC ON" + + (musicOnHoldClass == null ? "" : " " + + escapeAndQuote(musicOnHoldClass)); } } Index: GetVariableCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/GetVariableCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- GetVariableCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ GetVariableCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -18,8 +18,8 @@ package net.sf.asterisk.fastagi.command; /** * Returns the value of the given channel varible.<br> - * Returns 0 if is not set. Returns 1 if the variable is set and returns the variable in - * parenthesis.<br> + * Returns 0 if is not set. Returns 1 if the variable is set and returns the + * variable in parenthesis.<br> * Example return code: 200 result=1 (testvariable) * * @author srt Index: DatabasePutCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/DatabasePutCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- DatabasePutCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ DatabasePutCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,7 +17,8 @@ package net.sf.asterisk.fastagi.command; /** - * Adds or updates an entry in the Asterisk database for a given family, key, and value.<br> + * Adds or updates an entry in the Asterisk database for a given family, key, + * and value.<br> * Returns 1 if successful, 0 otherwise. * * @author srt @@ -121,6 +122,7 @@ public class DatabasePutCommand extends public String buildCommand() { - return "DATABASE PUT " + escapeAndQuote(family) + " " + escapeAndQuote(key) + " " + escapeAndQuote(value); + return "DATABASE PUT " + escapeAndQuote(family) + " " + + escapeAndQuote(key) + " " + escapeAndQuote(value); } } Index: SetVariableCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SetVariableCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SetVariableCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SetVariableCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -93,6 +93,7 @@ public class SetVariableCommand extends public String buildCommand() { - return "SET VARIABLE " + escapeAndQuote(variable) + " " + escapeAndQuote(value); + return "SET VARIABLE " + escapeAndQuote(variable) + " " + + escapeAndQuote(value); } } Index: SetAutoHangupCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SetAutoHangupCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SetAutoHangupCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SetAutoHangupCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,9 +17,10 @@ package net.sf.asterisk.fastagi.command; /** - * Cause the channel to automatically hangup at the given number of seconds in the future.<br> - * Of course it can be hungup before then as well. Setting to 0 will cause the autohangup feature to - * be disabled on this channel. + * Cause the channel to automatically hangup at the given number of seconds in + * the future.<br> + * Of course it can be hungup before then as well. Setting to 0 will cause the + * autohangup feature to be disabled on this channel. * * @author srt * @version $Id$ @@ -39,8 +40,9 @@ public class SetAutoHangupCommand extend /** * Creates a new SetAutoHangupCommand. * - * @param time the number of seconds before this channel is automatically hung up.<br> - * 0 disables the autohangup feature. + * @param time the number of seconds before this channel is automatically + * hung up.<br> + * 0 disables the autohangup feature. */ public SetAutoHangupCommand(int time) { @@ -48,9 +50,11 @@ public class SetAutoHangupCommand extend } /** - * Returns the number of seconds before this channel is automatically hung up. + * Returns the number of seconds before this channel is automatically hung + * up. * - * @return the number of seconds before this channel is automatically hung up. + * @return the number of seconds before this channel is automatically hung + * up. */ public int getTime() { @@ -60,8 +64,9 @@ public class SetAutoHangupCommand extend /** * Sets the number of seconds before this channel is automatically hung up. * - * @param time the number of seconds before this channel is automatically hung up.<br> - * 0 disables the autohangup feature. + * @param time the number of seconds before this channel is automatically + * hung up.<br> + * 0 disables the autohangup feature. */ public void setTime(int timeout) { Index: GetDataCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/GetDataCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- GetDataCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ GetDataCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -19,7 +19,8 @@ package net.sf.asterisk.fastagi.command; /** * Stream the given file, and recieve DTMF data.<br> * Returns the digits recieved from the channel at the other end.<br> - * Input ends when the timeout is reached, the maximum number of digits is read or the user presses #. + * Input ends when the timeout is reached, the maximum number of digits is read + * or the user presses #. * * @author srt * @version $Id$ @@ -38,7 +39,8 @@ public class GetDataCommand extends AGIC /** * The timeout to wait for data.<br> - * 0 means standard timeout value, -1 means "ludicrous time" (essentially never times out). + * 0 means standard timeout value, -1 means "ludicrous time" (essentially + * never times out). */ private int timeout; @@ -49,7 +51,8 @@ public class GetDataCommand extends AGIC private int maxDigits; /** - * Creates a new GetDataCommand with default timeout and maxDigits set to 1024. + * Creates a new GetDataCommand with default timeout and maxDigits set to + * 1024. * * @param file the name of the file to stream, must not include extension. */ @@ -65,13 +68,15 @@ public class GetDataCommand extends AGIC * * @param file the name of the file to stream, must not include extension. * @param timeout the timeout to wait for data.<br> - * 0 means standard timeout value, -1 means "ludicrous time" (essentially never times out). + * 0 means standard timeout value, -1 means "ludicrous time" + * (essentially never times out). * @param maxDigits the maximum number of digits to read.<br> - * Must be in [1..1024]. + * Must be in [1..1024]. * * @throws IllegalArgumentException if maxDigits is not in [1..1024] */ - public GetDataCommand(String file, int timeout, int maxDigits) throws IllegalArgumentException + public GetDataCommand(String file, int timeout, int maxDigits) + throws IllegalArgumentException { if (maxDigits < 1 || maxDigits > 1024) { @@ -117,7 +122,8 @@ public class GetDataCommand extends AGIC * Sets the timeout to wait for data. * * @param timeout the timeout to wait for data.<br> - * 0 means standard timeout value, -1 means "ludicrous time" (essentially never times out). + * 0 means standard timeout value, -1 means "ludicrous time" + * (essentially never times out). */ public void setTimeout(int timeout) { @@ -138,7 +144,7 @@ public class GetDataCommand extends AGIC * Sets the maximum number of digits to read. * * @param maxDigits the maximum number of digits to read.<br> - * Must be in [1..1024]. + * Must be in [1..1024]. * * @throws IllegalArgumentException if maxDigits is not in [1..1024] */ @@ -154,6 +160,7 @@ public class GetDataCommand extends AGIC public String buildCommand() { - return "GET DATA " + escapeAndQuote(file) + " " + timeout + " " + maxDigits; + return "GET DATA " + escapeAndQuote(file) + " " + timeout + " " + + maxDigits; } } Index: SayPhoneticCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SayPhoneticCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SayPhoneticCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SayPhoneticCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,10 +17,10 @@ package net.sf.asterisk.fastagi.command; /** - * Say a given character string with phonetics, returning early if any of the given DTMF digits are - * received on the channel.<br> - * Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of - * the digit if one was pressed or -1 on error/hangup. + * Say a given character string with phonetics, returning early if any of the + * given DTMF digits are received on the channel.<br> + * Returns 0 if playback completes without a digit being pressed, or the ASCII + * numerical value of the digit if one was pressed or -1 on error/hangup. * * @author srt * @version $Id$ @@ -57,7 +57,8 @@ public class SayPhoneticCommand extends * Creates a new SayPhoneticCommand. * * @param text the text to say. - * @param escapeDigits contains the digits that allow the user to interrupt this command. + * @param escapeDigits contains the digits that allow the user to interrupt + * this command. */ public SayPhoneticCommand(String text, String interruptDigits) { @@ -98,8 +99,8 @@ public class SayPhoneticCommand extends /** * Sets the digits that allow the user to interrupt this command. * - * @param escapeDigits the text that allow the user to interrupt this command or - * <code>null</code> for none. + * @param escapeDigits the text that allow the user to interrupt this + * command or <code>null</code> for none. */ public void setEscapeDigits(String escapeDigits) { @@ -108,6 +109,7 @@ public class SayPhoneticCommand extends public String buildCommand() { - return "SAY PHONETIC " + escapeAndQuote(text) + " " + escapeAndQuote(escapeDigits); + return "SAY PHONETIC " + escapeAndQuote(text) + " " + + escapeAndQuote(escapeDigits); } } Index: SendImageCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SendImageCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SendImageCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SendImageCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -19,8 +19,8 @@ package net.sf.asterisk.fastagi.command; /** * Sends the given image on a channel.<br> * Most channels do not support the transmission of images.<br> - * Returns 0 if image is sent, or if the channel does not support image transmission. Returns -1 - * only on error/hangup.<br> + * Returns 0 if image is sent, or if the channel does not support image + * transmission. Returns -1 only on error/hangup.<br> * Image names should not include extensions. * * @author srt Index: ExecCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/ExecCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ExecCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ ExecCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -18,7 +18,8 @@ package net.sf.asterisk.fastagi.command; /** * Executes an application with the given options.<br> - * Returns whatever the application returns, or -2 on failure to find application. + * Returns whatever the application returns, or -2 on failure to find + * application. * * @author srt * @version $Id$ @@ -105,6 +106,7 @@ public class ExecCommand extends AGIComm public String buildCommand() { - return "EXEC " + escapeAndQuote(application) + " " + escapeAndQuote(options); + return "EXEC " + escapeAndQuote(application) + " " + + escapeAndQuote(options); } } Index: SetExtensionCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SetExtensionCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SetExtensionCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SetExtensionCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -37,7 +37,8 @@ public class SetExtensionCommand extends /** * Creates a new SetPriorityCommand. * - * @param extension the extension for continuation upon exiting the application. + * @param extension the extension for continuation upon exiting the + * application. */ public SetExtensionCommand(String extension) { @@ -57,7 +58,8 @@ public class SetExtensionCommand extends /** * Sets the extension for continuation upon exiting the application. * - * @param extension the extension for continuation upon exiting the application. + * @param extension the extension for continuation upon exiting the + * application. */ public void setExtension(String extension) { Index: SendTextCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SendTextCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SendTextCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SendTextCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -19,8 +19,8 @@ package net.sf.asterisk.fastagi.command; /** * Sends the given text on a channel.<br> * Most channels do not support the transmission of text.<br> - * Returns 0 if text is sent, or if the channel does not support text transmission. Returns -1 only - * on error/hangup. + * Returns 0 if text is sent, or if the channel does not support text + * transmission. Returns -1 only on error/hangup. * * @author srt * @version $Id$ Index: HangupCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/HangupCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- HangupCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ HangupCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,7 +17,8 @@ package net.sf.asterisk.fastagi.command; /** - * Hangs up the specified channel. If no channel name is given, hangs up the current channel. + * Hangs up the specified channel. If no channel name is given, hangs up the + * current channel. * * @author srt * @version $Id$ @@ -30,7 +31,8 @@ public class HangupCommand extends AGICo private static final long serialVersionUID = 3904959746380281145L; /** - * The name of the channel to hangup or <code>null</code> for the current channel. + * The name of the channel to hangup or <code>null</code> for the current + * channel. */ private String channel; @@ -55,7 +57,8 @@ public class HangupCommand extends AGICo /** * Returns the name of the channel to hangup. * - * @return the name of the channel to hangup or <code>null</code> for the current channel. + * @return the name of the channel to hangup or <code>null</code> for the + * current channel. */ public String getChannel() { @@ -65,8 +68,8 @@ public class HangupCommand extends AGICo /** * Sets the name of the channel to hangup. * - * @param channel the name of the channel to hangup or <code>null</code> for the current - * channel. + * @param channel the name of the channel to hangup or <code>null</code> + * for the current channel. */ public void setChannel(String channel) { @@ -75,6 +78,7 @@ public class HangupCommand extends AGICo public String buildCommand() { - return "HANGUP" + (channel == null ? "" : " " + escapeAndQuote(channel)); + return "HANGUP" + + (channel == null ? "" : " " + escapeAndQuote(channel)); } } Index: SayDigitsCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/SayDigitsCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- SayDigitsCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ SayDigitsCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,10 +17,10 @@ package net.sf.asterisk.fastagi.command; /** - * Say a given digit string, returning early if any of the given DTMF number are received on the - * channel.<br> - * Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of - * the digit if one was pressed or -1 on error/hangup. + * Say a given digit string, returning early if any of the given DTMF number are + * received on the channel.<br> + * Returns 0 if playback completes without a digit being pressed, or the ASCII + * numerical value of the digit if one was pressed or -1 on error/hangup. * * @author srt * @version $Id$ @@ -38,7 +38,8 @@ public class SayDigitsCommand extends AG private String number; /** - * When one of these digits is pressed while saying the number the command returns. + * When one of these digits is pressed while saying the number the command + * returns. */ private String escapeDigits; @@ -57,7 +58,8 @@ public class SayDigitsCommand extends AG * Creates a new SayDigitsCommand. * * @param number the number to say. - * @param escapeDigits the digits that allow the user to interrupt this command. + * @param escapeDigits the digits that allow the user to interrupt this + * command. */ public SayDigitsCommand(String number, String escapeDigits) { @@ -98,8 +100,8 @@ public class SayDigitsCommand extends AG /** * Sets the digits that allow the user to interrupt this command. * - * @param escapeDigits the digits that allow the user to interrupt this command or - * <code>null</code> for none. + * @param escapeDigits the digits that allow the user to interrupt this + * command or <code>null</code> for none. */ public void setEscapeDigits(String escapeDigits) { @@ -108,6 +110,7 @@ public class SayDigitsCommand extends AG public String buildCommand() { - return "STREAM DIGITS " + escapeAndQuote(number) + " " + escapeAndQuote(escapeDigits); + return "STREAM DIGITS " + escapeAndQuote(number) + " " + + escapeAndQuote(escapeDigits); } } Index: ChannelStatusCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/ChannelStatusCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ChannelStatusCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ ChannelStatusCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,8 +17,8 @@ package net.sf.asterisk.fastagi.command; /** - * Returns the status of the specified channel. If no channel name is given the returns the status - * of the current channel.<br> + * Returns the status of the specified channel. If no channel name is given the + * returns the status of the current channel.<br> * Return values: * <ul> * <li>0 Channel is down and available @@ -42,7 +42,8 @@ public class ChannelStatusCommand extend private static final long serialVersionUID = 3904959746380281145L; /** - * The name of the channel to query or <code>null</code> for the current channel. + * The name of the channel to query or <code>null</code> for the current + * channel. */ private String channel; @@ -67,7 +68,8 @@ public class ChannelStatusCommand extend /** * Returns the name of the channel to query. * - * @return the name of the channel to query or <code>null</code> for the current channel. + * @return the name of the channel to query or <code>null</code> for the + * current channel. */ public String getChannel() { @@ -77,8 +79,8 @@ public class ChannelStatusCommand extend /** * Sets the name of the channel to query. * - * @param channel the name of the channel to query or <code>null</code> for the current - * channel. + * @param channel the name of the channel to query or <code>null</code> + * for the current channel. */ public void setChannel(String channel) { @@ -87,6 +89,7 @@ public class ChannelStatusCommand extend public String buildCommand() { - return "CHANNEL STATUS" + (channel == null ? "" : " " + escapeAndQuote(channel)); + return "CHANNEL STATUS" + + (channel == null ? "" : " " + escapeAndQuote(channel)); } } Index: StreamFileCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/StreamFileCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- StreamFileCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ StreamFileCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,10 +17,13 @@ package net.sf.asterisk.fastagi.command; /** - * Plays the given file, allowing playback to be interrupted by the given digits, if any.<br> - * If offset is provided then the audio will seek to sample offset before play starts.<br> - * Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of - * the digit if one was pressed, or -1 on error or if the channel was disconnected. <br> + * Plays the given file, allowing playback to be interrupted by the given + * digits, if any.<br> + * If offset is provided then the audio will seek to sample offset before play + * starts.<br> + * Returns 0 if playback completes without a digit being pressed, or the ASCII + * numerical value of the digit if one was pressed, or -1 on error or if the + * channel was disconnected. <br> * Remember, the file extension must not be included in the filename. * * @author srt @@ -64,7 +67,8 @@ public class StreamFileCommand extends A * Creates a new StreamFileCommand, streaming from the beginning. * * @param file the name of the file to stream, must not include extension. - * @param escapeDigits contains the digits that allow the user to interrupt this command. + * @param escapeDigits contains the digits that allow the user to interrupt + * this command. */ public StreamFileCommand(String file, String escapeDigits) { @@ -77,8 +81,9 @@ public class StreamFileCommand extends A * Creates a new StreamFileCommand, streaming from the given offset. * * @param file the name of the file to stream, must not include extension. - * @param escapeDigits contains the digits that allow the user to interrupt this command. Maybe - * <code>null</code> if you don't want the user to interrupt. + * @param escapeDigits contains the digits that allow the user to interrupt + * this command. Maybe <code>null</code> if you don't want the + * user to interrupt. * @param offset the offset samples to skip before streaming. */ public StreamFileCommand(String file, String escapeDigits, int offset) @@ -121,8 +126,8 @@ public class StreamFileCommand extends A /** * Sets the digits that allow the user to interrupt this command. * - * @param escapeDigits the digits that allow the user to interrupt this command or - * <code>null</code> for none. + * @param escapeDigits the digits that allow the user to interrupt this + * command or <code>null</code> for none. */ public void setEscapeDigits(String escapeDigits) { @@ -151,7 +156,8 @@ public class StreamFileCommand extends A public String buildCommand() { - return "STREAM FILE " + escapeAndQuote(file) + " " + escapeAndQuote(escapeDigits) + return "STREAM FILE " + escapeAndQuote(file) + " " + + escapeAndQuote(escapeDigits) + (offset < 0 ? "" : " " + offset); } } Index: VerboseCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/VerboseCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- VerboseCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ VerboseCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -46,11 +46,12 @@ public class VerboseCommand extends AGIC * * @param message the message to send. * @param level the verbosity level to use.<br> - * Must be in [1..4] + * Must be in [1..4] * * @throws IllegalArgumentException if level is not in [1..4] */ - public VerboseCommand(String message, int level) throws IllegalArgumentException + public VerboseCommand(String message, int level) + throws IllegalArgumentException { if (level < 1 || level > 4) { Index: TDDModeCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/TDDModeCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- TDDModeCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ TDDModeCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -38,7 +38,8 @@ public class TDDModeCommand extends AGIC /** * Creates a new TDDModeCommand. * - * @param mode the mode to set, this can be one of "on", "off", "mate" or "tdd". + * @param mode the mode to set, this can be one of "on", "off", "mate" or + * "tdd". */ public TDDModeCommand(String mode) { @@ -58,7 +59,8 @@ public class TDDModeCommand extends AGIC /** * Sets the mode to set. * - * @param mode the mode to set, this can be one of "on", "off", "mate" or "tdd". + * @param mode the mode to set, this can be one of "on", "off", "mate" or + * "tdd". */ public void setTimeout(String mode) { Index: WaitForDigitCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/WaitForDigitCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- WaitForDigitCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ WaitForDigitCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -18,9 +18,9 @@ package net.sf.asterisk.fastagi.command; /** * Waits up to 'timeout' milliseconds for channel to receive a DTMF digit.<br> - * Returns -1 on channel failure, 0 if no digit is received in the timeout, or the numerical value - * of the ascii of the digit if one is received. Use -1 for the timeout value if you desire the call - * to block indefinitely. + * Returns -1 on channel failure, 0 if no digit is received in the timeout, or + * the numerical value of the ascii of the digit if one is received. Use -1 for + * the timeout value if you desire the call to block indefinitely. * * @author srt * @version $Id$ @@ -38,8 +38,8 @@ public class WaitForDigitCommand extends private int timeout; /** - * Creates a new WaitForDigitCommand with a default timeout of -1 which blocks the channel - * indefinitely. + * Creates a new WaitForDigitCommand with a default timeout of -1 which + * blocks the channel indefinitely. */ public WaitForDigitCommand() { @@ -49,7 +49,8 @@ public class WaitForDigitCommand extends /** * Creates a new WaitForDigitCommand. * - * @param timeout the milliseconds to wait for the channel to receive a DTMF digit. + * @param timeout the milliseconds to wait for the channel to receive a DTMF + * digit. */ public WaitForDigitCommand(int timeout) { @@ -69,7 +70,8 @@ public class WaitForDigitCommand extends /** * Sets the milliseconds to wait for the channel to receive a DTMF digit. * - * @param timeout the milliseconds to wait for the channel to receive a DTMF digit. + * @param timeout the milliseconds to wait for the channel to receive a DTMF + * digit. */ public void setTimeout(int timeout) { Index: ReceiveCharCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/ReceiveCharCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- ReceiveCharCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ ReceiveCharCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -18,10 +18,11 @@ package net.sf.asterisk.fastagi.command; /** * Receives a character of text on a channel.<br> - * Specify timeout to be the maximum time to wait for input in milliseconds, or 0 for infinite.<br> + * Specify timeout to be the maximum time to wait for input in milliseconds, or + * 0 for infinite.<br> * Most channels do not support the reception of text.<br> - * Returns the decimal value of the character if one is received, or 0 if the channel does not - * support text reception. Returns -1 only on error/hangup. + * Returns the decimal value of the character if one is received, or 0 if the + * channel does not support text reception. Returns -1 only on error/hangup. * * @author srt * @version $Id$ @@ -39,7 +40,8 @@ public class ReceiveCharCommand extends private int timeout; /** - * Creates a new ReceiveCharCommand with a default timeout of 0 meaning to wait for ever. + * Creates a new ReceiveCharCommand with a default timeout of 0 meaning to + * wait for ever. */ public ReceiveCharCommand() { @@ -49,7 +51,8 @@ public class ReceiveCharCommand extends /** * Creates a new ReceiveCharCommand. * - * @param timeout the milliseconds to wait for the channel to receive a character. + * @param timeout the milliseconds to wait for the channel to receive a + * character. */ public ReceiveCharCommand(int timeout) { @@ -69,7 +72,8 @@ public class ReceiveCharCommand extends /** * Sets the milliseconds to wait for the channel to receive a character. * - * @param timeout the milliseconds to wait for the channel to receive a character. + * @param timeout the milliseconds to wait for the channel to receive a + * character. */ public void setTimeout(int timeout) { Index: DatabaseGetCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/DatabaseGetCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- DatabaseGetCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ DatabaseGetCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -18,7 +18,8 @@ package net.sf.asterisk.fastagi.command; /** * Retrieves an entry in the Asterisk database for a given family and key.<br> - * Returns 0 if is not set. Returns 1 if the variable is set and returns the value in parenthesis.<br> + * Returns 0 if is not set. Returns 1 if the variable is set and returns the + * value in parenthesis.<br> * Example return code: 200 result=1 (testvariable) * * @author srt @@ -95,6 +96,7 @@ public class DatabaseGetCommand extends public String buildCommand() { - return "DATABASE GET " + escapeAndQuote(family) + " " + escapeAndQuote(key); + return "DATABASE GET " + escapeAndQuote(family) + " " + + escapeAndQuote(key); } } Index: RecordFileCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/RecordFileCommand.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- RecordFileCommand.java 5 Mar 2005 22:46:58 -0000 1.1 +++ RecordFileCommand.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -19,10 +19,11 @@ package net.sf.asterisk.fastagi.command; /** * Record to a file until a given dtmf digit in the sequence is received.<br> * Returns -1 on hangup or error.<br> - * The format will specify what kind of file will be recorded. The timeout is the maximum record - * time in milliseconds, or -1 for no timeout. Offset samples is optional, and if provided will seek - * to the offset without exceeding the end of the file. "maxSilence" is the number of seconds of - * maxSilence allowed before the function returns despite the lack of dtmf digits or reaching + * The format will specify what kind of file will be recorded. The timeout is + * the maximum record time in milliseconds, or -1 for no timeout. Offset samples + * is optional, and if provided will seek to the offset without exceeding the + * end of the file. "maxSilence" is the number of seconds of maxSilence allowed + * before the function returns despite the lack of dtmf digits or reaching * timeout. * * @author srt @@ -66,8 +67,8 @@ public class RecordFileCommand extends A private boolean beep; /** - * The amount of silence (in seconds) to allow before returning despite the lack of dtmf digits - * or reaching timeout. + * The amount of silence (in seconds) to allow before returning despite the + * lack of dtmf digits or reaching timeout. */ private int maxSilence; @@ -76,10 +77,13 @@ public class RecordFileCommand extends A * * @param file the name of the file to stream, must not include extension. * @param format the format of the file to be recorded, for example "wav". - * @param escapeDigits contains the digits that allow the user to end recording. - * @param timeout the maximum record time in milliseconds, or -1 for no timeout. + * @param escapeDigits contains the digits that allow the user to end + * recording. + * @param timeout the maximum record time in milliseconds, or -1 for no + * timeout. */ - public RecordFileCommand(String file, String format, String escapeDigits, int timeout) + public RecordFileCommand(String file, String format, String escapeDigits, + int timeout) { this.file = file; this.format = format; @@ -95,15 +99,18 @@ public class RecordFileCommand extends A * * @param file the name of the file to stream, must not include extension. * @param format the format of the file to be recorded, for example "wav". - * @param escapeDigits contains the digits that allow the user to end recording. - * @param timeout the maximum record time in milliseconds, or -1 for no timeout. + * @param escapeDigits contains the digits that allow the user to end + * recording. + * @param timeout the maximum record time in milliseconds, or -1 for no + * timeout. * @param offset the offset samples to skip. - * @param beep <code>true</code> if a beep should be played before recording. - * @param maxSilence The amount of silence (in seconds) to allow before returning despite the - * lack of dtmf digits or reaching timeout. + * @param beep <code>true</code> if a beep should be played before + * recording. + * @param maxSilence The amount of silence (in seconds) to allow before + * returning despite the lack of dtmf digits or reaching timeout. */ - public RecordFileCommand(String file, String format, String escapeDigits, int timeout, int offset, boolean beep, - int maxSilence) + public RecordFileCommand(String file, String format, String escapeDigits, + int timeout, int offset, boolean beep, int maxSilence) { this.file = file; this.format = format; @@ -167,8 +174,8 @@ public class RecordFileCommand extends A /** * Sets the digits that allow the user to end recording. * - * @param escapeDigits the digits that allow the user to end recording or <code>null</code> - * for none. + * @param escapeDigits the digits that allow the user to end recording or + * <code>null</code> for none. */ public void setEscapeDigits(String escapeDigits) { @@ -188,7 +195,8 @@ public class RecordFileCommand extends A /** * Sets the maximum record time in milliseconds. * - * @param timeout the maximum record time in milliseconds, or -1 for no timeout. + * @param timeout the maximum record time in milliseconds, or -1 for no + * timeout. */ public void setTimeout(int timeout) { @@ -218,8 +226,8 @@ public class RecordFileCommand extends A /** * Returns <code>true</code> if a beep should be played before recording. * - * @return <code>true</code> if a beep should be played before recording, <code>false</code> - * if not. + * @return <code>true</code> if a beep should be played before recording, + * <code>false</code> if not. */ public boolean getBeep() { @@ -229,8 +237,8 @@ public class RecordFileCommand extends A /** * Set to <code>true</code> to play a beep before recording. * - * @param beep <code>true</code> if a beep should be played before recording, - * <code>false</code> if not. + * @param beep <code>true</code> if a beep should be played before + * recording, <code>false</code> if not. */ public void setBeep(boolean beep) { @@ -239,8 +247,9 @@ public class RecordFileCommand extends A public String buildCommand() { - return "RECORD FILE " + escapeAndQuote(file) + " " + escapeAndQuote(format) + " " - + escapeAndQuote(escapeDigits) + " " + timeout + " " + offset + (beep == true ? " BEEP" : "") + " s=" - + maxSilence; + return "RECORD FILE " + escapeAndQuote(file) + " " + + escapeAndQuote(format) + " " + escapeAndQuote(escapeDigits) + + " " + timeout + " " + offset + (beep == true ? " BEEP" : "") + + " s=" + maxSilence; } } |
|
From: Stefan R. <sr...@us...> - 2005-03-08 16:48:48
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22302/src/java/net/sf/asterisk/fastagi/reply Modified Files: AGIReply.java Log Message: Index: AGIReply.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/AGIReply.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- AGIReply.java 8 Mar 2005 02:58:01 -0000 1.3 +++ AGIReply.java 8 Mar 2005 16:48:35 -0000 1.4 @@ -20,9 +20,10 @@ import java.io.Serializable; /** * Reply received in response to an AGICommand.<br> - * The AGIReply contains information about success or failure of the execution of an AGICommand and - - * depending on the command sent - additional information returned, for example the value of a - * variable requested by a GetVariableCommand. + * The AGIReply contains information about success or failure of the execution + * of an AGICommand and - depending on the command sent - additional information + * returned, for example the value of a variable requested by a + * GetVariableCommand. * * @see net.sf.asterisk.fastagi.command.AGICommand * @@ -32,21 +33,24 @@ import java.io.Serializable; public class AGIReply implements Serializable { /** - * Status code (200) indicating Asterisk successfully processed the AGICommand. + * Status code (200) indicating Asterisk successfully processed the + * AGICommand. */ public static int SC_SUCCESS = 200; /** - * Status code (510) indicating Asterisk was unable to process the AGICommand because there is - * no command with the given name available. + * Status code (510) indicating Asterisk was unable to process the + * AGICommand because there is no command with the given name available. */ public static int SC_INVALID_OR_UNKNOWN_COMMAND = 510; /** - * Status code (510) indicating Asterisk was unable to process the AGICommand because the syntax - * used was not correct. This is most likely due to missing required parameters or additional - * parameters sent that are not understood.<br> - * Ensure proper quoting of the parameters when you receive this status code. + * Status code (510) indicating Asterisk was unable to process the + * AGICommand because the syntax used was not correct. This is most likely + * due to missing required parameters or additional parameters sent that are + * not understood.<br> + * Ensure proper quoting of the parameters when you receive this status + * code. */ public static int SC_INVALID_COMMAND_SYNTAX = 520; @@ -66,8 +70,8 @@ public class AGIReply implements Seriali private int status; /** - * In case of status == 520 (invalid command syntax) this attribute contains the synopsis of the - * command. + * In case of status == 520 (invalid command syntax) this attribute contains + * the synopsis of the command. */ private String usage; @@ -118,10 +122,11 @@ public class AGIReply implements Seriali } /** - * Returns the synopsis of the command sent if Asterisk expected a different syntax (getStatus() == - * SC_INVALID_COMMAND_SYNTAX). + * Returns the synopsis of the command sent if Asterisk expected a different + * syntax (getStatus() == SC_INVALID_COMMAND_SYNTAX). * - * @return the synopsis of the command sent, <code>null</code> if there were no syntax errors. + * @return the synopsis of the command sent, <code>null</code> if there + * were no syntax errors. */ public String getUsage() { |
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22302/src/java/net/sf/asterisk/fastagi Modified Files: AGIRequestBuilderImpl.java AGIRequestBuilder.java AGIScript.java AGIServer.java AGIResponse.java AGIRequestImpl.java Log Message: Index: AGIRequestBuilderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIRequestBuilderImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIRequestBuilderImpl.java 5 Mar 2005 22:46:59 -0000 1.1 +++ AGIRequestBuilderImpl.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -60,7 +60,7 @@ public class AGIRequestBuilderImpl imple if (map.get("callerid") != null) { String rawCallerId = (String) map.get("callerid"); - + request.setCallerId(getCallerId(rawCallerId)); request.setCallerIdName(getCallerIdName(rawCallerId)); } @@ -89,12 +89,13 @@ public class AGIRequestBuilderImpl imple } /** - * Builds a map containing variable names as key (with the "agi_" prefix stripped) and the - * corresponding values.<br> + * Builds a map containing variable names as key (with the "agi_" prefix + * stripped) and the corresponding values.<br> * Syntactically invalid and empty variables are skipped. * * @param lines the environment to transform. - * @return a map with the variables set corresponding to the given environment. + * @return a map with the variables set corresponding to the given + * environment. */ private Map buildMap(final Collection lines) { Index: AGIRequestBuilder.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIRequestBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIRequestBuilder.java 5 Mar 2005 22:46:59 -0000 1.1 +++ AGIRequestBuilder.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -19,7 +19,8 @@ package net.sf.asterisk.fastagi; import java.util.Collection; /** - * Parses the environment printed by asterisk's <code>setup_env</code> function to an AGIRequest. + * Parses the environment printed by asterisk's <code>setup_env</code> + * function to an AGIRequest. * * @author srt * @version $Id$ @@ -27,10 +28,11 @@ import java.util.Collection; public interface AGIRequestBuilder { /** - * Parses the environment printed by asterisk's <code>setup_env</code> function to an - * AGIRequest. + * Parses the environment printed by Asterisk's <code>setup_env</code> + * function to an AGIRequest. * - * @param lines the environment printed by asterisk's <code>setup_env</code> function. + * @param lines the environment printed by Asterisk's <code>setup_env</code> + * function. * @return an AGIRequest setup according to the environment passed in. */ AGIRequest buildAGIRequest(Collection lines); Index: AGIScript.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIScript.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIScript.java 8 Mar 2005 02:25:34 -0000 1.1 +++ AGIScript.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -17,11 +17,12 @@ package net.sf.asterisk.fastagi; /** - * AGIScripts are used by the AsteriskServer to handle AGIRequests received from the Asterisk - * server.<br> - * To implement functionality using this framework you have to implement this interface.<br> - * Note: The implementation of AGIScript must be threadsafe as only one instance is used by - * AsteriskServer to handle all requests to a resource. + * AGIScripts are used by the AsteriskServer to handle AGIRequests received from + * the Asterisk server.<br> + * To implement functionality using this framework you have to implement this + * interface.<br> + * Note: The implementation of AGIScript must be threadsafe as only one instance + * is used by AsteriskServer to handle all requests to a resource. * * @author srt * @version $Id$ @@ -29,12 +30,13 @@ package net.sf.asterisk.fastagi; public interface AGIScript { /** - * The service method is called by the AsteriskServer whenever this AGIScript should handle an - * incoming AGIRequest. + * The service method is called by the AsteriskServer whenever this + * AGIScript should handle an incoming AGIRequest. * - * @param request the initial data received from Asterisk when requesting this script. - * @param response a handle to communicate with Asterisk such as sending commands in response to - * the request. + * @param request the initial data received from Asterisk when requesting + * this script. + * @param response a handle to communicate with Asterisk such as sending + * commands in response to the request. */ void service(final AGIRequest request, final AGIResponse response); } Index: AGIServer.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIServer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- AGIServer.java 8 Mar 2005 02:32:58 -0000 1.2 +++ AGIServer.java 8 Mar 2005 16:48:34 -0000 1.3 @@ -19,9 +19,10 @@ package net.sf.asterisk.fastagi; import java.io.IOException; /** - * Listens for incoming AGI connections, reads the inital data and builds an AGIRequest using an - * AGIRequestBuilder.<br> - * The AGIRequest is then handed over to the appropriate AGIScript for processing. + * Listens for incoming AGI connections, reads the inital data and builds an + * AGIRequest using an AGIRequestBuilder.<br> + * The AGIRequest is then handed over to the appropriate AGIScript for + * processing. * * @author srt * @version $Id$ @@ -30,8 +31,8 @@ public interface AGIServer { /** * Starts this AGIServer.<br> - * After calling startup() this AGIServer is ready to receive requests from Asterisk servers and - * process them. + * After calling startup() this AGIServer is ready to receive requests from + * Asterisk servers and process them. * * @throws IOException if the server socket cannot be bound. * @throws IllegalStateException if this AGIServer is already running. @@ -43,7 +44,8 @@ public interface AGIServer * The server socket is closed and all resources are freed. * * @throws IOException if the connection cannot be shut down. - * @throws IllegalStateException if this AGIServer is already shut down or has not yet been started. + * @throws IllegalStateException if this AGIServer is already shut down or + * has not yet been started. */ void shutdown() throws IOException, IllegalStateException; } Index: AGIResponse.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIResponse.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIResponse.java 8 Mar 2005 02:25:34 -0000 1.1 +++ AGIResponse.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -22,8 +22,10 @@ import net.sf.asterisk.fastagi.command.A import net.sf.asterisk.fastagi.reply.AGIReply; /** - * Provides the functionality to send AGICommands to Asterisk while handling an AGIRequest.<br> - * This interface is supposed to be used by AGIScripts for interaction with the Asterisk server. + * Provides the functionality to send AGICommands to Asterisk while handling an + * AGIRequest.<br> + * This interface is supposed to be used by AGIScripts for interaction with the + * Asterisk server. * * @author srt * @version $Id$ Index: AGIRequestImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIRequestImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIRequestImpl.java 5 Mar 2005 22:46:59 -0000 1.1 +++ AGIRequestImpl.java 8 Mar 2005 16:48:34 -0000 1.2 @@ -135,9 +135,11 @@ public class AGIRequestImpl implements S } /** - * Returns the full URL of the request in the form agi://host[:port][/script]. + * Returns the full URL of the request in the form + * agi://host[:port][/script]. * - * @return the full URL of the request in the form agi://host[:port][/script]. + * @return the full URL of the request in the form + * agi://host[:port][/script]. */ public String getRequestURL() { @@ -147,7 +149,8 @@ public class AGIRequestImpl implements S /** * Sets the full URL of the request in the form agi://host[:port][/script]. * - * @param requestURL the full URL of the request in the form agi://host[:port][/script]. + * @param requestURL the full URL of the request in the form + * agi://host[:port][/script]. */ public void setRequestURL(String requestURL) { @@ -295,9 +298,11 @@ public class AGIRequestImpl implements S } /** - * Returns the context in the dial plan from which the AGI script was called. + * Returns the context in the dial plan from which the AGI script was + * called. * - * @return the context in the dial plan from which the AGI script was called. + * @return the context in the dial plan from which the AGI script was + * called. */ public String getContext() { @@ -307,7 +312,8 @@ public class AGIRequestImpl implements S /** * Sets the context in the dial plan from which the AGI script was called. * - * @param context the context in the dial plan from which the AGI script was called. + * @param context the context in the dial plan from which the AGI script was + * called. */ public void setContext(String context) { @@ -315,9 +321,11 @@ public class AGIRequestImpl implements S } /** - * Returns the extension in the dial plan from which the AGI script was called. + * Returns the extension in the dial plan from which the AGI script was + * called. * - * @return the extension in the dial plan from which the AGI script was called. + * @return the extension in the dial plan from which the AGI script was + * called. */ public String getExtension() { @@ -327,7 +335,8 @@ public class AGIRequestImpl implements S /** * Sets the extension in the dial plan from which the AGI script was called. * - * @param extension the extension in the dial plan from which the AGI script was called. + * @param extension the extension in the dial plan from which the AGI script + * was called. */ public void setExtension(String extension) { @@ -335,9 +344,11 @@ public class AGIRequestImpl implements S } /** - * Returns the priority in the dial plan from which the AGI script was called. + * Returns the priority in the dial plan from which the AGI script was + * called. * - * @return the priority in the dial plan from which the AGI script was called. + * @return the priority in the dial plan from which the AGI script was + * called. */ public Integer getPriority() { @@ -347,7 +358,8 @@ public class AGIRequestImpl implements S /** * Sets the priority in the dial plan from which the AGI script was called. * - * @param priority the priority in the dial plan from which the AGI script was called. + * @param priority the priority in the dial plan from which the AGI script + * was called. */ public void setPriority(Integer priority) { @@ -358,7 +370,8 @@ public class AGIRequestImpl implements S * Returns wheather this agi is passed audio (EAGI - Enhanced AGI).<br> * Enhanced AGI is currently not supported on FastAGI. * - * @return Boolean.TRUE if this agi is passed audio, Boolean.FALSE otherwise. + * @return Boolean.TRUE if this agi is passed audio, Boolean.FALSE + * otherwise. */ public Boolean getEnhanced() { @@ -368,7 +381,8 @@ public class AGIRequestImpl implements S /** * Sets wheather this agi is passed audio. * - * @param enhanced Boolean.TRUE if this agi is passed audio, Boolean.FALSE otherwise. + * @param enhanced Boolean.TRUE if this agi is passed audio, Boolean.FALSE + * otherwise. */ public void setEnhanced(Boolean enhanced) { @@ -397,7 +411,8 @@ public class AGIRequestImpl implements S public String toString() { - return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); + return ToStringBuilder.reflectionToString(this, + ToStringStyle.MULTI_LINE_STYLE); } public boolean equals(Object o) |
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22302/src/java/net/sf/asterisk/io Added Files: ServerSocketFacadeImpl.java SocketConnectionFacade.java ServerSocketFacade.java SocketConnectionFacadeImpl.java Log Message: --- NEW FILE: ServerSocketFacadeImpl.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.io; import java.io.IOException; import java.net.ServerSocket; import java.net.Socket; public class ServerSocketFacadeImpl implements ServerSocketFacade { private ServerSocket serverSocket; public ServerSocketFacadeImpl(int port) throws IOException { this.serverSocket = new ServerSocket(port); } public SocketConnectionFacade accept() throws IOException { Socket socket; socket = serverSocket.accept(); return new SocketConnectionFacadeImpl(socket); } public void close() throws IOException { serverSocket.close(); } } --- NEW FILE: SocketConnectionFacade.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.io; import java.io.IOException; /** * The SocketConnectionFacade provides read and write operation for * communication over TCP/IP sockets.<br> * It hides the details of the underlying I/O system used for socket * communication. * * @author srt * @version $Id: SocketConnectionFacade.java,v 1.1 2005/03/08 16:48:35 srt Exp $ */ public interface SocketConnectionFacade { /** * Reads a line of text from the socket connection. The current thread is * blocked until either the next line is received or an IOException * encounters. * * @return the line of text received excluding any newline character * @throws IOException if the connection has been closed. */ String readLine() throws IOException; /** * Sends a given String to the socket connection. * * @param s the String to send. * @throws IOException if the String cannot be sent, maybe because the * connection has already been closed. */ void write(String s) throws IOException; /** * Flushes the socket connection, that is sends any buffered but yet unsent * data. * * @throws IOException if the connection cannot be flushed. */ void flush() throws IOException; /** * Closes the socket connection including its input and output stream and * frees all associated ressources.<br> * When calling close() any Thread currently blocked by a call to readLine() * will be unblocked and receive an IOException. * * @throws IOException if the socket connection cannot be closed. */ void close() throws IOException; } --- NEW FILE: ServerSocketFacade.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.io; import java.io.IOException; /** * * @author srt * @version $Id: ServerSocketFacade.java,v 1.1 2005/03/08 16:48:35 srt Exp $ */ public interface ServerSocketFacade { /** * Waits for a new incoming connection. * * @return * @throws IOException */ SocketConnectionFacade accept() throws IOException; /** * Unbinds and closes the server socket. * * @throws IOException if the server socket cannot be closed. */ void close() throws IOException; } --- NEW FILE: SocketConnectionFacadeImpl.java --- /* * Copyright 2004-2005 Stefan Reuter * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package net.sf.asterisk.io; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.net.Socket; public class SocketConnectionFacadeImpl implements SocketConnectionFacade { private final Socket socket; private final BufferedReader reader; private final BufferedWriter writer; public SocketConnectionFacadeImpl(String host, int port) throws IOException { this.socket = new Socket(host, port); this.reader = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); this.writer = new BufferedWriter(new OutputStreamWriter(this.socket.getOutputStream())); } SocketConnectionFacadeImpl(Socket socket) throws IOException { this.socket = socket; this.reader = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); this.writer = new BufferedWriter(new OutputStreamWriter(this.socket.getOutputStream())); } public String readLine() throws IOException { return reader.readLine(); } public void write(String s) throws IOException { writer.write(s); } public void flush() throws IOException { writer.flush(); } public void close() throws IOException { this.socket.close(); } } |
|
From: Stefan R. <sr...@us...> - 2005-03-08 16:48:48
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22302/src/java/net/sf/asterisk/manager/io Removed Files: SocketConnectionFacade.java SocketConnectionFacadeImpl.java Log Message: --- SocketConnectionFacade.java DELETED --- --- SocketConnectionFacadeImpl.java DELETED --- |
|
From: Stefan R. <sr...@us...> - 2005-03-08 16:48:03
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22150/src/java/net/sf/asterisk/io Log Message: Directory /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/io added to the repository |