asterisk-java-cvs Mailing List for Asterisk-Java Library (Page 85)
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
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:44
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/java/net/sf/asterisk/manager Modified Files: ManagerReader.java ManagerConnection.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: ManagerReader.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerReader.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -p -r1.11 -r1.12 --- ManagerReader.java 11 Mar 2005 22:27:49 -0000 1.11 +++ ManagerReader.java 15 Apr 2005 04:46:59 -0000 1.12 @@ -17,7 +17,6 @@ package net.sf.asterisk.manager; import net.sf.asterisk.io.SocketConnectionFacade; -import net.sf.asterisk.manager.event.ManagerEvent; /** * The ManagerReader reads events and responses from the asterisk server, parses them using Index: ManagerConnection.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/ManagerConnection.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- ManagerConnection.java 5 Mar 2005 02:27:58 -0000 1.5 +++ ManagerConnection.java 15 Apr 2005 04:46:59 -0000 1.6 @@ -19,7 +19,6 @@ package net.sf.asterisk.manager; import java.io.IOException; import net.sf.asterisk.manager.action.ManagerAction; -import net.sf.asterisk.manager.event.ManagerEvent; import net.sf.asterisk.manager.response.ManagerResponse; /** |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:12
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/test/net/sf/asterisk/fastagi Modified Files: ResourceBundleMappingStrategyTest.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: ResourceBundleMappingStrategyTest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/ResourceBundleMappingStrategyTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- ResourceBundleMappingStrategyTest.java 13 Mar 2005 11:26:51 -0000 1.4 +++ ResourceBundleMappingStrategyTest.java 15 Apr 2005 04:47:02 -0000 1.5 @@ -16,8 +16,9 @@ */ package net.sf.asterisk.fastagi; +import java.util.Map; + import junit.framework.TestCase; -import net.sf.asterisk.fastagi.impl.AGIRequestImpl; public class ResourceBundleMappingStrategyTest extends TestCase { @@ -34,10 +35,9 @@ public class ResourceBundleMappingStrate { AGIScript scriptFirstPass; AGIScript scriptSecondPass; - AGIRequestImpl request; + AGIRequest request; - request = new AGIRequestImpl(); - request.setScript("hello.agi"); + request = new SimpleAGIRequest(); scriptFirstPass = mappingStrategy.determineScript(request); scriptSecondPass = mappingStrategy.determineScript(request); @@ -51,13 +51,111 @@ public class ResourceBundleMappingStrate public void testDetermineScriptWithResourceBundleUnavailable() { - AGIRequestImpl request; + AGIRequest request; - request = new AGIRequestImpl(); - request.setScript("hello.agi"); + request = new SimpleAGIRequest(); mappingStrategy .setResourceBundleName("net.sf.asterisk.fastagi.unavailable"); assertNull(mappingStrategy.determineScript(request)); } + + public class SimpleAGIRequest implements AGIRequest + { + + public Map getRequest() + { + throw new UnsupportedOperationException(); + } + + public String getScript() + { + return "hello.agi"; + } + + public String getRequestURL() + { + throw new UnsupportedOperationException(); + } + + public String getChannel() + { + throw new UnsupportedOperationException(); + } + + public String getUniqueId() + { + throw new UnsupportedOperationException(); + } + + public String getType() + { + throw new UnsupportedOperationException(); + } + + public String getLanguage() + { + throw new UnsupportedOperationException(); + } + + public String getCallerId() + { + throw new UnsupportedOperationException(); + } + + public String getCallerIdName() + { + throw new UnsupportedOperationException(); + } + + public String getDnid() + { + throw new UnsupportedOperationException(); + } + + public String getRdnis() + { + throw new UnsupportedOperationException(); + } + + public String getContext() + { + throw new UnsupportedOperationException(); + } + + public String getExtension() + { + throw new UnsupportedOperationException(); + } + + public Integer getPriority() + { + throw new UnsupportedOperationException(); + } + + public Boolean getEnhanced() + { + throw new UnsupportedOperationException(); + } + + public String getAccountCode() + { + throw new UnsupportedOperationException(); + } + + public String getParameter(String name) + { + throw new UnsupportedOperationException(); + } + + public String[] getParameterValues(String name) + { + throw new UnsupportedOperationException(); + } + + public Map getParameterMap() + { + throw new UnsupportedOperationException(); + } + } } |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:12
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/java/net/sf/asterisk/fastagi Modified Files: AGIRequest.java Removed Files: RequestBuilder.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: AGIRequest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/AGIRequest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- AGIRequest.java 6 Apr 2005 23:06:00 -0000 1.4 +++ AGIRequest.java 15 Apr 2005 04:47:02 -0000 1.5 @@ -29,6 +29,13 @@ import java.util.Map; public interface AGIRequest { /** + * Returns a Map containing the raw request name/value pairs. + * + * @return Map contain raw request name/value pairs. + */ + Map getRequest(); + + /** * Returns the name of the script to execute including its full path.<br> * This corresponds to the request url with protocol, host, port and * parameters stripped off. --- RequestBuilder.java DELETED --- |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:12
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/reply/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/test/net/sf/asterisk/fastagi/reply/impl Added Files: AGIReplyImplTest.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation --- NEW FILE: AGIReplyImplTest.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.reply.impl; import java.util.ArrayList; import java.util.List; import junit.framework.TestCase; import net.sf.asterisk.fastagi.reply.impl.AGIReplyImpl; public class AGIReplyImplTest extends TestCase { private List lines; protected void setUp() { this.lines = new ArrayList(); } public void testBuildReply() { AGIReplyImpl reply; lines.add("200 result=49"); reply = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 49, reply.getResultCode()); assertEquals("Incorrect result as character", '1', reply .getResultCodeAsChar()); assertEquals("Incorrect result when get via getAttribute()", "49", reply.getAttribute("result")); } public void testBuildReplyWithAdditionalAttribute() { AGIReplyImpl reply; lines.add("200 result=49 endpos=2240"); reply = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 49, reply.getResultCode()); assertEquals("Incorrect result as character", '1', reply .getResultCodeAsChar()); assertEquals("Incorrect result when get via getAttribute()", "49", reply.getAttribute("result")); assertEquals("Incorrect endpos attribute", "2240", reply .getAttribute("endpos")); } public void testBuildReplyWithMultipleAdditionalAttribute() { AGIReplyImpl reply; lines.add("200 result=49 startpos=1234 endpos=2240"); reply = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 49, reply.getResultCode()); assertEquals("Incorrect result as character", '1', reply .getResultCodeAsChar()); assertEquals("Incorrect result when get via getAttribute()", "49", reply.getAttribute("result")); assertEquals("Incorrect startpos attribute", "1234", reply .getAttribute("startpos")); assertEquals("Incorrect endpos attribute", "2240", reply .getAttribute("endpos")); } public void testBuildReplyWithParenthesis() { AGIReplyImpl reply; lines.add("200 result=1 ((hello)(world))"); reply = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 1, reply.getResultCode()); assertEquals("Incorrect parenthesis", "(hello)(world)", reply .getExtra()); } public void testBuildReplyWithAdditionalAttributeAndParenthesis() { AGIReplyImpl reply; lines.add("200 result=1 ((hello)(world)) endpos=2240"); reply = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.SC_SUCCESS, reply.getStatus()); assertEquals("Incorrect result", 1, reply.getResultCode()); assertEquals("Incorrect parenthesis", "(hello)(world)", reply .getExtra()); assertEquals("Incorrect endpos attribute", "2240", reply .getAttribute("endpos")); } public void testBuildReplyInvalidOrUnknownCommand() { AGIReplyImpl reply; lines.add("510 Invalid or unknown command"); reply = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.SC_INVALID_OR_UNKNOWN_COMMAND, reply.getStatus()); } public void testBuildReplyInvalidCommandSyntax() { AGIReplyImpl 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 = new AGIReplyImpl(lines); assertEquals("Incorrect status", AGIReplyImpl.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()); } } |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:11
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/java/net/sf/asterisk/fastagi/reply Modified Files: AGIReply.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: AGIReply.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/AGIReply.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -p -r1.12 -r1.13 --- AGIReply.java 30 Mar 2005 01:39:05 -0000 1.12 +++ AGIReply.java 15 Apr 2005 04:47:02 -0000 1.13 @@ -16,9 +16,7 @@ */ package net.sf.asterisk.fastagi.reply; -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; +import java.util.List; /** * Reply received in response to an AGICommand.<br> @@ -31,7 +29,7 @@ import java.util.Map; * @author srt * @version $Id$ */ -public class AGIReply implements Serializable +public interface AGIReply { /** * Status code (200) indicating Asterisk successfully processed the @@ -54,84 +52,24 @@ public class AGIReply implements Seriali * code. */ public static int SC_INVALID_COMMAND_SYNTAX = 520; + + String getFirstLine(); - /** - * Serial version identifier. - */ - private static final long serialVersionUID = 3256727294671337012L; - - /** - * The result, that is the part directly following the "result=" - * string. - */ - private String result; - - /** - * The status code. - */ - private int status; - - /** - * Additional attributes contained in this reply, for example endpos. - */ - private Map attributes; - - /** - * The contents of the parenthesis. - */ - private String extra; - - /** - * 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; + List getLines(); /** * Returns the return code (the result as int). * * @return the return code or -1 if the result is not an int. */ - public int getResultCode() - { - if (result == null) - { - return -1; - } - - try - { - return Integer.parseInt(result); - } - catch (NumberFormatException e) - { - return -1; - } - } + int getResultCode(); /** * Returns the return code as character. * * @return the return code as character. */ - public char getResultCodeAsChar() - { - int resultCode; - - resultCode = getResultCode(); - if (resultCode < 0) - { - return 0x0; - } - - return (char) resultCode; - } + char getResultCodeAsChar(); /** * Returns the result, that is the part directly following the "result=" @@ -139,20 +77,7 @@ public class AGIReply implements Seriali * * @return the result. */ - public String getResult() - { - return result; - } - - /** - * Sets the result. - * - * @param result the result to set. - */ - public void setResult(String result) - { - this.result = result; - } + String getResult(); /** * Returns the status code.<br> @@ -165,20 +90,7 @@ public class AGIReply implements Seriali * * @return the status code. */ - public int getStatus() - { - return status; - } - - /** - * Sets the status code. - * - * @param status the status code to set. - */ - public void setStatus(int status) - { - this.status = status; - } + int getStatus(); /** * Returns an additional attribute contained in the reply.<br> @@ -192,36 +104,7 @@ public class AGIReply implements Seriali * @return the value of the attribute or <code>null</code> if it is not * set. */ - public String getAttribute(String name) - { - if ("result".equalsIgnoreCase(name)) - { - return getResult(); - } - - if (attributes == null) - { - return null; - } - - return (String) attributes.get(name.toLowerCase()); - } - - /** - * Sets an additional attribute. - * - * @param name the name of the attribute to set. - * @param value the value of the attribute to set. - */ - public void setAttribute(String name, String value) - { - if (attributes == null) - { - attributes = new HashMap(); - } - - attributes.put(name.toLowerCase(), value); - } + String getAttribute(String name); /** * Returns the text in parenthesis contained in this reply.<br> @@ -231,20 +114,7 @@ public class AGIReply implements Seriali * * @return the text in the parenthesis or <code>null</code> if not set. */ - public String getExtra() - { - return extra; - } - - /** - * Sets the text in parenthesis in this reply. - * - * @param extra the text in parenthesis to set. - */ - public void setExtra(String extra) - { - this.extra = extra; - } + String getExtra(); /** * Returns the synopsis of the command sent if Asterisk expected a different @@ -253,20 +123,7 @@ public class AGIReply implements Seriali * @return the synopsis of the command sent, <code>null</code> if there * 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; - } + String getSynopsis(); /** * Returns the usage of the command sent if Asterisk expected a different @@ -275,39 +132,6 @@ public class AGIReply implements Seriali * @return the usage of the command sent, <code>null</code> if there were * no syntax errors. */ - public String getUsage() - { - return usage; - } - - /** - * Sets the synopsis of the command sent. - * - * @param usage the usage of the command sent. - */ - public void setUsage(String usage) - { - this.usage = usage; - } - - public String toString() - { - StringBuffer sb; - - sb = new StringBuffer(getClass().getName() + ": "); - sb.append("status='" + getStatus() + "'; "); - if (status == SC_SUCCESS) - { - sb.append("result='" + getResult() + "'; "); - sb.append("extra='" + getExtra() + "'; "); - sb.append("attributes=" + attributes + "; "); - } - if (status == SC_INVALID_COMMAND_SYNTAX) - { - sb.append("synopsis='" + getSynopsis() + "'; "); - } - sb.append("systemHashcode=" + System.identityHashCode(this)); + String getUsage(); - return sb.toString(); - } } |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:11
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/test/net/sf/asterisk/fastagi/impl Added Files: AGIRequestImplTest.java Removed Files: RequestBuilderImplTest.java ReplyBuilderImplTest.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation --- NEW FILE: AGIRequestImplTest.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.impl; import java.util.ArrayList; import java.util.Collection; import junit.framework.TestCase; import net.sf.asterisk.fastagi.AGIRequest; public class AGIRequestImplTest extends TestCase { protected void setUp() { } public void testBuildRequest() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_network: yes"); lines.add("agi_network_script: myscript.agi"); lines.add("agi_request: agi://host/myscript.agi"); lines.add("agi_channel: SIP/1234-d715"); lines.add("agi_language: en"); lines.add("agi_type: SIP"); lines.add("agi_uniqueid: 1110023416.6"); lines.add("agi_callerid: John Doe<1234>"); lines.add("agi_dnid: 8870"); lines.add("agi_rdnis: unknown"); lines.add("agi_context: local"); lines.add("agi_extension: 8870"); lines.add("agi_priority: 1"); lines.add("agi_enhanced: 0.0"); lines.add("agi_accountcode: "); request = new AGIRequestImpl(lines); assertEquals("incorrect script", "myscript.agi", request.getScript()); assertEquals("incorrect requestURL", "agi://host/myscript.agi", request.getRequestURL()); assertEquals("incorrect channel", "SIP/1234-d715", request.getChannel()); assertEquals("incorrect uniqueId", "SIP/1234-d715", request.getChannel()); assertEquals("incorrect type", "SIP", request.getType()); assertEquals("incorrect uniqueId", "1110023416.6", request.getUniqueId()); assertEquals("incorrect language", "en", request.getLanguage()); assertEquals("incorrect callerId", "1234", request.getCallerId()); assertEquals("incorrect callerIdName", "John Doe", request.getCallerIdName()); assertEquals("incorrect dnid", "8870", request.getDnid()); assertEquals("incorrect rdnis", "unknown", request.getRdnis()); assertEquals("incorrect context", "local", request.getContext()); assertEquals("incorrect extension", "8870", request.getExtension()); assertEquals("incorrect priority", new Integer(1), request.getPriority()); assertEquals("incorrect enhanced", Boolean.FALSE, request.getEnhanced()); assertNull("incorrect accountCode must not be set", request.getAccountCode()); } public void testBuildRequestWithoutCallerIdName() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_callerid: 1234"); request = new AGIRequestImpl(lines); assertEquals("incorrect callerId", "1234", request.getCallerId()); assertNull("callerIdName must not be set", request.getCallerIdName()); } public void testBuildRequestWithoutCallerIdNameButBracket() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_callerid: <1234>"); request = new AGIRequestImpl(lines); assertEquals("incorrect callerId", "1234", request.getCallerId()); assertNull("callerIdName must not be set", request.getCallerIdName()); } public void testBuildRequestWithoutCallerIdNameButBracketAndQuotesAndSpace() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_callerid: \"\" <1234>"); request = new AGIRequestImpl(lines); assertEquals("incorrect callerId", "1234", request.getCallerId()); assertNull("callerIdName must not be set", request.getCallerIdName()); } public void testBuildRequestWithQuotedCallerIdName() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_callerid: \"John Doe\"<1234>"); request = new AGIRequestImpl(lines); assertEquals("incorrect callerId", "1234", request.getCallerId()); assertEquals("incorrect callerIdName", "John Doe", request.getCallerIdName()); } public void testBuildRequestWithQuotedCallerIdNameAndSpace() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_callerid: \"John Doe\" <1234>"); request = new AGIRequestImpl(lines); assertEquals("incorrect callerId", "1234", request.getCallerId()); assertEquals("incorrect callerIdName", "John Doe", request.getCallerIdName()); } public void testBuildRequestWithoutCallerId() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_callerid: "); request = new AGIRequestImpl(lines); assertNull("callerId must not be set", request.getCallerId()); assertNull("callerIdName must not be set", request.getCallerIdName()); } public void testBuildRequestWithNullEnvironment() { try { new AGIRequestImpl(null); fail("No IllegalArgumentException thrown."); } catch (IllegalArgumentException e) { } } public void testBuildRequestWithUnusualInput() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("var without agi prefix: a value"); lines.add("agi_without_colon another value"); lines.add("agi_without_space_after_colon:"); lines.add("agi_channel: SIP/1234-a892"); request = new AGIRequestImpl(lines); assertEquals("incorrect channel", "SIP/1234-a892", request.getChannel()); } public void testBuildRequestWithoutParameters() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_network_script: myscript.agi"); lines.add("agi_request: agi://host/myscript.agi"); request = new AGIRequestImpl(lines); assertEquals("incorrect script", "myscript.agi", request.getScript()); assertEquals("incorrect requestURL", "agi://host/myscript.agi", request.getRequestURL()); assertEquals("incorrect value for unset parameter 'param1'", null, request.getParameter("param1")); assertEquals("incorrect values for unset parameter 'param1'", null, request.getParameterValues("param1")); assertNotNull("getParameterMap() must not return null", request.getParameterMap()); assertEquals("incorrect size of getParameterMap()", 0, request.getParameterMap().size()); } public void testBuildRequestWithSingleValueParameters() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_network_script: myscript.agi?param1=value1¶m2=value2"); lines.add("agi_request: agi://host/myscript.agi?param1=value1¶m2=value2"); request = new AGIRequestImpl(lines); assertEquals("incorrect script", "myscript.agi", request.getScript()); assertEquals("incorrect requestURL", "agi://host/myscript.agi?param1=value1¶m2=value2", request.getRequestURL()); assertEquals("incorrect value for parameter 'param1'", "value1", request.getParameter("param1")); assertEquals("incorrect value for parameter 'param2'", "value2", request.getParameter("param2")); assertEquals("incorrect value for unset parameter 'param3'", null, request.getParameter("param3")); assertEquals("incorrect size of getParameterMap()", 2, request.getParameterMap().size()); assertEquals("incorrect value for parameter 'param1' when obtained from map", "value1", ((String[]) request.getParameterMap().get("param1"))[0]); } public void testBuildRequestWithMultiValueParameter() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_network_script: myscript.agi?param1=value1¶m1=value2"); lines.add("agi_request: agi://host/myscript.agi?param1=value1¶m1=value2"); request = new AGIRequestImpl(lines); assertEquals("incorrect script", "myscript.agi", request.getScript()); assertEquals("incorrect requestURL", "agi://host/myscript.agi?param1=value1¶m1=value2", request.getRequestURL()); assertEquals("incorrect number of values for parameter 'param1'", 2, request.getParameterValues("param1").length); assertEquals("incorrect value[0] for parameter 'param1'", "value1", request.getParameterValues("param1")[0]); assertEquals("incorrect value[1] for parameter 'param1'", "value2", request.getParameterValues("param1")[1]); } public void testBuildRequestWithEmptyValueParameter() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_network_script: myscript.agi?param1"); lines.add("agi_request: agi://host/myscript.agi?param1"); request = new AGIRequestImpl(lines); assertEquals("incorrect script", "myscript.agi", request.getScript()); assertEquals("incorrect requestURL", "agi://host/myscript.agi?param1", request.getRequestURL()); assertEquals("incorrect value for parameter 'param1'", "", request.getParameter("param1")); assertEquals("incorrect number of values for parameter 'param1'", 1, request.getParameterValues("param1").length); assertEquals("incorrect value[0] for parameter 'param1'", "", request.getParameterValues("param1")[0]); } public void testBuildRequestWithUrlEncodedParameter() { Collection lines; AGIRequest request; lines = new ArrayList(); lines.add("agi_network_script: myscript.agi?param1=my%20value"); lines.add("agi_request: agi://host/myscript.agi?param1=my%20value"); request = new AGIRequestImpl(lines); assertEquals("incorrect script", "myscript.agi", request.getScript()); assertEquals("incorrect requestURL", "agi://host/myscript.agi?param1=my%20value", request.getRequestURL()); assertEquals("incorrect value for parameter 'param1'", "my value", request.getParameter("param1")); } } --- RequestBuilderImplTest.java DELETED --- --- ReplyBuilderImplTest.java DELETED --- |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:11
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/java/net/sf/asterisk/fastagi/impl Modified Files: AGIReaderImpl.java AGIRequestImpl.java Removed Files: RequestBuilderImpl.java ReplyBuilderImpl.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: AGIReaderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl/AGIReaderImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AGIReaderImpl.java 11 Mar 2005 15:20:50 -0000 1.1 +++ AGIReaderImpl.java 15 Apr 2005 04:47:00 -0000 1.2 @@ -25,9 +25,8 @@ import net.sf.asterisk.fastagi.AGIHangup import net.sf.asterisk.fastagi.AGINetworkException; import net.sf.asterisk.fastagi.AGIReader; import net.sf.asterisk.fastagi.AGIRequest; -import net.sf.asterisk.fastagi.ReplyBuilder; -import net.sf.asterisk.fastagi.RequestBuilder; import net.sf.asterisk.fastagi.reply.AGIReply; +import net.sf.asterisk.fastagi.reply.impl.AGIReplyImpl; import net.sf.asterisk.io.SocketConnectionFacade; /** @@ -39,14 +38,10 @@ import net.sf.asterisk.io.SocketConnecti public class AGIReaderImpl implements AGIReader { private SocketConnectionFacade socket; - private ReplyBuilder replyBuilder; - private RequestBuilder requestBuilder; public AGIReaderImpl(SocketConnectionFacade socket) { this.socket = socket; - this.replyBuilder = new ReplyBuilderImpl(); - this.requestBuilder = new RequestBuilderImpl(); } public AGIRequest readRequest() throws AGIException @@ -76,7 +71,7 @@ public class AGIReaderImpl implements AG e); } - request = requestBuilder.buildRequest(lines); + request = new AGIRequestImpl(lines); return request; } @@ -130,7 +125,7 @@ public class AGIReaderImpl implements AG } } - reply = replyBuilder.buildReply(lines); + reply = new AGIReplyImpl(lines); return reply; } Index: AGIRequestImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl/AGIRequestImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- AGIRequestImpl.java 6 Apr 2005 18:58:59 -0000 1.3 +++ AGIRequestImpl.java 15 Apr 2005 04:47:00 -0000 1.4 @@ -17,8 +17,16 @@ package net.sf.asterisk.fastagi.impl; import java.io.Serializable; +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; +import java.util.List; import java.util.Map; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import net.sf.asterisk.fastagi.AGIRequest; @@ -30,93 +38,103 @@ import net.sf.asterisk.fastagi.AGIReques */ public class AGIRequestImpl implements Serializable, AGIRequest { - /** - * Serial version identifier. - */ - private static final long serialVersionUID = 3257001047145789496L; + private static final Pattern SCRIPT_PATTERN = Pattern + .compile("^([^\\?]*)\\?(.*)$"); + private static final Pattern PARAMETER_PATTERN = Pattern + .compile("^(.*)=(.*)$"); - /** - * The name of the script to execute. - */ - private String script; + private String rawCallerId; /** - * The full URL of the request in the form agi://host[:port][/script] + * Serial version identifier. */ - private String requestURL; + private static final long serialVersionUID = 3257001047145789496L; - /** - * The name of the channel. - */ - private String channel; + private Map request; /** - * The unique id of the channel. + * A map assigning the values of a parameter (an array of Strings) to the + * name of the parameter. */ - private String uniqueId; + private Map parameterMap; /** - * The type of the channel, for example "SIP". + * Creates a new AGIRequestImpl. */ - private String type; + public AGIRequestImpl() + { + throw new IllegalArgumentException("Environment must not be null."); + } - /** - * The language, for example "en". - */ - private String language; + public AGIRequestImpl(final Collection lines) + { + if (lines == null) + { + throw new IllegalArgumentException("Environment must not be null."); + } + request = buildMap(lines); + } /** - * The Caller*ID, for example "1234". + * 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. */ - private String callerId; + private Map buildMap(final Collection lines) + { + Map map; + Iterator lineIterator; - /** - * The Caller*ID Name, for example "John Doe". - */ - private String callerIdName; + map = new HashMap(); + lineIterator = lines.iterator(); - private String dnid; + while (lineIterator.hasNext()) + { + String line; + int colonPosition; + String key; + String value; - private String rdnis; + line = (String) lineIterator.next(); + colonPosition = line.indexOf(':'); - /** - * The context in the dial plan from which the AGI script was called. - */ - private String context; + // no colon on the line? + if (colonPosition < 0) + { + continue; + } - /** - * The extension in the dial plan from which the AGI script was called. - */ - private String extension; + // key doesn't start with agi_? + if (!line.startsWith("agi_")) + { + continue; + } - /** - * The priority in the dial plan from which the AGI script was called. - */ - private Integer priority; + // first colon in line is last character -> no value present? + if (line.length() < colonPosition + 2) + { + continue; + } - /** - * Boolean.TRUE if this agi is passed audio (EAGI - Enhanced AGI).<br> - * Enhanced AGI is currently not supported on FastAGI. - */ - private Boolean enhanced; + key = line.substring(4, colonPosition).toLowerCase(); + value = line.substring(colonPosition + 2); - /** - * The account code set for the call. - */ - private String accountCode; + if (value.length() != 0) + { + map.put(key, value); + } + } - /** - * A map assigning the values of a parameter (an array of Strings) to the - * name of the parameter. - */ - private Map parameterMap; + return map; + } - /** - * Creates a new AGIRequestImpl. - */ - public AGIRequestImpl() + public Map getRequest() { - + return request; } /** @@ -126,20 +144,22 @@ public class AGIRequestImpl implements S */ public String getScript() { + if (script != null) + return script; + script = (String) request.get("network_script"); + if (script != null) + { + Matcher scriptMatcher = SCRIPT_PATTERN.matcher(script); + if (scriptMatcher.matches()) + { + script = scriptMatcher.group(1); + parameters = scriptMatcher.group(2); + } + } return script; } /** - * Sets the name of the script to execute. - * - * @param script the name of the script to execute. - */ - public void setScript(String script) - { - this.script = script; - } - - /** * Returns the full URL of the request in the form * agi://host[:port][/script]. * @@ -148,18 +168,7 @@ public class AGIRequestImpl implements S */ public String getRequestURL() { - return requestURL; - } - - /** - * 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]. - */ - public void setRequestURL(String requestURL) - { - this.requestURL = requestURL; + return (String) request.get("request"); } /** @@ -169,17 +178,7 @@ public class AGIRequestImpl implements S */ public String getChannel() { - return channel; - } - - /** - * Sets the name of the channel. - * - * @param channel the name of the channel. - */ - public void setChannel(String channel) - { - this.channel = channel; + return (String) request.get("channel"); } /** @@ -189,17 +188,7 @@ public class AGIRequestImpl implements S */ public String getUniqueId() { - return uniqueId; - } - - /** - * Sets the unqiue id of the channel. - * - * @param uniqueId the unqiue id of the channel. - */ - public void setUniqueId(String uniqueId) - { - this.uniqueId = uniqueId; + return (String) request.get("uniqueid"); } /** @@ -209,17 +198,7 @@ public class AGIRequestImpl implements S */ public String getType() { - return type; - } - - /** - * Sets the type of the channel, for example "SIP". - * - * @param type the type of the channel, for example "SIP". - */ - public void setType(String type) - { - this.type = type; + return (String) request.get("type"); } /** @@ -229,77 +208,85 @@ public class AGIRequestImpl implements S */ public String getLanguage() { - return language; + return (String) request.get("language"); } - /** - * Sets the language, for example "en". - * - * @param language the language, for example "en". - */ - public void setLanguage(String language) - { - this.language = language; - } + private boolean callerIdCreated; - /** - * Returns the Caller*ID, for example "1234". - * - * @return the Caller*ID, for example "1234". - */ public String getCallerId() { - return callerId; - } + int lbPosition; + int rbPosition; - /** - * Sets the Caller*ID, for example "1234". - * - * @param callerId the Caller*ID, for example "1234". - */ - public void setCallerId(String callerId) - { - this.callerId = callerId; + if (!callerIdCreated) + { + rawCallerId = (String) request.get("callerid"); + callerIdCreated = true; + } + + if (rawCallerId == null) + { + return null; + } + + lbPosition = rawCallerId.indexOf('<'); + rbPosition = rawCallerId.indexOf('>'); + + if (lbPosition < 0 || rbPosition < 0) + { + return rawCallerId; + } + + return rawCallerId.substring(lbPosition + 1, rbPosition); } - /** - * Returns the the Caller*ID Name, for example "John Doe". - * - * @return the the Caller*ID Name, for example "John Doe". - */ public String getCallerIdName() { - return callerIdName; - } + int lbPosition; + String callerIdName; - /** - * Sets the the Caller*ID Name, for example "John Doe". - * - * @param callerIdName the the Caller*ID Name, for example "John Doe". - */ - public void setCallerIdName(String callerIdName) - { - this.callerIdName = callerIdName; - } + if (!callerIdCreated) + { + rawCallerId = (String) request.get("callerid"); + callerIdCreated = true; + } + + if (rawCallerId == null) + { + return null; + } - public String getDnid() - { - return dnid; - } + lbPosition = rawCallerId.indexOf('<'); - public void setDnid(String dnid) - { - this.dnid = dnid; + if (lbPosition < 0) + { + return null; + } + + callerIdName = rawCallerId.substring(0, lbPosition).trim(); + if (callerIdName.startsWith("\"") && callerIdName.endsWith("\"")) + { + callerIdName = callerIdName.substring(1, callerIdName.length() - 1); + } + + if (callerIdName.length() == 0) + { + return null; + } + else + { + return callerIdName; + } } - public String getRdnis() + public String getDnid() { - return rdnis; + return (String) request.get("dnid"); } - public void setRdnis(String rdnis) + public String getRdnis() { - this.rdnis = rdnis; + return (String) request.get("rdnis"); } /** @@ -311,18 +298,7 @@ public class AGIRequestImpl implements S */ public String getContext() { - return context; - } - - /** - * 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. - */ - public void setContext(String context) - { - this.context = context; + return (String) request.get("context"); } /** @@ -334,18 +310,7 @@ public class AGIRequestImpl implements S */ public String getExtension() { - return extension; - } - - /** - * 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. - */ - public void setExtension(String extension) - { - this.extension = extension; + return (String) request.get("extension"); } /** @@ -357,18 +322,11 @@ public class AGIRequestImpl implements S */ public Integer getPriority() { - return priority; - } - - /** - * 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. - */ - public void setPriority(Integer priority) - { - this.priority = priority; + if (request.get("priority") != null) + { + return new Integer((String) request.get("priority")); + } + return null; } /** @@ -380,18 +338,18 @@ public class AGIRequestImpl implements S */ public Boolean getEnhanced() { - return enhanced; - } - - /** - * Sets wheather this agi is passed audio. - * - * @param enhanced Boolean.TRUE if this agi is passed audio, Boolean.FALSE - * otherwise. - */ - public void setEnhanced(Boolean enhanced) - { - this.enhanced = enhanced; + if (request.get("enhanced") != null) + { + if ("1.0".equals((String) request.get("enhanced"))) + { + return Boolean.TRUE; + } + else + { + return Boolean.FALSE; + } + } + return null; } /** @@ -401,17 +359,7 @@ public class AGIRequestImpl implements S */ public String getAccountCode() { - return accountCode; - } - - /** - * Sets the account code set for the call. - * - * @param accountCode the account code set for the call. - */ - public void setAccountCode(String accountCode) - { - this.accountCode = accountCode; + return (String) request.get("accountCode"); } public String getParameter(String name) @@ -430,7 +378,7 @@ public class AGIRequestImpl implements S public String[] getParameterValues(String name) { - if (parameterMap == null) + if (getParameterMap().isEmpty()) { return null; } @@ -442,15 +390,78 @@ public class AGIRequestImpl implements S { if (parameterMap == null) { - parameterMap = new HashMap(); + parameterMap = parseParameters(parameters); } - return parameterMap; } - - public void setParameterMap(Map parameterMap) + + private String parameters; + private String script; + + private Map parseParameters(String s) { - this.parameterMap = parameterMap; + Map parameterMap; + Map result; + Iterator parameterIterator; + StringTokenizer st; + + parameterMap = new HashMap(); + if (s == null) + { + return parameterMap; + } + + st = new StringTokenizer(s, "&"); + while (st.hasMoreTokens()) + { + String parameter; + Matcher parameterMatcher; + String name; + String value; + List values; + + parameter = st.nextToken(); + parameterMatcher = PARAMETER_PATTERN.matcher(parameter); + if (parameterMatcher.matches()) + { + name = URLDecoder.decode(parameterMatcher.group(1)); + value = URLDecoder.decode(parameterMatcher.group(2)); + } + else + { + name = URLDecoder.decode(parameter); + value = ""; + } + + if (parameterMap.get(name) == null) + { + values = new ArrayList(); + values.add(value); + parameterMap.put(name, values); + } + else + { + values = (List) parameterMap.get(name); + values.add(value); + } + } + + result = new HashMap(); + parameterIterator = parameterMap.keySet().iterator(); + while (parameterIterator.hasNext()) + { + String name; + List values; + String[] valueArray; + + name = (String) parameterIterator.next(); + values = (List) parameterMap.get(name); + + valueArray = new String[values.size()]; + result.put(name, values.toArray(valueArray)); + } + + return result; } public String toString() --- RequestBuilderImpl.java DELETED --- --- ReplyBuilderImpl.java DELETED --- |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:11
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/java/net/sf/asterisk/manager/impl Modified Files: ManagerReaderImpl.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: ManagerReaderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/impl/ManagerReaderImpl.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ManagerReaderImpl.java 31 Mar 2005 22:29:52 -0000 1.3 +++ ManagerReaderImpl.java 15 Apr 2005 04:47:01 -0000 1.4 @@ -24,7 +24,6 @@ import java.util.Map; import net.sf.asterisk.io.SocketConnectionFacade; import net.sf.asterisk.manager.AsteriskServer; -import net.sf.asterisk.manager.DefaultManagerConnection; import net.sf.asterisk.manager.Dispatcher; import net.sf.asterisk.manager.EventBuilder; import net.sf.asterisk.manager.ManagerReader; |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:10
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/xdocs Modified Files: index.xml Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -p -r1.12 -r1.13 --- index.xml 10 Apr 2005 10:26:42 -0000 1.12 +++ index.xml 15 Apr 2005 04:47:00 -0000 1.13 @@ -20,7 +20,7 @@ <document> <properties> <author email="srt at users.sourceforge.net">Stefan Reuter</author> - <title>The Asterisk-java Library</title> + <title>Java control for Asterisk PBXes</title> </properties> <meta name="keywords" content="Asterisk,asterisk,Java,java,Manager API,FastAGI,AGI"/> <body> |
From: Stefan R. <sr...@us...> - 2005-04-15 04:47:10
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16598/src/java/net/sf/asterisk/fastagi/reply/impl Added Files: package.html AGIReplyImpl.java Log Message: - Moved funcitonality of ReplyBuilder and RequestBuilder to AGIReplyImpl and AGIRequestImpl (thanks to Steve Drach for providing this patch) - Removed ReplyBuilde and RequestBuilder - Refactored Reply into interface and implementation --- NEW FILE: package.html --- <html> <head> <!-- /* * 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. * */ --> </head> <body> <p>Provides private implementations for interfaces defined in the net.sf.asterisk.fastagi.reply package.</p> </body> </html> --- NEW FILE: AGIReplyImpl.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.reply.impl; import java.io.*; import java.util.*; import java.util.regex.*; import net.sf.asterisk.fastagi.reply.AGIReply; /** * Default implementation of the AGIReply interface. * * @author srt * @version $Id: AGIReplyImpl.java,v 1.1 2005/04/15 04:47:01 srt Exp $ */ public class AGIReplyImpl implements Serializable, AGIReply { private static final Pattern STATUS_PATTERN = Pattern .compile("^(\\d{3})[ -]"); private static final Pattern RESULT_PATTERN = Pattern .compile("^200 result=(\\S+)"); private static final Pattern PARENTHESIS_PATTERN = Pattern .compile("^200 result=\\S+ \\((.*)\\)"); private static final Pattern ADDITIONAL_ATTRIBUTES_PATTERN = Pattern .compile("^200 result=\\S+ (\\(.*\\) )?(.+)$"); private static final Pattern ADDITIONAL_ATTRIBUTE_PATTERN = Pattern .compile("(\\S+)=(\\S+)"); 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."; private Matcher matcher; /** * Serial version identifier. */ private static final long serialVersionUID = 3256727294671337012L; private List lines; private String firstLine; /** * The result, that is the part directly following the "result=" string. */ private String result; /** * The status code. */ private int status; /** * Additional attributes contained in this reply, for example endpos. */ private Map attributes; /** * The contents of the parenthesis. */ private String extra; /** * 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; public AGIReplyImpl() { } public AGIReplyImpl(List lines) { this.lines = lines; try { firstLine = (String) lines.get(0); } catch (Exception e) { } } public String getFirstLine() { return firstLine; } public List getLines() { return lines; } /** * Returns the return code (the result as int). * * @return the return code or -1 if the result is not an int. */ public int getResultCode() { String result; result = getResult(); if (result == null) { return -1; } try { return Integer.parseInt(result); } catch (NumberFormatException e) { return -1; } } /** * Returns the return code as character. * * @return the return code as character. */ public char getResultCodeAsChar() { int resultCode; resultCode = getResultCode(); if (resultCode < 0) { return 0x0; } return (char) resultCode; } private boolean resultCreated; /** * Returns the result, that is the part directly following the "result=" * string. * * @return the result. */ public String getResult() { if (resultCreated) { return result; } matcher = RESULT_PATTERN.matcher(firstLine); if (matcher.find()) { result = matcher.group(1); } resultCreated = true; return result; } private boolean statusCreated; /** * Returns the status code.<br> * Supported status codes are: * <ul> * <li>200 Success * <li>510 Invalid or unknown command * <li>520 Invalid command syntax * </ul> * * @return the status code. */ public int getStatus() { if (statusCreated) { return status; } matcher = STATUS_PATTERN.matcher(firstLine); if (matcher.find()) { status = Integer.parseInt(matcher.group(1)); } statusCreated = true; return status; } private boolean attributesCreated; /** * Returns an additional attribute contained in the reply.<br> * For example the reply to the StreamFileCommand contains an additional * endpos attribute indicating the frame where the playback was stopped. * This can be retrieved by calling getAttribute("endpos") on the * corresponding reply. * * @param name the name of the attribute to retrieve. The name is case * insensitive. * @return the value of the attribute or <code>null</code> if it is not * set. */ public String getAttribute(String name) { if (getStatus() != SC_SUCCESS) { return null; } if ("result".equalsIgnoreCase(name)) { return getResult(); } if (!attributesCreated) { matcher = ADDITIONAL_ATTRIBUTES_PATTERN.matcher(firstLine); if (matcher.find()) { String s; Matcher attributeMatcher; attributes = new HashMap(); s = matcher.group(2); attributeMatcher = ADDITIONAL_ATTRIBUTE_PATTERN.matcher(s); while (attributeMatcher.find()) { String key; String value; key = attributeMatcher.group(1); value = attributeMatcher.group(2); attributes.put(key.toLowerCase(), value); } } attributesCreated = true; } if (attributes == null || attributes.isEmpty()) { return null; } return (String) attributes.get(name.toLowerCase()); } private boolean extraCreated; /** * Returns the text in parenthesis contained in this reply.<br> * The meaning of this property depends on the command sent. Sometimes it * contains a flag like "timeout" or "hangup" or - in case of the * GetVariableCommand - the value of the variable. * * @return the text in the parenthesis or <code>null</code> if not set. */ public String getExtra() { if (getStatus() != SC_SUCCESS) { return null; } if (extraCreated) { return extra; } matcher = PARENTHESIS_PATTERN.matcher(firstLine); if (matcher.find()) { extra = matcher.group(1); } extraCreated = true; return extra; } private boolean synopsisCreated; /** * 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. */ public String getSynopsis() { if (getStatus() != SC_INVALID_COMMAND_SYNTAX) { return null; } if (!synopsisCreated) { StringBuffer usageSB; if (lines.size() > 1) { String secondLine; Matcher synopsisMatcher; secondLine = (String) lines.get(1); synopsisMatcher = SYNOPSIS_PATTERN.matcher(secondLine); if (synopsisMatcher.find()) { synopsis = synopsisMatcher.group(1); } } synopsisCreated = true; 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(" "); } usage = usageSB.toString().trim(); } return 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() { return usage; } public String toString() { StringBuffer sb; sb = new StringBuffer(getClass().getName() + ": "); sb.append("status='" + getStatus() + "'; "); if (status == SC_SUCCESS) { sb.append("result='" + getResult() + "'; "); sb.append("extra='" + getExtra() + "'; "); sb.append("attributes=" + attributes + "; "); } if (status == SC_INVALID_COMMAND_SYNTAX) { sb.append("synopsis='" + getSynopsis() + "'; "); } sb.append("systemHashcode=" + System.identityHashCode(this)); return sb.toString(); } } |
From: Stefan R. <sr...@us...> - 2005-04-15 04:19:44
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1151/src/java/net/sf/asterisk/fastagi/reply/impl Log Message: Directory /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/reply/impl added to the repository |
From: Stefan R. <sr...@us...> - 2005-04-15 04:19:42
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/reply In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1151/src/test/net/sf/asterisk/fastagi/reply Log Message: Directory /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/reply added to the repository |
From: Stefan R. <sr...@us...> - 2005-04-15 04:19:42
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/reply/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1151/src/test/net/sf/asterisk/fastagi/reply/impl Log Message: Directory /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/fastagi/reply/impl added to the repository |
From: Stefan R. <sr...@us...> - 2005-04-11 22:05:19
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29012/src/java/net/sf/asterisk/fastagi/impl Modified Files: RequestBuilderImpl.java Log Message: Changed SCRIPT_PATTERN to not match the empty string before the question mark. Changed PARAMETER_PATTERN to not match the empty string before the equal sign. Thanks to Steve Drach for suggesting these changes. Index: RequestBuilderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl/RequestBuilderImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- RequestBuilderImpl.java 6 Apr 2005 18:58:59 -0000 1.2 +++ RequestBuilderImpl.java 11 Apr 2005 22:05:10 -0000 1.3 @@ -39,9 +39,9 @@ import net.sf.asterisk.fastagi.RequestBu public class RequestBuilderImpl implements RequestBuilder { private static final Pattern SCRIPT_PATTERN = Pattern - .compile("^([^\\?]*)\\?(.*)$"); + .compile("^([^\\?]+)\\?(.*)$"); private static final Pattern PARAMETER_PATTERN = Pattern - .compile("^(.*)=(.*)$"); + .compile("^(.+)=(.*)$"); /** * Creates a new AGIRequestBuilderImpl. |
From: Stefan R. <sr...@us...> - 2005-04-10 10:26:52
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4214/xdocs Modified Files: index.xml Log Message: Updated status: Added note about GJTAPI implementation. Updated download: Changed order (official releases is now at the top) Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -p -r1.11 -r1.12 --- index.xml 9 Apr 2005 11:54:47 -0000 1.11 +++ index.xml 10 Apr 2005 10:26:42 -0000 1.12 @@ -53,29 +53,38 @@ License, Version 2.0</a>.</p> </subsection> <subsection name="Status"> - <p>I am currently preparing the first release of asterisk-java. It will probably - be available by the end of april. Meanwhile you can try it out by accessing - the code base in cvs (see below).</p> + <p>I am currently preparing the first release of Asterisk-java. + It will probably be available by the end of april. + Meanwhile you can try out a release candidate available + from the <a + href="http://sourceforge.net/projects/asterisk-java/">sourceforge + project page</a>.</p> <p>Ideas for the future include a stateful higher level API that supports operations like "get list of currently active calls" or "place call" with objects like "Call" or "Channel" that are transparently updated as the state of the corresponding object within the asterisk server - changes.</p> + changes. An option is to provide an implementation of the + <a href="http://java.sun.com/products/jtapi/">Java + Telephony API (JTAPI)</a> based on the + <a href="http://gjtapi.sourceforge.net/">Generic JTAPI and + JCC Project (GJTAPI)</a>.</p> </subsection> <subsection name="Download"> - <p>Asterisk-java is available via cvs from sourcforge:</p> + <p>Official releases and release candidates are available on the <a + href="http://sourceforge.net/projects/asterisk-java/">sourceforge + project page</a>.</p> + <p>You can also download a + <a href="http://maven.reucon.com/maven/asterisk-java/distributions/">snapshot</a>.</p> + <p>Please feel free to provide any feedback or ask for support via the + <a href="mail-lists.html">Asterisk-java user's mailing list</a>.</p> + <p>Asterisk-java is also available via cvs from sourcforge:</p> <source><![CDATA[ cvs -d:pserver:ano...@cv...:/cvsroot/asterisk-java login cvs -z3 -d:pserver:ano...@cv...:/cvsroot/asterisk-java co asterisk-java ]]></source> <p>When prompted for a password for <i>anonymous</i>, simply press the Enter key.</p> - <p>Official releases and release candidates are available on the <a - href="http://sourceforge.net/projects/asterisk-java/">sourceforge - project page</a>.</p> - <p>You can also download a - <a href="http://maven.reucon.com/maven/asterisk-java/distributions/">snapshot</a>.</p> </subsection> <subsection name="Related Projects"> <p><a href="http://tanesha.net/Wiki/JastAgi.html">Jast Agi</a> |
From: Stefan R. <sr...@us...> - 2005-04-10 07:44:58
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15403/src/java/net/sf/asterisk/fastagi/command Modified Files: ExecCommand.java Log Message: Fixed setApplication: no longer sets options to null. Index: ExecCommand.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/ExecCommand.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- ExecCommand.java 10 Mar 2005 21:48:11 -0000 1.3 +++ ExecCommand.java 10 Apr 2005 07:44:48 -0000 1.4 @@ -18,8 +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 if the application was not + * found. * * @author srt * @version $Id$ @@ -81,7 +81,6 @@ public class ExecCommand extends AGIComm public void setApplication(String application) { this.application = application; - this.options = null; } /** |
From: Stefan R. <sr...@us...> - 2005-04-09 11:55:00
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7381/xdocs Modified Files: index.xml Log Message: Added download location for official releases and release candidates. Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -p -r1.10 -r1.11 --- index.xml 16 Mar 2005 12:11:14 -0000 1.10 +++ index.xml 9 Apr 2005 11:54:47 -0000 1.11 @@ -71,7 +71,7 @@ cvs -z3 -d:pserver:ano...@cv...urcef ]]></source> <p>When prompted for a password for <i>anonymous</i>, simply press the Enter key.</p> - <p>More information is available on the <a + <p>Official releases and release candidates are available on the <a href="http://sourceforge.net/projects/asterisk-java/">sourceforge project page</a>.</p> <p>You can also download a |
From: Stefan R. <sr...@us...> - 2005-04-09 11:55:00
|
Update of /cvsroot/asterisk-java/asterisk-java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7381 Modified Files: project.xml Log Message: Added download location for official releases and release candidates. Index: project.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/project.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -p -r1.11 -r1.12 --- project.xml 9 Apr 2005 10:23:46 -0000 1.11 +++ project.xml 9 Apr 2005 11:54:47 -0000 1.12 @@ -53,8 +53,8 @@ </repository> <versions> <version> - <id>b1</id> - <name>0.1-b1</name> + <id>0.1-SNAPSHOT</id> + <name>0.1-SNAPSHOT</name> <tag>HEAD</tag> </version> <version> |
From: Stefan R. <sr...@us...> - 2005-04-09 10:23:56
|
Update of /cvsroot/asterisk-java/asterisk-java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24262 Modified Files: project.xml Log Message: [maven-scm-plugin] prepare release 0.1-rc1 Index: project.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/project.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -p -r1.10 -r1.11 --- project.xml 13 Mar 2005 11:26:48 -0000 1.10 +++ project.xml 9 Apr 2005 10:23:46 -0000 1.11 @@ -1,141 +1,144 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project> - <pomVersion>3</pomVersion> - <artifactId>asterisk-java</artifactId> - <groupId>asterisk-java</groupId> - <licenses> - <license> - <name>Apache License, Version 2.0</name> - <url>http://www.apache.org/licenses/LICENSE-2.0</url> - </license> - </licenses> - <reports> - <report>maven-clover-plugin</report> - <report>maven-jdepend-plugin</report> - <report>maven-junit-report-plugin</report> - <report>maven-license-plugin</report> - <report>maven-linkcheck-plugin</report> - <report>maven-statcvs-plugin</report> - <report>maven-jxr-plugin</report> - <report>maven-changelog-plugin</report> - <report>maven-changes-plugin</report> - <report>maven-developer-activity-plugin</report> - <report>maven-file-activity-plugin</report> - <report>maven-javadoc-plugin</report> - <report>maven-checkstyle-plugin</report> - <report>maven-pmd-plugin</report> - </reports> - <id>asterisk-java</id> - <name>asterisk-java</name> - <currentVersion>0.1-SNAPSHOT</currentVersion> - <organization> - <name>Stefan Reuter</name> - <url>http://sourceforge.net/projects/asterisk-java/</url> - <logo>http://sourceforge.net/sflogo.php?group_id=118998&type=5</logo> - </organization> - <inceptionYear>2004</inceptionYear> - <package>net.sf.asterisk</package> - <!-- Gump integration --> - <gumpRepositoryId>asterisk-java</gumpRepositoryId> - <description> - Asterisk-java consists of a set of Java classes that allow you - to control an Asterisk PBX via Asterisk's Manager API - from Java applications. - </description> - <shortDescription>Java Connector for Asterisk PBX</shortDescription> - <url>http://asterisk-java.sourceforge.net/</url> - <siteAddress>shell.sourceforge.net</siteAddress> - <siteDirectory>/home/groups/a/as/asterisk-java/htdocs</siteDirectory> - <distributionSite>shell.sourceforge.net</distributionSite> - <distributionDirectory>/home/groups/a/as/asterisk-java/htdocs/maven</distributionDirectory> - <repository> - <connection>scm:cvs:pserver:ano...@cv...:/cvsroot/asterisk-java:asterisk-java</connection> - <developerConnection>scm:cvs:ext:${maven.username}@cvs1.sourceforge.net:/cvsroot/asterisk-java:asterisk-java</developerConnection> - <url>http://cvs.sourceforge.net/viewcvs.py/asterisk-java/asterisk-java/</url> - </repository> - <versions> - <version> - <id>b1</id> - <name>0.1-b1</name> - <tag>HEAD</tag> - </version> - </versions> - <mailingLists> - <mailingList> - <name>Asterisk-java User List</name> - <subscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-users</subscribe> - <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-users</unsubscribe> - <archive>http://sourceforge.net/mailarchive/forum.php?forum=asterisk-java-users</archive> - </mailingList> - <mailingList> - <name>Asterisk-java Developer List</name> - <subscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-devel</subscribe> - <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-devel</unsubscribe> - <archive>http://sourceforge.net/mailarchive/forum.php?forum=asterisk-java-devel</archive> - </mailingList> - <mailingList> - <name>Asterisk-java CVS Commit List</name> - <subscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-cvs</subscribe> - <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-cvs</unsubscribe> - <archive>http://sourceforge.net/mailarchive/forum.php?forum=asterisk-java-cvs</archive> - </mailingList> - </mailingLists> - <developers> - <developer> - <name>Stefan Reuter</name> - <id>srt</id> - <email>srt at users.sourceforge.net</email> - <timezone>+1</timezone> - </developer> - <developer> - <name>Pierre-Yves Roger</name> - <id>partoutatis</id> - <email>partoutatis at users.sourceforge.net</email> - <timezone>+1</timezone> - </developer> - <developer> - <name>John Hood</name> - <id>squinky86</id> - <email>john at asteriasgi.com</email> - <organization>Asteria Soulutions Group, Inc.</organization> - <timezone>-6</timezone> - </developer> - </developers> - <dependencies> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.0.3</version> - <type>jar</type> - <url>http://jakarta.apache.org/commons/logging/</url> - </dependency> - <dependency> - <groupId>easymock</groupId> - <artifactId>easymock</artifactId> - <version>1.1</version> - <type>jar</type> - <url>http://www.easymock.org/</url> - </dependency> - </dependencies> - <build> - <nagEmailAddress>sr...@re...</nagEmailAddress> - <sourceDirectory>src/java</sourceDirectory> - <unitTestSourceDirectory>src/test</unitTestSourceDirectory> - <!-- Unit test cases --> - <unitTest> - <includes> - <include>**/*Test.java</include> - </includes> - <resources> - <resource> - <directory>${basedir}/src/resources/fastagi</directory> - <includes> - <include>test-mapping.properties</include> - </includes> - <filtering>false</filtering> - </resource> - </resources> - </unitTest> - </build> -</project> - +<?xml version="1.0" encoding="UTF-8"?> + +<project> + <pomVersion>3</pomVersion> + <artifactId>asterisk-java</artifactId> + <groupId>asterisk-java</groupId> + <licenses> + <license> + <name>Apache License, Version 2.0</name> + <url>http://www.apache.org/licenses/LICENSE-2.0</url> + </license> + </licenses> + <reports> + <report>maven-clover-plugin</report> + <report>maven-jdepend-plugin</report> + <report>maven-junit-report-plugin</report> + <report>maven-license-plugin</report> + <report>maven-linkcheck-plugin</report> + <report>maven-statcvs-plugin</report> + <report>maven-jxr-plugin</report> + <report>maven-changelog-plugin</report> + <report>maven-changes-plugin</report> + <report>maven-developer-activity-plugin</report> + <report>maven-file-activity-plugin</report> + <report>maven-javadoc-plugin</report> + <report>maven-checkstyle-plugin</report> + <report>maven-pmd-plugin</report> + </reports> + <id>asterisk-java</id> + <name>asterisk-java</name> + <currentVersion>0.1-rc1</currentVersion> + <organization> + <name>Stefan Reuter</name> + <url>http://sourceforge.net/projects/asterisk-java/</url> + <logo>http://sourceforge.net/sflogo.php?group_id=118998&type=5</logo> + </organization> + <inceptionYear>2004</inceptionYear> + <package>net.sf.asterisk</package> + <!-- Gump integration --> + + <gumpRepositoryId>asterisk-java</gumpRepositoryId> + <description>Asterisk-java consists of a set of Java classes that allow you to control an Asterisk PBX via Asterisk's Manager API from Java applications.</description> + <shortDescription>Java Connector for Asterisk PBX</shortDescription> + <url>http://asterisk-java.sourceforge.net/</url> + <siteAddress>shell.sourceforge.net</siteAddress> + <siteDirectory>/home/groups/a/as/asterisk-java/htdocs</siteDirectory> + <distributionSite>shell.sourceforge.net</distributionSite> + <distributionDirectory>/home/groups/a/as/asterisk-java/htdocs/maven</distributionDirectory> + <repository> + <connection>scm:cvs:pserver:ano...@cv...:/cvsroot/asterisk-java:asterisk-java</connection> + <developerConnection>scm:cvs:ext:${maven.username}@cvs1.sourceforge.net:/cvsroot/asterisk-java:asterisk-java</developerConnection> + <url>http://cvs.sourceforge.net/viewcvs.py/asterisk-java/asterisk-java/</url> + </repository> + <versions> + <version> + <id>b1</id> + <name>0.1-b1</name> + <tag>HEAD</tag> + </version> + <version> + <id>0.1-rc1</id> + <name>0.1-rc1</name> + <tag>RC_0_1_1</tag> + </version> + </versions> + <mailingLists> + <mailingList> + <name>Asterisk-java User List</name> + <subscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-users</subscribe> + <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-users</unsubscribe> + <archive>http://sourceforge.net/mailarchive/forum.php?forum=asterisk-java-users</archive> + </mailingList> + <mailingList> + <name>Asterisk-java Developer List</name> + <subscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-devel</subscribe> + <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-devel</unsubscribe> + <archive>http://sourceforge.net/mailarchive/forum.php?forum=asterisk-java-devel</archive> + </mailingList> + <mailingList> + <name>Asterisk-java CVS Commit List</name> + <subscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-cvs</subscribe> + <unsubscribe>http://lists.sourceforge.net/mailman/listinfo/asterisk-java-cvs</unsubscribe> + <archive>http://sourceforge.net/mailarchive/forum.php?forum=asterisk-java-cvs</archive> + </mailingList> + </mailingLists> + <developers> + <developer> + <name>Stefan Reuter</name> + <id>srt</id> + <email>srt at users.sourceforge.net</email> + <timezone>+1</timezone> + </developer> + <developer> + <name>Pierre-Yves Roger</name> + <id>partoutatis</id> + <email>partoutatis at users.sourceforge.net</email> + <timezone>+1</timezone> + </developer> + <developer> + <name>John Hood</name> + <id>squinky86</id> + <email>john at asteriasgi.com</email> + <organization>Asteria Soulutions Group, Inc.</organization> + <timezone>-6</timezone> + </developer> + </developers> + <dependencies> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.0.3</version> + <type>jar</type> + <url>http://jakarta.apache.org/commons/logging/</url> + </dependency> + <dependency> + <groupId>easymock</groupId> + <artifactId>easymock</artifactId> + <version>1.1</version> + <type>jar</type> + <url>http://www.easymock.org/</url> + </dependency> + </dependencies> + <build> + <nagEmailAddress>sr...@re...</nagEmailAddress> + <sourceDirectory>src/java</sourceDirectory> + <unitTestSourceDirectory>src/test</unitTestSourceDirectory> + <!-- Unit test cases --> + + <unitTest> + <includes> + <include>**/*Test.java</include> + </includes> + <resources> + <resource> + <directory>${basedir}/src/resources/fastagi</directory> + <includes> + <include>test-mapping.properties</include> + </includes> + <filtering>false</filtering> + </resource> + </resources> + </unitTest> + </build> +</project> |
From: Stefan R. <sr...@us...> - 2005-04-07 00:04:15
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29847/src/java/net/sf/asterisk/fastagi/command Modified Files: package.html Log Message: Fixed spelling Index: package.html =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/command/package.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- package.html 6 Apr 2005 23:06:00 -0000 1.1 +++ package.html 7 Apr 2005 00:04:06 -0000 1.2 @@ -21,7 +21,7 @@ </head> <body> -<p>Provides classes that represent the standard command that can be sent +<p>Provides classes that represent the standard commands that can be sent to an Asterisk server via the FastAGI.</p> </body> |
From: Stefan R. <sr...@us...> - 2005-04-06 23:07:18
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30351/xdocs Modified Files: tutorial.xml Log Message: Added note on how to pass parameters to an AGIScript. Index: tutorial.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/tutorial.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- tutorial.xml 16 Mar 2005 10:52:11 -0000 1.8 +++ tutorial.xml 6 Apr 2005 23:07:02 -0000 1.9 @@ -137,6 +137,18 @@ INFO: End AGIScript HelloAGIScript on AG own commands you can also use the <a href="apidocs/net/sf/asterisk/fastagi/AGIChannel.html">channel</a>.sendCommand(<a href="apidocs/net/sf/asterisk/fastagi/AGICommand.html">AGICommand</a>) method to send arbitrary commands.</p> + <p>You can pass parameters to your scripts by including them in the URL used with + the AGI command. These parameters can be read by the getParameter(String) and + getParameterValues(String) methods in + <a href="apidocs/net/sf/asterisk/fastagi/AGIRequest.html">AGIRequest</a>.</p> + <p>If you want to pass a parameter named user with a value of "john" to your + script called hello.agi running on localhost your call to the AGI application + looks like this:</p> +<source><![CDATA[ +exten => 1300,1,Agi(agi://localhost/hello.agi?user=john) +]]></source> + <p>You can also pass multiple parameters. Parameters containing special characters + must be URL encoded.</p> <p>If you are about to write more complex scripts please note that your AGIScript must be threadsafe. Only one instance will be used to serve all requests. This is kind of similar to the constraints a servlet engine places on the |
From: Stefan R. <sr...@us...> - 2005-04-06 23:06:10
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29616/src/java/net/sf/asterisk/util Added Files: package.html Log Message: Added package level documentation. --- NEW FILE: package.html --- <html> <head> <!-- /* * 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. * */ --> </head> <body> <p>Provides various utility classes used throughout the library.</p> </body> </html> |
From: Stefan R. <sr...@us...> - 2005-04-06 23:06:10
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29616/src/java/net/sf/asterisk/manager Added Files: package.html Log Message: Added package level documentation. --- NEW FILE: package.html --- <html> <head> <!-- /* * 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. * */ --> </head> <body> <p>Provides an implementaion of Asterisk's Manager API.</p> </body> </html> |
From: Stefan R. <sr...@us...> - 2005-04-06 23:06:10
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29616/src/java/net/sf/asterisk/manager/action Added Files: package.html Log Message: Added package level documentation. --- NEW FILE: package.html --- <html> <head> <!-- /* * 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. * */ --> </head> <body> <p>Provides classes that represent the standard actions that can be sent to an Asterisk server via the Manager API.</p> </body> </html> |
From: Stefan R. <sr...@us...> - 2005-04-06 23:06:10
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29616/src/java/net/sf/asterisk/fastagi/impl Added Files: package.html Log Message: Added package level documentation. --- NEW FILE: package.html --- <html> <head> <!-- /* * 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. * */ --> </head> <body> <p>Provides private implementations for interfaces defined in the net.sf.asterisk.fastagi package.</p> </body> </html> |