asterisk-java-cvs Mailing List for Asterisk-Java Library (Page 81)
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
(2) |
Nov
|
Dec
|
From: Stefan R. <sr...@us...> - 2005-07-26 14:17:00
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4856/xdocs Modified Files: index.xml Log Message: Fixed spelling / wording Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -p -r1.21 -r1.22 --- index.xml 26 Jul 2005 13:14:01 -0000 1.21 +++ index.xml 26 Jul 2005 14:16:51 -0000 1.22 @@ -105,8 +105,8 @@ cvs -z3 -d:pserver:ano...@cv...urcef <subsection name="Related Projects"> <p><a href="http://adm.hamnett.org/">Asterisk Desktop Manageer</a>, or ADM for short, brings the power of Asterisk to the user's desktop. It - is written in Java, uses the Eclipse SWT library and is based on - Asterisk-Java.<br/> + is written in Java, uses the Eclipse SWT library for its GUI and + Asterisk-Java to provide Asterisk connectivity.<br/> Available under the GNU General Public License (GPL). </p> <p><a href="http://www3.mb.sympatico.ca/~chadk/">Asterisk-Java for Mono/.NET</a> @@ -152,7 +152,7 @@ cvs -z3 -d:pserver:ano...@cv...urcef <a href="http://www.cenqua.com/fisheye/">FishEye</a>.</p> <p>ej-technologies for providing free licenses of <a href="http://www.ej-technologies.com/products/jprofiler/overview.html">JProfiler</a> - and <a href="http://www.ej-technologies.com/products/install4j/overview.html">jnstall4j</a>.</p> + and <a href="http://www.ej-technologies.com/products/install4j/overview.html">install4j</a>.</p> </subsection> <subsection name="Contact"> <p>You can reach me at <code>srt</code> at <code>reucon</code> dot <code>net</code></p>. </subsection> |
From: Stefan R. <sr...@us...> - 2005-07-26 13:14:14
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22108/xdocs Modified Files: index.xml Log Message: Added sponsors section Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -p -r1.20 -r1.21 --- index.xml 26 Jul 2005 09:03:59 -0000 1.20 +++ index.xml 26 Jul 2005 13:14:01 -0000 1.21 @@ -143,6 +143,17 @@ cvs -z3 -d:pserver:ano...@cv...urcef integration at the Thread level.<br/> Available under GNU General Public License.</p> </subsection> + <subsection name="Sponsors"> + <p>Thanks to our sponsors:</p> + <p><a href="http://www.sourceforge.net">Sourceforge.net</a> for hosting + the development infrastructure for Asterisk-Java.</p> + <p>Cenqua for providing free licenses + of <a href="http://www.cenqua.com/clover/">Clover</a> and + <a href="http://www.cenqua.com/fisheye/">FishEye</a>.</p> + <p>ej-technologies for providing free licenses + of <a href="http://www.ej-technologies.com/products/jprofiler/overview.html">JProfiler</a> + and <a href="http://www.ej-technologies.com/products/install4j/overview.html">jnstall4j</a>.</p> + </subsection> <subsection name="Contact"> <p>You can reach me at <code>srt</code> at <code>reucon</code> dot <code>net</code></p>. </subsection> </section> |
From: Stefan R. <sr...@us...> - 2005-07-26 12:16:16
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9383/src/java/net/sf/asterisk/manager/impl Modified Files: EventBuilderImpl.java Log Message: Fixed String to Boolean conversion in EventBuilder Index: EventBuilderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/impl/EventBuilderImpl.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- EventBuilderImpl.java 18 Jul 2005 14:53:08 -0000 1.8 +++ EventBuilderImpl.java 26 Jul 2005 12:16:02 -0000 1.9 @@ -75,6 +75,7 @@ import net.sf.asterisk.manager.event.Use import net.sf.asterisk.manager.event.ZapShowChannelsCompleteEvent; import net.sf.asterisk.manager.event.ZapShowChannelsEvent; +import net.sf.asterisk.util.AstUtil; import net.sf.asterisk.util.Log; import net.sf.asterisk.util.LogFactory; @@ -313,17 +314,7 @@ public class EventBuilderImpl implements if (dataType == Boolean.class) { - String tmp; - - tmp = (String) attributes.get(name); - if (tmp != null && ("yes".equalsIgnoreCase(tmp) || "true".equalsIgnoreCase(tmp))) - { - value = Boolean.TRUE; - } - else - { - value = Boolean.FALSE; - } + value = new Boolean(AstUtil.isTrue((String) attributes.get(name))); } else if (dataType.isAssignableFrom(String.class)) { |
From: Stefan R. <sr...@us...> - 2005-07-26 12:16:16
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9383/src/java/net/sf/asterisk/util Added Files: AstUtil.java Log Message: Fixed String to Boolean conversion in EventBuilder --- NEW FILE: AstUtil.java --- package net.sf.asterisk.util; /** * Some static utility methods to handle Asterisk specific stuff.<br> * See Asterisk's <code>util.c</code>. * * @author srt * @version $Id: AstUtil.java,v 1.1 2005/07/26 12:16:03 srt Exp $ */ public class AstUtil { // hide constructor private AstUtil() { } /** * Checks if a String represents <code>true</code> or <code>false</code> * according to Asterisk's logic.<br> * The original implementation is <code>util.c</code> is as follows: * * <pre> * int ast_true(const char *s) * { * if (!s || ast_strlen_zero(s)) * return 0; * * if (!strcasecmp(s, "yes") || * !strcasecmp(s, "true") || * !strcasecmp(s, "y") || * !strcasecmp(s, "t") || * !strcasecmp(s, "1") || * !strcasecmp(s, "on")) * return -1; * * return 0; * } * </pre> * * @param s the String to check for <code>true</code>. * @return <code>true</code> if s represents <code>true</code>, * <code>false</code> otherwise. */ public static boolean isTrue(String s) { if (s == null || s.length() == 0) { return false; } if (("yes".equalsIgnoreCase(s) || "true".equalsIgnoreCase(s)) || "y".equalsIgnoreCase(s) || "t".equalsIgnoreCase(s) || "1".equalsIgnoreCase(s) || "on".equalsIgnoreCase(s)) { return true; } else { return false; } } } |
From: Stefan R. <sr...@us...> - 2005-07-26 11:37:57
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1942/src/java/net/sf/asterisk/manager Modified Files: DefaultAsteriskManager.java Log Message: Allow skipping of Queue initialization for faster startup on buggy, i.e. 1.0 Asterisk servers. Index: DefaultAsteriskManager.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/DefaultAsteriskManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -p -r1.9 -r1.10 --- DefaultAsteriskManager.java 24 Jul 2005 18:06:13 -0000 1.9 +++ DefaultAsteriskManager.java 26 Jul 2005 11:37:49 -0000 1.10 @@ -66,18 +66,28 @@ public class DefaultAsteriskManager private final Map channels; /** - * Sequence to track calls. + * A map of ACD queues by there name. */ - private int callSequence; - private final Map queues; + /** + * Creates a new instance. + */ public DefaultAsteriskManager() { this.channels = Collections.synchronizedMap(new HashMap()); this.queues = Collections.synchronizedMap(new HashMap()); } + /** + * Creates a new instance. + */ + public DefaultAsteriskManager(ManagerConnection connection) + { + this(); + this.connection = connection; + } + public void setManagerConnection(ManagerConnection connection) { this.connection = connection; @@ -86,10 +96,19 @@ public class DefaultAsteriskManager public void initialize() throws TimeoutException, IOException, AuthenticationFailedException { + initialize(false); + } + + public void initialize(boolean skipQueues) throws TimeoutException, + IOException, AuthenticationFailedException + { connection.login(); initializeChannels(); - initializeQueues(); + if (!skipQueues) + { + initializeQueues(); + } connection.addEventHandler(this); } @@ -251,6 +270,8 @@ public class DefaultAsteriskManager } } + /* Private helper methods */ + protected void addChannel(Channel channel) { channels.put(channel.getId(), channel); @@ -414,15 +435,18 @@ public class DefaultAsteriskManager */ private Channel getChannelByName(String name) { - // TODO must get unique Channel channel = null; - Iterator channelIterator = channels.values().iterator(); - while (channelIterator.hasNext()) + + synchronized (channels) { - Channel tmp = (Channel) channelIterator.next(); - if (tmp.getName() != null && tmp.getName().equals(name)) + Iterator channelIterator = channels.values().iterator(); + while (channelIterator.hasNext()) { - channel = tmp; + Channel tmp = (Channel) channelIterator.next(); + if (tmp.getName() != null && tmp.getName().equals(name)) + { + channel = tmp; + } } } return channel; |
From: Stefan R. <sr...@us...> - 2005-07-26 11:36:23
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1539/src/java/net/sf/asterisk/manager/event Modified Files: DialEvent.java Log Message: Added note to javadoc about default caller id values Index: DialEvent.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/event/DialEvent.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- DialEvent.java 10 Mar 2005 22:19:27 -0000 1.3 +++ DialEvent.java 26 Jul 2005 11:35:58 -0000 1.4 @@ -18,10 +18,12 @@ package net.sf.asterisk.manager.event; /** * A dial event is triggered whenever a phone attempts to dial someone.<br> - * This event is implemented in <code>apps/app_dial.c</code> + * This event is implemented in <code>apps/app_dial.c</code>.<br> + * Available since Asterisk 1.2. * * @author Asteria Solutions Group, Inc. <http://www.asteriasgi.com/> * @version $Id$ + * @since 0.2 */ public class DialEvent extends ManagerEvent { @@ -113,7 +115,7 @@ public class DialEvent extends ManagerEv /** * Returns the Caller*ID. * - * @return the Caller*ID. + * @return the Caller*ID or "<unknown>" if none has been set. */ public String getCallerId() { @@ -133,7 +135,7 @@ public class DialEvent extends ManagerEv /** * Returns the Caller*ID Name. * - * @return the Caller*ID Name. + * @return the Caller*ID Name or "<unknown>" if none has been set. */ public String getCallerIdName() { |
From: Stefan R. <sr...@us...> - 2005-07-26 10:04:10
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14666/src/java/net/sf/asterisk/manager/action Modified Files: OriginateAction.java Log Message: Added note about events being generated only if async == true Index: OriginateAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/OriginateAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- OriginateAction.java 16 Jul 2005 23:30:51 -0000 1.7 +++ OriginateAction.java 26 Jul 2005 10:04:00 -0000 1.8 @@ -1,301 +1,302 @@ -/* - * 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.manager.action; - -import net.sf.asterisk.manager.event.OriginateEvent; - -/** - * The OriginateAction generates an outgoing call to the extension in the given - * context with the given priority or to a given application with optional - * parameters.<br> - * If you want to connect to an extension use the properties context, exten and - * priority. If you want to connect to an application use the properties - * application and data if needed. Note that no call detail record will be - * written when directly connecting to an application, so it may be better to - * connect to an extension that starts the application you wish to connect to.<br> - * The response to this action is sent when the channel has been answered and - * asterisk starts connecting it to the given extension. So be careful not to - * choose a too short timeout when waiting for the response.<br> - * If the origination succeeds an OriginateSuccessEvent is generated, if it - * fails an OriginateFailureEvent is generated. The action id of these events - * equals the action id of this OriginateAction. - * - * @see net.sf.asterisk.manager.event.OriginateSuccessEvent - * @see net.sf.asterisk.manager.event.OriginateFailureEvent - * @author srt - * @version $Id$ - */ -public class OriginateAction extends AbstractManagerAction - implements - EventGeneratingAction -{ - /** - * Serializable version identifier - */ - static final long serialVersionUID = 8194597741743334704L; - - private String channel; - private String exten; - private String context; - private Integer priority; - private Long timeout; - private String callerId; - private Boolean callingPres; - private String variable; - private String account; - private String application; - private String data; - private Boolean async; - - /** - * Returns the name of this action, i.e. "Originate". - */ - public String getAction() - { - return "Originate"; - } - - /** - * Returns the account code to use for the originated call. - */ - public String getAccount() - { - return account; - } - - /** - * Sets the account code to use for the originated call.<br> - * The account code is included in the call detail record generated for this - * call and will be used for billing. - */ - public void setAccount(String account) - { - this.account = account; - } - - /** - * Returns the caller id to set on the outgoing channel. - */ - public String getCallerId() - { - return callerId; - } - - /** - * Sets the caller id to set on the outgoing channel. - */ - public void setCallerId(String callerId) - { - this.callerId = callerId; - } - - /** - * Returns <code>true</code> if Caller ID presentation is set on the - * outgoing channel. - */ - public Boolean getCallingPres() - { - return callingPres; - } - - /** - * Set to <code>true</code> if you want Caller ID presentation to be set - * on the outgoing channel. - */ - public void setCallingPres(Boolean callingPres) - { - this.callingPres = callingPres; - } - - /** - * Returns the name of the channel to connect to the outgoing call. - */ - public String getChannel() - { - return channel; - } - - /** - * Sets the name of the channel to connect to the outgoing call.<br> - * This property is required. - */ - public void setChannel(String channel) - { - this.channel = channel; - } - - /** - * Returns the name of the context of the extension to connect to. - */ - public String getContext() - { - return context; - } - - /** - * Sets the name of the context of the extension to connect to.<br> - * If you set the context you also have to set the exten and priority - * properties. - */ - public void setContext(String context) - { - this.context = context; - } - - /** - * Returns the extension to connect to. - */ - public String getExten() - { - return exten; - } - - /** - * Sets the extension to connect to.<br> - * If you set the extension you also have to set the context and priority - * properties. - */ - public void setExten(String exten) - { - this.exten = exten; - } - - /** - * Returns the priority of the extension to connect to. - */ - public Integer getPriority() - { - return priority; - } - - /** - * Sets the priority of the extension to connect to. If you set the priority - * you also have to set the context and exten properties. - */ - public void setPriority(Integer priority) - { - this.priority = priority; - } - - /** - * Returns the name of the application to connect to. - */ - public String getApplication() - { - return application; - } - - /** - * Sets the name of the application to connect to. - */ - public void setApplication(String application) - { - this.application = application; - } - - /** - * Returns the parameters to pass to the application. - */ - public String getData() - { - return data; - } - - /** - * Sets the parameters to pass to the application. - */ - public void setData(String data) - { - this.data = data; - } - - /** - * Returns the timeout for the origination. - */ - public Long getTimeout() - { - return timeout; - } - - /** - * Sets the timeout (in milliseconds) for the origination.<br> - * The channel must be answered within this time, otherwise the origination - * is considered to have failed and an OriginateFailureEvent is generated.<br> - * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. - * - * @param timeout the timeout in milliseconds - * @deprecated use {@see #setTimeout(Long)} instead. - */ - public void setTimeout(Integer timeout) - { - this.timeout = new Long(timeout.longValue()); - } - - /** - * Sets the timeout (in milliseconds) for the origination.<br> - * The channel must be answered within this time, otherwise the origination - * is considered to have failed and an OriginateFailureEvent is generated.<br> - * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. - * - * @param timeout the timeout in milliseconds - */ - public void setTimeout(Long timeout) - { - this.timeout = timeout; - } - - /** - * Returns the variables to set on the originated call. - */ - public String getVariable() - { - return variable; - } - - /** - * Sets the variables to set on the originated call.<br> - * Variable assignments are of the form "VARNAME=VALUE". You can specify - * multiple variable assignments separated by the '|' character.<br> - * Example: "VAR1=abc|VAR2=def" sets the channel variables VAR1 to "abc" and - * VAR2 to "def". - */ - public void setVariable(String variable) - { - this.variable = variable; - } - - /** - * Returns true if this is a fast origination. - */ - public Boolean getAsync() - { - return async; - } - - /** - * Set to true for fast origination. - */ - public void setAsync(Boolean async) - { - this.async = async; - } - - public Class getActionCompleteEventClass() - { - return OriginateEvent.class; - } -} +/* + * 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.manager.action; + +import net.sf.asterisk.manager.event.OriginateEvent; + +/** + * The OriginateAction generates an outgoing call to the extension in the given + * context with the given priority or to a given application with optional + * parameters.<br> + * If you want to connect to an extension use the properties context, exten and + * priority. If you want to connect to an application use the properties + * application and data if needed. Note that no call detail record will be + * written when directly connecting to an application, so it may be better to + * connect to an extension that starts the application you wish to connect to.<br> + * The response to this action is sent when the channel has been answered and + * asterisk starts connecting it to the given extension. So be careful not to + * choose a too short timeout when waiting for the response.<br> + * If you set async to <code>true</code> Asterisk reports an OriginateSuccess- + * and OriginateFailureEvents. The action id of these events equals the action + * id of this OriginateAction. + * + * @see net.sf.asterisk.manager.event.OriginateSuccessEvent + * @see net.sf.asterisk.manager.event.OriginateFailureEvent + * @author srt + * @version $Id$ + */ +public class OriginateAction extends AbstractManagerAction + implements + EventGeneratingAction +{ + /** + * Serializable version identifier + */ + static final long serialVersionUID = 8194597741743334704L; + + private String channel; + private String exten; + private String context; + private Integer priority; + private Long timeout; + private String callerId; + private Boolean callingPres; + private String variable; + private String account; + private String application; + private String data; + private Boolean async; + + /** + * Returns the name of this action, i.e. "Originate". + */ + public String getAction() + { + return "Originate"; + } + + /** + * Returns the account code to use for the originated call. + */ + public String getAccount() + { + return account; + } + + /** + * Sets the account code to use for the originated call.<br> + * The account code is included in the call detail record generated for this + * call and will be used for billing. + */ + public void setAccount(String account) + { + this.account = account; + } + + /** + * Returns the caller id to set on the outgoing channel. + */ + public String getCallerId() + { + return callerId; + } + + /** + * Sets the caller id to set on the outgoing channel. + */ + public void setCallerId(String callerId) + { + this.callerId = callerId; + } + + /** + * Returns <code>true</code> if Caller ID presentation is set on the + * outgoing channel. + */ + public Boolean getCallingPres() + { + return callingPres; + } + + /** + * Set to <code>true</code> if you want Caller ID presentation to be set + * on the outgoing channel. + */ + public void setCallingPres(Boolean callingPres) + { + this.callingPres = callingPres; + } + + /** + * Returns the name of the channel to connect to the outgoing call. + */ + public String getChannel() + { + return channel; + } + + /** + * Sets the name of the channel to connect to the outgoing call.<br> + * This property is required. + */ + public void setChannel(String channel) + { + this.channel = channel; + } + + /** + * Returns the name of the context of the extension to connect to. + */ + public String getContext() + { + return context; + } + + /** + * Sets the name of the context of the extension to connect to.<br> + * If you set the context you also have to set the exten and priority + * properties. + */ + public void setContext(String context) + { + this.context = context; + } + + /** + * Returns the extension to connect to. + */ + public String getExten() + { + return exten; + } + + /** + * Sets the extension to connect to.<br> + * If you set the extension you also have to set the context and priority + * properties. + */ + public void setExten(String exten) + { + this.exten = exten; + } + + /** + * Returns the priority of the extension to connect to. + */ + public Integer getPriority() + { + return priority; + } + + /** + * Sets the priority of the extension to connect to. If you set the priority + * you also have to set the context and exten properties. + */ + public void setPriority(Integer priority) + { + this.priority = priority; + } + + /** + * Returns the name of the application to connect to. + */ + public String getApplication() + { + return application; + } + + /** + * Sets the name of the application to connect to. + */ + public void setApplication(String application) + { + this.application = application; + } + + /** + * Returns the parameters to pass to the application. + */ + public String getData() + { + return data; + } + + /** + * Sets the parameters to pass to the application. + */ + public void setData(String data) + { + this.data = data; + } + + /** + * Returns the timeout for the origination. + */ + public Long getTimeout() + { + return timeout; + } + + /** + * Sets the timeout (in milliseconds) for the origination.<br> + * The channel must be answered within this time, otherwise the origination + * is considered to have failed and an OriginateFailureEvent is generated.<br> + * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. + * + * @param timeout the timeout in milliseconds + * @deprecated use {@see #setTimeout(Long)} instead. + */ + public void setTimeout(Integer timeout) + { + this.timeout = new Long(timeout.longValue()); + } + + /** + * Sets the timeout (in milliseconds) for the origination.<br> + * The channel must be answered within this time, otherwise the origination + * is considered to have failed and an OriginateFailureEvent is generated.<br> + * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. + * + * @param timeout the timeout in milliseconds + */ + public void setTimeout(Long timeout) + { + this.timeout = timeout; + } + + /** + * Returns the variables to set on the originated call. + */ + public String getVariable() + { + return variable; + } + + /** + * Sets the variables to set on the originated call.<br> + * Variable assignments are of the form "VARNAME=VALUE". You can specify + * multiple variable assignments separated by the '|' character.<br> + * Example: "VAR1=abc|VAR2=def" sets the channel variables VAR1 to "abc" and + * VAR2 to "def". + */ + public void setVariable(String variable) + { + this.variable = variable; + } + + /** + * Returns true if this is a fast origination. + */ + public Boolean getAsync() + { + return async; + } + + /** + * Set to true for fast origination. Only with fast origination Asterisk + * will send OriginateSuccess- and OriginateFailureEvents. + */ + public void setAsync(Boolean async) + { + this.async = async; + } + + public Class getActionCompleteEventClass() + { + return OriginateEvent.class; + } +} |
From: Stefan R. <sr...@us...> - 2005-07-26 09:04:16
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3192/xdocs Modified Files: index.xml Log Message: Added link to Asterisk Desktop Manager in related Projects Added note about Asterisk-Java 0.2 being available with Asterisk release 1.2 Removed note about MAGI (which seems to be dead) Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -p -r1.19 -r1.20 --- index.xml 23 Jul 2005 08:27:27 -0000 1.19 +++ index.xml 26 Jul 2005 09:03:59 -0000 1.20 @@ -53,14 +53,12 @@ License, Version 2.0</a>.</p> </subsection> <subsection name="Status"> - <p>Asterisk-Java 0.1 has been realeased and is available - from the <a + <p>Asterisk-Java 0.1 has been in late april realeased and is + available from the <a href="http://sourceforge.net/projects/asterisk-java/">sourceforge project page</a>.</p> - <p>The plan for 0.2 includes optional support for David Pollak's - <a href="http://lists.digium.com/pipermail/asterisk-dev/2005-March/010309.html">MAGI</a> - interface (AGI over the Manager API) as soon as it is integrated - into Asterisk's CVS HEAD.</p> + <p>Asterisk-Java 0.2 will be available with the upcoming + Asterisk release 1.2.</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 @@ -105,6 +103,12 @@ cvs -z3 -d:pserver:ano...@cv...urcef <a href="http://www.easymock.org/">EasyMock</a> in addition.</p> </subsection> <subsection name="Related Projects"> + <p><a href="http://adm.hamnett.org/">Asterisk Desktop Manageer</a>, or + ADM for short, brings the power of Asterisk to the user's desktop. It + is written in Java, uses the Eclipse SWT library and is based on + Asterisk-Java.<br/> + Available under the GNU General Public License (GPL). + </p> <p><a href="http://www3.mb.sympatico.ca/~chadk/">Asterisk-Java for Mono/.NET</a> is a port of Asterisk-Java to C# for Mono, Microsoft's .NET Framework and anything else that implements the basic |
From: Stefan R. <sr...@us...> - 2005-07-24 18:06:22
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10764/src/java/net/sf/asterisk/manager Modified Files: DefaultAsteriskManager.java Log Message: Removed System.out.println() left over from debugging Index: DefaultAsteriskManager.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/DefaultAsteriskManager.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- DefaultAsteriskManager.java 17 Jul 2005 07:08:28 -0000 1.8 +++ DefaultAsteriskManager.java 24 Jul 2005 18:06:13 -0000 1.9 @@ -213,8 +213,6 @@ public class DefaultAsteriskManager */ public void handleEvent(ManagerEvent event) { - System.out.println("received: " + event); - if (event instanceof ConnectEvent) { handleConnectEvent((ConnectEvent) event); |
From: Stefan R. <sr...@us...> - 2005-07-24 07:54:02
|
Update of /cvsroot/asterisk-java/asterisk-java In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21673 Modified Files: ChangeLog Log Message: Added note about event generating actions Index: ChangeLog =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- ChangeLog 16 Jul 2005 13:19:34 -0000 1.4 +++ ChangeLog 24 Jul 2005 07:53:52 -0000 1.5 @@ -5,6 +5,10 @@ Asterisk-Java 0.2 * Changed ManagerAction to be an interface rather that an abstract base class. If you extended ManagerAction, please use AbstractManagerAction instead. + * Added support for event generating Actions, i.e. Actions + that send their result as a series of Event rather than + the usual ManagerResults. See the sendEventGeneratingAction() + methods in ManagerConnection for more information. Asterisk-Java 0.1 * Added accessors for raw attributes in ManagerResponse |
From: Stefan R. <sr...@us...> - 2005-07-23 10:13:33
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26389/src/java/net/sf/asterisk/fastagi/impl Modified Files: AGIRequestImpl.java Log Message: fixed synchronize Index: AGIRequestImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl/AGIRequestImpl.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- AGIRequestImpl.java 23 Jul 2005 08:27:27 -0000 1.5 +++ AGIRequestImpl.java 23 Jul 2005 10:13:24 -0000 1.6 @@ -64,24 +64,21 @@ public class AGIRequestImpl implements S private String parameters; private String script; - private boolean callerIdCreated; /** * Creates a new AGIRequestImpl. + * + * @param environment the first lines as received from Asterisk containing + * the environment. */ - public AGIRequestImpl() - { - throw new IllegalArgumentException("Environment must not be null."); - } - - public AGIRequestImpl(final Collection lines) + public AGIRequestImpl(final Collection environment) { - if (lines == null) + if (environment == null) { throw new IllegalArgumentException("Environment must not be null."); } - request = buildMap(lines); + request = buildMap(environment); } /** |
From: Stefan R. <sr...@us...> - 2005-07-23 08:27:35
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8632/xdocs Modified Files: index.xml Log Message: Changed use of deprecated encode/decode methods Index: index.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/index.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -p -r1.18 -r1.19 --- index.xml 10 Jul 2005 17:26:15 -0000 1.18 +++ index.xml 23 Jul 2005 08:27:27 -0000 1.19 @@ -90,8 +90,7 @@ cvs -z3 -d:pserver:ano...@cv...urcef </subsection> <subsection name="Requirements"> <p>At runtime Asterisk-Java requires a Java Runtime - Environment (JRE) of at least version 1.4 (1.3 might work - when using log4j, though that has not been verified). It has + Environment (JRE) of at least version 1.4. It has been successfully tested on Sun's JVM and Bea's JRockit.</p> <p>Of course you also need a working Asterisk server. When using the Manager API be sure that it has been enabled (see |
From: Stefan R. <sr...@us...> - 2005-07-23 08:27:35
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8632/src/java/net/sf/asterisk/fastagi/impl Modified Files: AGIRequestImpl.java Log Message: Changed use of deprecated encode/decode methods Index: AGIRequestImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/fastagi/impl/AGIRequestImpl.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- AGIRequestImpl.java 15 Apr 2005 04:47:00 -0000 1.4 +++ AGIRequestImpl.java 23 Jul 2005 08:27:27 -0000 1.5 @@ -17,6 +17,7 @@ package net.sf.asterisk.fastagi.impl; import java.io.Serializable; +import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.util.ArrayList; import java.util.Collection; @@ -29,6 +30,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import net.sf.asterisk.fastagi.AGIRequest; +import net.sf.asterisk.util.Log; +import net.sf.asterisk.util.LogFactory; /** * Default implementation of the AGIRequest interface. @@ -38,6 +41,7 @@ import net.sf.asterisk.fastagi.AGIReques */ public class AGIRequestImpl implements Serializable, AGIRequest { + private final Log logger = LogFactory.getLog(getClass()); private static final Pattern SCRIPT_PATTERN = Pattern .compile("^([^\\?]*)\\?(.*)$"); private static final Pattern PARAMETER_PATTERN = Pattern @@ -58,6 +62,11 @@ public class AGIRequestImpl implements S */ private Map parameterMap; + private String parameters; + private String script; + + private boolean callerIdCreated; + /** * Creates a new AGIRequestImpl. */ @@ -142,10 +151,13 @@ public class AGIRequestImpl implements S * * @return the name of the script to execute. */ - public String getScript() + public synchronized String getScript() { if (script != null) + { return script; + } + script = (String) request.get("network_script"); if (script != null) { @@ -156,6 +168,7 @@ public class AGIRequestImpl implements S parameters = scriptMatcher.group(2); } } + return script; } @@ -211,8 +224,6 @@ public class AGIRequestImpl implements S return (String) request.get("language"); } - private boolean callerIdCreated; - public String getCallerId() { int lbPosition; @@ -223,7 +234,7 @@ public class AGIRequestImpl implements S rawCallerId = (String) request.get("callerid"); callerIdCreated = true; } - + if (rawCallerId == null) { return null; @@ -250,7 +261,7 @@ public class AGIRequestImpl implements S rawCallerId = (String) request.get("callerid"); callerIdCreated = true; } - + if (rawCallerId == null) { return null; @@ -386,7 +397,7 @@ public class AGIRequestImpl implements S return (String[]) parameterMap.get(name); } - public Map getParameterMap() + public synchronized Map getParameterMap() { if (parameterMap == null) { @@ -395,10 +406,13 @@ public class AGIRequestImpl implements S return parameterMap; } - private String parameters; - private String script; - - private Map parseParameters(String s) + /** + * Parses the given parameter string and caches the result. + * + * @param s the parameter string to parse + * @return a Map made up of parameter names their values + */ + private synchronized Map parseParameters(String s) { Map parameterMap; Map result; @@ -424,13 +438,33 @@ public class AGIRequestImpl implements S parameterMatcher = PARAMETER_PATTERN.matcher(parameter); if (parameterMatcher.matches()) { - name = URLDecoder.decode(parameterMatcher.group(1)); - value = URLDecoder.decode(parameterMatcher.group(2)); + try + { + name = URLDecoder + .decode(parameterMatcher.group(1), "UTF-8"); + value = URLDecoder.decode(parameterMatcher.group(2), + "UTF-8"); + } + catch (UnsupportedEncodingException e) + { + logger.error("Unable to decode parameter '" + parameter + + "'", e); + continue; + } } else { - name = URLDecoder.decode(parameter); - value = ""; + try + { + name = URLDecoder.decode(parameter, "UTF-8"); + value = ""; + } + catch (UnsupportedEncodingException e) + { + logger.error("Unable to decode parameter '" + parameter + + "'", e); + continue; + } } if (parameterMap.get(name) == null) |
From: Stefan R. <sr...@us...> - 2005-07-21 16:49:43
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32575/src/java/net/sf/asterisk/manager/action Modified Files: AgentCallbackLoginAction.java Log Message: Fixed getAction to return correct action string Index: AgentCallbackLoginAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/AgentCallbackLoginAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -p -r1.1 -r1.2 --- AgentCallbackLoginAction.java 21 Jul 2005 13:18:29 -0000 1.1 +++ AgentCallbackLoginAction.java 21 Jul 2005 16:49:35 -0000 1.2 @@ -46,7 +46,7 @@ public class AgentCallbackLoginAction ex */ public String getAction() { - return "AgentLogoff"; + return "AgentCallbackLogin"; } /** |
From: Stefan R. <sr...@us...> - 2005-07-21 13:20:38
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14455/src/java/net/sf/asterisk/manager/action Added Files: AgentCallbackLoginAction.java AgentLogoffAction.java Log Message: Added actions for AgentCallbackLogin and ActionLogoff. Note: the patches for Asterisk CVS-HEAD to support this are still pending. --- NEW FILE: AgentCallbackLoginAction.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.manager.action; /** * The AgentCallbackLoginAction aets an agent as logged in with callback.<br> * You can pass an extentsion (and optionally a context) to specify the destination of the callback.<br> * In contrast to the AgentCallbackLogin application that you can use within Asterisk's dialplan, * you don't need to know the agent's password when logging in an agent.<br> * Available since Asterisk 1.2 * * @author srt * @version $Id: AgentCallbackLoginAction.java,v 1.1 2005/07/21 13:18:29 srt Exp $ * @since 0.2 */ public class AgentCallbackLoginAction extends AbstractManagerAction { /** * Serializable version identifier */ private static final long serialVersionUID = 5239805071977668779L; private String agent; private String exten; private String context; private Boolean ackCall; private Long wrapupTime; /** * Returns the name of this action, i.e. "AgentCallbackLogin". * * @return the name of this action */ public String getAction() { return "AgentLogoff"; } /** * Returns the name of the agent to log in, for example "1002". * * @return the name of the agent to log in */ public String getAgent() { return agent; } /** * Sets the name of the agent to log in, for example "1002".<br> * This is property is mandatory. * * @param agent the name of the agent to log in */ public void setAgent(String agent) { this.agent = agent; } /** * Returns the extension to use for callback. * * @return the extension to use for callback. */ public String getExten() { return exten; } /** * Sets the extension to use for callback.<br> * This is property is mandatory. * * @param exten the extension to use for callback. */ public void setExten(String exten) { this.exten = exten; } /** * Returns the context of the extension to use for callback. * * @return the context of the extension to use for callback. */ public String getContext() { return context; } /** * Sets the context of the extension to use for callback. * * @param context the context of the extension to use for callback. */ public void setContext(String context) { this.context = context; } /** * Returns if an acknowledgement is needed when agent is called back. * * @return Boolean.TRUE to 'true' to require an acknowledgement by '#' when agent is called * back, Boolean.FALSE otherwise. */ public Boolean getAckCall() { return ackCall; } /** * Sets if an acknowledgement is needed when agent is called back.<br> * This property is optional, it allows you to override the defaults defined in Asterisk's * configuration. * * @param ackCall Boolean.TRUE to 'true' to require an acknowledgement by '#' when agent is * called back, Boolean.FALSE otherwise. */ public void setAckCall(Boolean ackCall) { this.ackCall = ackCall; } /** * Returns the minimum amount of time after disconnecting before the caller can receive a new * call. * * @return the minimum amount of time after disconnecting before the caller can receive a new * call in milliseconds. */ public Long getWrapupTime() { return wrapupTime; } /** * Sets the minimum amount of time after disconnecting before the caller can receive a new call.<br> * This property is optional, it allows you to override the defaults defined in Asterisk's * configuration. * * @param wrapupTime the minimum amount of time after disconnecting before the caller can * receive a new call in milliseconds. */ public void setWrapupTime(Long wrapupTime) { this.wrapupTime = wrapupTime; } } --- NEW FILE: AgentLogoffAction.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.manager.action; /** * The AgentLogoffAction sets an agent as no longer logged in.<br> * Available since Asterisk 1.2 * * @author srt * @version $Id: AgentLogoffAction.java,v 1.1 2005/07/21 13:18:29 srt Exp $ * @since 0.2 */ public class AgentLogoffAction extends AbstractManagerAction { /** * Serializable version identifier */ private static final long serialVersionUID = 5239805071977668779L; private String agent; /** * Returns the name of this action, i.e. "AgentLogoff". * * @return the name of this action */ public String getAction() { return "AgentLogoff"; } /** * Returns the name of the agent to log off, for example "1002". * * @return the name of the agent to log off */ public String getAgent() { return agent; } /** * Sets the name of the agent to log off, for example "1002".<br> * This is property is mandatory. * * @param agent the name of the agent to log off */ public void setAgent(String agent) { this.agent = agent; } } |
From: Stefan R. <sr...@us...> - 2005-07-18 14:53:46
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19002/src/java/net/sf/asterisk/manager/impl Modified Files: EventBuilderImpl.java Log Message: Added SIPPeersAction and SIPShowPeerAction and corresponding events PeerEntryEvent and PeerlistCompleteEvent Index: EventBuilderImpl.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/impl/EventBuilderImpl.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- EventBuilderImpl.java 16 Jul 2005 13:39:54 -0000 1.7 +++ EventBuilderImpl.java 18 Jul 2005 14:53:08 -0000 1.8 @@ -55,7 +55,9 @@ import net.sf.asterisk.manager.event.Ori import net.sf.asterisk.manager.event.OriginateSuccessEvent; import net.sf.asterisk.manager.event.ParkedCallEvent; import net.sf.asterisk.manager.event.ParkedCallsCompleteEvent; +import net.sf.asterisk.manager.event.PeerEntryEvent; import net.sf.asterisk.manager.event.PeerStatusEvent; +import net.sf.asterisk.manager.event.PeerlistCompleteEvent; import net.sf.asterisk.manager.event.QueueEntryEvent; import net.sf.asterisk.manager.event.QueueMemberEvent; import net.sf.asterisk.manager.event.QueueMemberStatusEvent; @@ -125,6 +127,8 @@ public class EventBuilderImpl implements registerEventClass(OriginateSuccessEvent.class); registerEventClass(ParkedCallEvent.class); registerEventClass(ParkedCallsCompleteEvent.class); + registerEventClass(PeerEntryEvent.class); + registerEventClass(PeerlistCompleteEvent.class); registerEventClass(PeerStatusEvent.class); registerEventClass(QueueEntryEvent.class); registerEventClass(QueueMemberEvent.class); @@ -306,8 +310,22 @@ public class EventBuilderImpl implements } dataType = setter.getParameterTypes()[0]; - - if (dataType.isAssignableFrom(String.class)) + + if (dataType == Boolean.class) + { + String tmp; + + tmp = (String) attributes.get(name); + if (tmp != null && ("yes".equalsIgnoreCase(tmp) || "true".equalsIgnoreCase(tmp))) + { + value = Boolean.TRUE; + } + else + { + value = Boolean.FALSE; + } + } + else if (dataType.isAssignableFrom(String.class)) { value = attributes.get(name); } |
From: Stefan R. <sr...@us...> - 2005-07-18 14:53:34
|
Update of /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19002/src/test/net/sf/asterisk/manager/impl Modified Files: EventBuilderImplTest.java Log Message: Added SIPPeersAction and SIPShowPeerAction and corresponding events PeerEntryEvent and PeerlistCompleteEvent Index: EventBuilderImplTest.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/test/net/sf/asterisk/manager/impl/EventBuilderImplTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -p -r1.3 -r1.4 --- EventBuilderImplTest.java 21 Apr 2005 23:34:41 -0000 1.3 +++ EventBuilderImplTest.java 18 Jul 2005 14:53:25 -0000 1.4 @@ -183,6 +183,40 @@ public class EventBuilderImplTest extend .getRestart()); } + public void testBuildEventWithBooleanPropertyOfValueYes() + { + Map properties = new HashMap(); + ShutdownEvent event; + + eventBuilder.registerEventClass(ShutdownEvent.class); + properties.put("event", "shutdown"); + properties.put("restart", "yes"); + event = (ShutdownEvent) eventBuilder.buildEvent(this, properties); + + assertNotNull(event); + assertEquals("Returned event is of wrong type", ShutdownEvent.class, + event.getClass()); + assertEquals("Boolean property not set correctly", Boolean.TRUE, event + .getRestart()); + } + + public void testBuildEventWithBooleanPropertyOfValueNo() + { + Map properties = new HashMap(); + ShutdownEvent event; + + eventBuilder.registerEventClass(ShutdownEvent.class); + properties.put("event", "shutdown"); + properties.put("restart", "NO"); + event = (ShutdownEvent) eventBuilder.buildEvent(this, properties); + + assertNotNull(event); + assertEquals("Returned event is of wrong type", ShutdownEvent.class, + event.getClass()); + assertEquals("Boolean property not set correctly", Boolean.FALSE, event + .getRestart()); + } + public void testBuildEventWithUnregisteredEvent() { Map properties = new HashMap(); |
From: Stefan R. <sr...@us...> - 2005-07-18 14:53:34
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19002/src/java/net/sf/asterisk/manager/action Modified Files: DBGetAction.java Added Files: SIPPeersAction.java SIPShowPeerAction.java Log Message: Added SIPPeersAction and SIPShowPeerAction and corresponding events PeerEntryEvent and PeerlistCompleteEvent --- NEW FILE: SIPPeersAction.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.manager.action; import net.sf.asterisk.manager.event.PeerlistCompleteEvent; /** * Retrieves a list of all defined SIP peers.<br> * For each peer that is found a PeerEntryEvent is sent by Asterisk containing * the details. When all peers have been reported a PeerlistCompleteEvent is sent.<br> * Available since Asterisk 1.2 * * @see net.sf.asterisk.manager.event.PeerEntryEvent * @see net.sf.asterisk.manager.event.PeerlistCompleteEvent * @author srt * @version $Id: SIPPeersAction.java,v 1.1 2005/07/18 14:53:24 srt Exp $ * @since 0.2 */ public class SIPPeersAction extends AbstractManagerAction implements EventGeneratingAction { /** * Serial version identifier */ private static final long serialVersionUID = 921037572305993779L; public String getAction() { return "SIPPeers"; } public Class getActionCompleteEventClass() { return PeerlistCompleteEvent.class; } } --- NEW FILE: SIPShowPeerAction.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.manager.action; import net.sf.asterisk.manager.event.PeerlistCompleteEvent; /** * Retrieves a the details about a given SIP peer.<br> * For a PeerEntryEvent is sent by Asterisk containing the details of the peer followed by a * PeerlistCompleteEvent.<br> * Available since Asterisk 1.2 * * @see net.sf.asterisk.manager.event.PeerEntryEvent * @see net.sf.asterisk.manager.event.PeerlistCompleteEvent * @author srt * @version $Id: SIPShowPeerAction.java,v 1.1 2005/07/18 14:53:25 srt Exp $ * @since 0.2 */ public class SIPShowPeerAction extends AbstractManagerAction implements EventGeneratingAction { /** * Serial version identifier */ private static final long serialVersionUID = 921037572305993779L; private String peer; public String getAction() { return "SIPPeer"; } /** * Returns the name of the peer to retrieve.<br> * This parameter is mandatory. * * @return the name of the peer to retrieve. */ public String getPeer() { return peer; } /** * Sets the name of the peer to retrieve.<br> * This parameter is mandatory. * * @param peer the name of the peer to retrieve. */ public void setPeer(String peer) { this.peer = peer; } public Class getActionCompleteEventClass() { return PeerlistCompleteEvent.class; } } Index: DBGetAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/DBGetAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- DBGetAction.java 16 Jul 2005 14:25:48 -0000 1.2 +++ DBGetAction.java 18 Jul 2005 14:53:08 -0000 1.3 @@ -24,6 +24,7 @@ import net.sf.asterisk.manager.event.DBG * the value, otherwise a ManagerError indicates that no entry matches.<br> * Available since Asterisk 1.2 * + * @see net.sf.asterisk.manager.event.DBGetResponseEvent * @author srt * @version $Id$ * @since 0.2 |
From: Stefan R. <sr...@us...> - 2005-07-18 14:53:19
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/event In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19002/src/java/net/sf/asterisk/manager/event Added Files: PeerEntryEvent.java PeerlistCompleteEvent.java Log Message: Added SIPPeersAction and SIPShowPeerAction and corresponding events PeerEntryEvent and PeerlistCompleteEvent --- NEW FILE: PeerEntryEvent.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.manager.event; /** * A PeerEntryEvent is triggered in response to a SIPPeersAction or SIPShowPeerAction and contains * information about a peer.<br> * It is implemented in <code>channels/chan_sip.c</code> * * @author srt * @version $Id: PeerEntryEvent.java,v 1.1 2005/07/18 14:53:08 srt Exp $ * @since 0.2 */ public class PeerEntryEvent extends ResponseEvent { /** * Serial version identifier */ private static final long serialVersionUID = 1443711349135777437L; private String channelType; private String objectName; private String chanObjectType; private String ipAddress; private int ipPort; private Boolean dynamic; private Boolean natSupport; private Boolean acl; private String status; /** * Creates a new instance. * * @param source */ public PeerEntryEvent(Object source) { super(source); } /** * For SIP peers this is "SIP". * * @return */ public String getChannelType() { return channelType; } public void setChannelType(String channelType) { this.channelType = channelType; } public String getObjectName() { return objectName; } public void setObjectName(String objectName) { this.objectName = objectName; } /** * For SIP peers this is either "peer" or "user". * * @return */ public String getChanObjectType() { return chanObjectType; } public void setChanObjectType(String chanObjectType) { this.chanObjectType = chanObjectType; } /** * Returns the IP address of the peer. * * @return the IP address of the peer or "-none-" if none is available. */ public String getIpAddress() { return ipAddress; } /** * Sets the IP address of the peer. * * @param ipAddress the IP address of the peer. */ public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } public int getIpPort() { return ipPort; } public void setIpPort(int ipPort) { this.ipPort = ipPort; } public Boolean getDynamic() { return dynamic; } public void setDynamic(Boolean dynamic) { this.dynamic = dynamic; } public Boolean getNatSupport() { return natSupport; } public void setNatSupport(Boolean natSupport) { this.natSupport = natSupport; } public Boolean getAcl() { return acl; } public void setAcl(Boolean acl) { this.acl = acl; } /** * Returns the status of this peer.<br> * For SIP peers this is one of: * <dl> * <dt>"UNREACHABLE"</dt> * <dd></dd> * <dt>"LAGGED (%d ms)"</dt> * <dd></dd> * <dt>"OK (%d ms)"</dt> * <dd></dd> * <dt>"UNKNOWN"</dt> * <dd></dd> * <dt>"Unmonitored"</dt> * <dd></dd> * </dl> * * @return the status of this peer. */ public String getStatus() { return status; } /** * Sets the status of this peer. * * @param status the status of this peer. */ public void setStatus(String status) { this.status = status; } } --- NEW FILE: PeerlistCompleteEvent.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.manager.event; /** * A PeerlistCompleteEvent is triggered after the details of all peers has been reported in response * to an SIPPeersAction or SIPShowPeerAction.<br> * Available since Asterisk 1.2 * * @see net.sf.asterisk.manager.event.PeerEntryEvent * @see net.sf.asterisk.manager.action.SIPPeersAction * @see net.sf.asterisk.manager.action.SIPShowPeerAction * @author srt * @version $Id: PeerlistCompleteEvent.java,v 1.1 2005/07/18 14:53:08 srt Exp $ * @since 0.2 */ public class PeerlistCompleteEvent extends ResponseEvent { /** * Serial version identifier */ private static final long serialVersionUID = -1177773673509373296L; private Integer listItems; /** * Creates a new instance. * * @param source */ public PeerlistCompleteEvent(Object source) { super(source); } /** * Returns the number of PeerEvents that have been reported. * * @return the number of PeerEvents that have been reported. */ public Integer getListItems() { return listItems; } /** * Sets the number of PeerEvents that have been reported. * * @param listItems the number of PeerEvents that have been reported. */ public void setListItems(Integer listItems) { this.listItems = listItems; } } |
From: Stefan R. <sr...@us...> - 2005-07-18 12:11:31
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/response In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17340/src/java/net/sf/asterisk/manager/response Modified Files: ExtensionStateResponse.java Log Message: added toString() Index: ExtensionStateResponse.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/response/ExtensionStateResponse.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -p -r1.2 -r1.3 --- ExtensionStateResponse.java 23 Feb 2005 22:50:58 -0000 1.2 +++ ExtensionStateResponse.java 18 Jul 2005 12:11:05 -0000 1.3 @@ -70,4 +70,22 @@ public class ExtensionStateResponse exte { this.status = status; } + + public String toString() + { + StringBuffer sb; + + sb = new StringBuffer(getClass().getName() + ": "); + sb.append("actionId='" + getActionId() + "'; "); + sb.append("message='" + getMessage() + "'; "); + sb.append("response='" + getResponse() + "'; "); + sb.append("uniqueId='" + getUniqueId() + "'; "); + sb.append("exten='" + getExten() + "'; "); + sb.append("context='" + getContext() + "'; "); + sb.append("hint='" + getHint() + "'; "); + sb.append("status='" + getStatus() + "'; "); + sb.append("systemHashcode=" + System.identityHashCode(this)); + + return sb.toString(); + } } |
From: Stefan R. <sr...@us...> - 2005-07-17 07:08:40
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5100/src/java/net/sf/asterisk/manager Modified Files: DefaultAsteriskManager.java Log Message: Index: DefaultAsteriskManager.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/DefaultAsteriskManager.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -p -r1.7 -r1.8 --- DefaultAsteriskManager.java 16 Jul 2005 23:26:58 -0000 1.7 +++ DefaultAsteriskManager.java 17 Jul 2005 07:08:28 -0000 1.8 @@ -24,6 +24,7 @@ import java.util.Iterator; import java.util.Map; import net.sf.asterisk.manager.action.OriginateAction; +import net.sf.asterisk.manager.action.QueueStatusAction; import net.sf.asterisk.manager.action.StatusAction; import net.sf.asterisk.manager.event.ConnectEvent; import net.sf.asterisk.manager.event.DisconnectEvent; @@ -119,7 +120,7 @@ public class DefaultAsteriskManager try { - re = connection.sendEventGeneratingAction(new StatusAction()); + re = connection.sendEventGeneratingAction(new QueueStatusAction()); } catch (EventTimeoutException e) { |
From: Stefan R. <sr...@us...> - 2005-07-17 00:10:44
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4484/src/java/net/sf/asterisk/manager Modified Files: DefaultManagerConnection.java Log Message: Don't wait for events being sent when receiving a ManagerError in response to an EventGeneratingAction. Index: DefaultManagerConnection.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/DefaultManagerConnection.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -p -r1.22 -r1.23 --- DefaultManagerConnection.java 16 Jul 2005 22:04:54 -0000 1.22 +++ DefaultManagerConnection.java 17 Jul 2005 00:10:30 -0000 1.23 @@ -1187,6 +1187,10 @@ public class DefaultManagerConnection im synchronized (events) { events.setRepsonse(response); + if (response instanceof ManagerError) + { + events.setComplete(true); + } // finished? if (events.isComplete()) |
From: Stefan R. <sr...@us...> - 2005-07-16 23:31:00
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29727/src/java/net/sf/asterisk/manager/action Modified Files: OriginateAction.java Log Message: Fixed scrambled file Index: OriginateAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/OriginateAction.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -p -r1.6 -r1.7 --- OriginateAction.java 16 Jul 2005 23:30:13 -0000 1.6 +++ OriginateAction.java 16 Jul 2005 23:30:51 -0000 1.7 @@ -240,7 +240,7 @@ public class OriginateAction extends Abs * @param timeout the timeout in milliseconds * @deprecated use {@see #setTimeout(Long)} instead. */ - public c + public void setTimeout(Integer timeout) { this.timeout = new Long(timeout.longValue()); } |
From: Stefan R. <sr...@us...> - 2005-07-16 23:30:22
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29601/src/java/net/sf/asterisk/manager/action Modified Files: OriginateAction.java Log Message: added deprecated setTimeout(Integer) method for backward compatibility Index: OriginateAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/OriginateAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -p -r1.5 -r1.6 --- OriginateAction.java 16 Jul 2005 23:27:46 -0000 1.5 +++ OriginateAction.java 16 Jul 2005 23:30:13 -0000 1.6 @@ -236,6 +236,22 @@ public class OriginateAction extends Abs * The channel must be answered within this time, otherwise the origination * is considered to have failed and an OriginateFailureEvent is generated.<br> * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. + * + * @param timeout the timeout in milliseconds + * @deprecated use {@see #setTimeout(Long)} instead. + */ + public c + { + this.timeout = new Long(timeout.longValue()); + } + + /** + * Sets the timeout (in milliseconds) for the origination.<br> + * The channel must be answered within this time, otherwise the origination + * is considered to have failed and an OriginateFailureEvent is generated.<br> + * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. + * + * @param timeout the timeout in milliseconds */ public void setTimeout(Long timeout) { |
From: Stefan R. <sr...@us...> - 2005-07-16 23:28:25
|
Update of /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29252/src/java/net/sf/asterisk/manager/action Modified Files: OriginateAction.java Log Message: Changed type of timeout attribute to Long Index: OriginateAction.java =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/src/java/net/sf/asterisk/manager/action/OriginateAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -p -r1.4 -r1.5 --- OriginateAction.java 16 Jul 2005 14:25:48 -0000 1.4 +++ OriginateAction.java 16 Jul 2005 23:27:46 -0000 1.5 @@ -19,40 +19,40 @@ package net.sf.asterisk.manager.action; import net.sf.asterisk.manager.event.OriginateEvent; /** - * The OriginateAction generates an outgoing call to the extension in the given context with the - * given priority or to a given application with optional parameters.<br> - * - * If you want to connect to an extension use the properties context, exten and priority. If you - * want to connect to an application use the properties application and data if needed. Note that no - * call detail record will be written when directly connecting to an application, so it may be - * better to connect to an extension that starts the application you wish to connect to.<br> - * - * The response to this action is sent when the channel has been answered and asterisk starts - * connecting it to the given extension. So be careful not to choose a too short timeout when - * waiting for the response.<br> - * - * If the origination succeeds an OriginateSuccessEvent is generated, if it fails an - * OriginateFailureEvent is generated. The action id of these events equals the action id of this - * OriginateAction. + * The OriginateAction generates an outgoing call to the extension in the given + * context with the given priority or to a given application with optional + * parameters.<br> + * If you want to connect to an extension use the properties context, exten and + * priority. If you want to connect to an application use the properties + * application and data if needed. Note that no call detail record will be + * written when directly connecting to an application, so it may be better to + * connect to an extension that starts the application you wish to connect to.<br> + * The response to this action is sent when the channel has been answered and + * asterisk starts connecting it to the given extension. So be careful not to + * choose a too short timeout when waiting for the response.<br> + * If the origination succeeds an OriginateSuccessEvent is generated, if it + * fails an OriginateFailureEvent is generated. The action id of these events + * equals the action id of this OriginateAction. * * @see net.sf.asterisk.manager.event.OriginateSuccessEvent * @see net.sf.asterisk.manager.event.OriginateFailureEvent - * * @author srt * @version $Id$ */ -public class OriginateAction extends AbstractManagerAction implements EventGeneratingAction +public class OriginateAction extends AbstractManagerAction + implements + EventGeneratingAction { /** * Serializable version identifier */ - static final long serialVersionUID = 8194597741743334704L; + static final long serialVersionUID = 8194597741743334704L; private String channel; private String exten; private String context; private Integer priority; - private Integer timeout; + private Long timeout; private String callerId; private Boolean callingPres; private String variable; @@ -79,8 +79,8 @@ public class OriginateAction extends Abs /** * Sets the account code to use for the originated call.<br> - * The account code is included in the call detail record generated for this call and will be - * used for billing. + * The account code is included in the call detail record generated for this + * call and will be used for billing. */ public void setAccount(String account) { @@ -104,7 +104,8 @@ public class OriginateAction extends Abs } /** - * Returns <code>true</code> if Caller ID presentation is set on the outgoing channel. + * Returns <code>true</code> if Caller ID presentation is set on the + * outgoing channel. */ public Boolean getCallingPres() { @@ -112,8 +113,8 @@ public class OriginateAction extends Abs } /** - * Set to <code>true</code> if you want Caller ID presentation to be set on the outgoing - * channel. + * Set to <code>true</code> if you want Caller ID presentation to be set + * on the outgoing channel. */ public void setCallingPres(Boolean callingPres) { @@ -147,7 +148,8 @@ public class OriginateAction extends Abs /** * Sets the name of the context of the extension to connect to.<br> - * If you set the context you also have to set the exten and priority properties. + * If you set the context you also have to set the exten and priority + * properties. */ public void setContext(String context) { @@ -164,7 +166,8 @@ public class OriginateAction extends Abs /** * Sets the extension to connect to.<br> - * If you set the extension you also have to set the context and priority properties. + * If you set the extension you also have to set the context and priority + * properties. */ public void setExten(String exten) { @@ -180,8 +183,8 @@ public class OriginateAction extends Abs } /** - * Sets the priority of the extension to connect to. If you set the priority you also have to - * set the context and exten properties. + * Sets the priority of the extension to connect to. If you set the priority + * you also have to set the context and exten properties. */ public void setPriority(Integer priority) { @@ -223,18 +226,18 @@ public class OriginateAction extends Abs /** * Returns the timeout for the origination. */ - public Integer getTimeout() + public Long getTimeout() { return timeout; } /** * Sets the timeout (in milliseconds) for the origination.<br> - * The channel must be answered within this time, otherwise the origination is considered to - * have failed and an OriginateFailureEvent is generated.<br> - * If not set, asterisk assumes a default value of 30000 meaning 30 seconds. + * The channel must be answered within this time, otherwise the origination + * is considered to have failed and an OriginateFailureEvent is generated.<br> + * If not set, Asterisk assumes a default value of 30000 meaning 30 seconds. */ - public void setTimeout(Integer timeout) + public void setTimeout(Long timeout) { this.timeout = timeout; } @@ -249,9 +252,10 @@ public class OriginateAction extends Abs /** * Sets the variables to set on the originated call.<br> - * Variable assignments are of the form "VARNAME=VALUE". You can specify multiple variable - * assignments separated by the '|' character.<br> - * Example: "VAR1=abc|VAR2=def" sets the channel variables VAR1 to "abc" and VAR2 to "def". + * Variable assignments are of the form "VARNAME=VALUE". You can specify + * multiple variable assignments separated by the '|' character.<br> + * Example: "VAR1=abc|VAR2=def" sets the channel variables VAR1 to "abc" and + * VAR2 to "def". */ public void setVariable(String variable) { |