net.sf.asterisk.fastagi.command
Class SayDateTimeCommand

java.lang.Object
  extended by net.sf.asterisk.fastagi.command.AGICommand
      extended by net.sf.asterisk.fastagi.command.SayDateTimeCommand
All Implemented Interfaces:
java.io.Serializable

public class SayDateTimeCommand
extends AGICommand

Say a given time, returning early if any of the given DTMF digits are pressed.
Returns 0 if playback completes without a digit being pressed, or the ASCII numerical value of the digit if one was pressed or -1 on error/hangup.
Available since Asterisk 1.2.

Since:
0.2
Version:
$Id: SayDateTimeCommand.java,v 1.1 2005/11/27 15:22:40 srt Exp $
Author:
srt
See Also:
Serialized Form

Constructor Summary
SayDateTimeCommand(long time)
          Creates a new SayDateTimeCommand that says the given time.
SayDateTimeCommand(long time, java.lang.String escapeDigits)
          Creates a new SayDateTimeCommand that says the given time and allows interruption by one of the given escape digits.
SayDateTimeCommand(long time, java.lang.String escapeDigits, java.lang.String format)
          Creates a new SayDateTimeCommand that says the given time in the given format and allows interruption by one of the given escape digits.
SayDateTimeCommand(long time, java.lang.String escapeDigits, java.lang.String format, java.lang.String timezone)
          Creates a new SayDateTimeCommand that says the given time in the given format and timezone and allows interruption by one of the given escape digits.
 
Method Summary
 java.lang.String buildCommand()
          Returns a string suitable to be sent to asterisk.
 java.lang.String getEscapeDigits()
          Returns the digits that allow the user to interrupt this command.
 java.lang.String getFormat()
          Returns the format the time should be said in.
 long getTime()
          Returns the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
 java.lang.String getTimezone()
          Returns the timezone to use when saying the time.
 void setEscapeDigits(java.lang.String escapeDigits)
          Sets the digits that allow the user to interrupt this command.
 void setFormat(java.lang.String format)
          Sets the format the time should be said in.
See voicemail.conf.
Defaults to "ABdY 'digits/at' IMp".
 void setTime(long time)
          Returns the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
This property is mandatory.
 void setTimezone(java.lang.String timezone)
          Sets the timezone to use when saying the time.
A list of available timezones is available in /usr/share/zoneinfo on your Asterisk server.
Defaults to machine default.
 
Methods inherited from class net.sf.asterisk.fastagi.command.AGICommand
escapeAndQuote, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SayDateTimeCommand

public SayDateTimeCommand(long time)
Creates a new SayDateTimeCommand that says the given time.

Parameters:
time - the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)

SayDateTimeCommand

public SayDateTimeCommand(long time,
                          java.lang.String escapeDigits)
Creates a new SayDateTimeCommand that says the given time and allows interruption by one of the given escape digits.

Parameters:
time - the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)
escapeDigits - the digits that allow the user to interrupt this command or null for none.

SayDateTimeCommand

public SayDateTimeCommand(long time,
                          java.lang.String escapeDigits,
                          java.lang.String format)
Creates a new SayDateTimeCommand that says the given time in the given format and allows interruption by one of the given escape digits.

Parameters:
time - the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)
escapeDigits - the digits that allow the user to interrupt this command or null for none.
format - the format the time should be said in

SayDateTimeCommand

public SayDateTimeCommand(long time,
                          java.lang.String escapeDigits,
                          java.lang.String format,
                          java.lang.String timezone)
Creates a new SayDateTimeCommand that says the given time in the given format and timezone and allows interruption by one of the given escape digits.

Parameters:
time - the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)
escapeDigits - the digits that allow the user to interrupt this command or null for none.
format - the format the time should be said in
timezone - the timezone to use when saying the time, for example "UTC" or "Europe/Berlin".
Method Detail

getTime

public long getTime()
Returns the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).

Returns:
the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)

setTime

public void setTime(long time)
Returns the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
This property is mandatory.

Parameters:
time - the time to say in seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC)

getEscapeDigits

public java.lang.String getEscapeDigits()
Returns the digits that allow the user to interrupt this command.

Returns:
the digits that allow the user to interrupt this command.

setEscapeDigits

public void setEscapeDigits(java.lang.String escapeDigits)
Sets the digits that allow the user to interrupt this command.

Parameters:
escapeDigits - the digits that allow the user to interrupt this command or null for none.

getFormat

public java.lang.String getFormat()
Returns the format the time should be said in.

Returns:
the format the time should be said in

setFormat

public void setFormat(java.lang.String format)
Sets the format the time should be said in.
See voicemail.conf.
Defaults to "ABdY 'digits/at' IMp".

Parameters:
format - the format the time should be said in

getTimezone

public java.lang.String getTimezone()
Returns the timezone to use when saying the time.

Returns:
the timezone to use when saying the time.

setTimezone

public void setTimezone(java.lang.String timezone)
Sets the timezone to use when saying the time.
A list of available timezones is available in /usr/share/zoneinfo on your Asterisk server.
Defaults to machine default.

Parameters:
timezone - the timezone to use when saying the time, for example "UTC" or "Europe/Berlin".

buildCommand

public java.lang.String buildCommand()
Description copied from class: AGICommand
Returns a string suitable to be sent to asterisk.

Specified by:
buildCommand in class AGICommand
Returns:
a string suitable to be sent to asterisk.


Copyright © 2004-2005 Stefan Reuter. All Rights Reserved.