|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asterisk.fastagi.AbstractAGIScript
BaseAGIScript
instead
public abstract class AbstractAGIScript
The AbstractAGIScript provides some convinience methods to make it easier to
write custom AGIScripts.
Just extend it by your own AGIScripts.
Constructor Summary | |
---|---|
AbstractAGIScript()
Deprecated. |
Method Summary | |
---|---|
protected void |
answer(AGIChannel channel)
Deprecated. Answers the channel. |
protected int |
exec(AGIChannel channel,
java.lang.String application)
Deprecated. Executes the given command. |
protected int |
exec(AGIChannel channel,
java.lang.String application,
java.lang.String options)
Deprecated. Executes the given command. |
protected int |
execCommand(AGIChannel channel,
java.lang.String application)
Deprecated. use exec(AGIChannel, String) instead |
protected int |
execCommand(AGIChannel channel,
java.lang.String application,
java.lang.String options)
Deprecated. use exec(AGIChannel, String, String) instead |
protected int |
getChannelStatus(AGIChannel channel)
Deprecated. Returns the status of the channel. Return values: 0 Channel is down and available 1 Channel is down, but reserved 2 Channel is off hook 3 Digits (or equivalent) have been dialed 4 Line is ringing 5 Remote end is ringing 6 Line is up 7 Line is busy |
protected java.lang.String |
getData(AGIChannel channel,
java.lang.String file)
Deprecated. Plays the given file and waits for the user to enter DTMF digits until he presses '#'. |
protected java.lang.String |
getData(AGIChannel channel,
java.lang.String file,
int timeout)
Deprecated. Plays the given file and waits for the user to enter DTMF digits until he presses '#' or the timeout occurs. |
protected java.lang.String |
getData(AGIChannel channel,
java.lang.String file,
int timeout,
int maxDigits)
Deprecated. Plays the given file and waits for the user to enter DTMF digits until he presses '#' or the timeout occurs or the maximum number of digits has been entered. |
protected char |
getOption(AGIChannel channel,
java.lang.String file,
java.lang.String escapeDigits)
Deprecated. Plays the given file, and waits for the user to press one of the given digits. |
protected char |
getOption(AGIChannel channel,
java.lang.String file,
java.lang.String escapeDigits,
int timeout)
Deprecated. Plays the given file, and waits for the user to press one of the given digits. |
protected java.lang.String |
getVariable(AGIChannel channel,
java.lang.String name)
Deprecated. Returns the value of the given channel variable. |
protected void |
hangup(AGIChannel channel)
Deprecated. Hangs the channel up. |
protected void |
playMusicOnHold(AGIChannel channel)
Deprecated. Plays music on hold from the default music on hold class. |
protected void |
playMusicOnHold(AGIChannel channel,
java.lang.String musicOnHoldClass)
Deprecated. Plays music on hold from the given music on hold class. |
protected void |
sayAlpha(AGIChannel channel,
java.lang.String text)
Deprecated. Says the given character string. |
protected char |
sayAlpha(AGIChannel channel,
java.lang.String text,
java.lang.String escapeDigits)
Deprecated. Says the given character string, returning early if any of the given DTMF number are received on the channel. |
protected void |
sayDigits(AGIChannel channel,
java.lang.String digits)
Deprecated. Says the given digit string. |
protected char |
sayDigits(AGIChannel channel,
java.lang.String digits,
java.lang.String escapeDigits)
Deprecated. Says the given number, returning early if any of the given DTMF number are received on the channel. |
protected void |
sayNumber(AGIChannel channel,
java.lang.String number)
Deprecated. Says the given number. |
protected char |
sayNumber(AGIChannel channel,
java.lang.String number,
java.lang.String escapeDigits)
Deprecated. Says the given number, returning early if any of the given DTMF number are received on the channel. |
protected void |
sayPhonetic(AGIChannel channel,
java.lang.String text)
Deprecated. Says the given character string with phonetics. |
protected char |
sayPhonetic(AGIChannel channel,
java.lang.String text,
java.lang.String escapeDigits)
Deprecated. Says the given character string with phonetics, returning early if any of the given DTMF number are received on the channel. |
protected void |
sayTime(AGIChannel channel,
long time)
Deprecated. Says the given time. |
protected char |
sayTime(AGIChannel channel,
long time,
java.lang.String escapeDigits)
Deprecated. Says the given time, returning early if any of the given DTMF number are received on the channel. |
protected void |
setAutoHangup(AGIChannel channel,
int time)
Deprecated. Cause the channel to automatically hangup at the given number of seconds in the future. |
protected void |
setCallerId(AGIChannel channel,
java.lang.String callerId)
Deprecated. Sets the caller id on the current channel. |
protected void |
setContext(AGIChannel channel,
java.lang.String context)
Deprecated. Sets the context for continuation upon exiting the application. |
protected void |
setExtension(AGIChannel channel,
java.lang.String extension)
Deprecated. Sets the extension for continuation upon exiting the application. |
protected void |
setPriority(AGIChannel channel,
java.lang.String priority)
Deprecated. Sets the priority or label for continuation upon exiting the application. |
protected void |
setVariable(AGIChannel channel,
java.lang.String name,
java.lang.String value)
Deprecated. Sets the value of the given channel variable to a new value. |
protected void |
stopMusicOnHold(AGIChannel channel)
Deprecated. Stops playing music on hold. |
protected void |
streamFile(AGIChannel channel,
java.lang.String file)
Deprecated. Plays the given file. |
protected char |
streamFile(AGIChannel channel,
java.lang.String file,
java.lang.String escapeDigits)
Deprecated. Plays the given file and allows the user to escape by pressing one of the given digit. |
protected char |
waitForDigit(AGIChannel channel,
int timeout)
Deprecated. Waits up to 'timeout' milliseconds to receive a DTMF digit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.asterisk.fastagi.AGIScript |
---|
service |
Constructor Detail |
---|
public AbstractAGIScript()
Method Detail |
---|
protected void answer(AGIChannel channel) throws AGIException
AGIException
protected void hangup(AGIChannel channel) throws AGIException
AGIException
protected void setAutoHangup(AGIChannel channel, int time) throws AGIException
time
- the number of seconds before this channel is automatically
hung up.AGIException
protected void setCallerId(AGIChannel channel, java.lang.String callerId) throws AGIException
callerId
- the raw caller id to set, for example "John Doe<1234>".
AGIException
protected void playMusicOnHold(AGIChannel channel) throws AGIException
AGIException
protected void playMusicOnHold(AGIChannel channel, java.lang.String musicOnHoldClass) throws AGIException
musicOnHoldClass
- the music on hold class to play music from as
configures in Asterisk's .
- Throws:
AGIException
protected void stopMusicOnHold(AGIChannel channel) throws AGIException
AGIException
protected int getChannelStatus(AGIChannel channel) throws AGIException
AGIException
protected java.lang.String getData(AGIChannel channel, java.lang.String file) throws AGIException
file
- the name of the file to play
AGIException
protected java.lang.String getData(AGIChannel channel, java.lang.String file, int timeout) throws AGIException
file
- the name of the file to playtimeout
- the timeout to wait for user input.AGIException
protected java.lang.String getData(AGIChannel channel, java.lang.String file, int timeout, int maxDigits) throws AGIException
file
- the name of the file to playtimeout
- the timeout to wait for user input.maxDigits
- the maximum number of digits the user is allowed to
enter
AGIException
protected char getOption(AGIChannel channel, java.lang.String file, java.lang.String escapeDigits) throws AGIException
file
- the name of the file to stream, must not include extension.escapeDigits
- contains the digits that the user is expected to
press.
AGIException
protected char getOption(AGIChannel channel, java.lang.String file, java.lang.String escapeDigits, int timeout) throws AGIException
file
- the name of the file to stream, must not include extension.escapeDigits
- contains the digits that the user is expected to
press.timeout
- the timeout in seconds to wait if none of the defined
esacpe digits was presses while streaming.
AGIException
protected int exec(AGIChannel channel, java.lang.String application) throws AGIException
application
- the name of the application to execute, for example
"Dial".
AGIException
protected int exec(AGIChannel channel, java.lang.String application, java.lang.String options) throws AGIException
application
- the name of the application to execute, for example
"Dial".options
- the parameters to pass to the application, for example
"SIP/123".
AGIException
protected int execCommand(AGIChannel channel, java.lang.String application) throws AGIException
exec(AGIChannel, String)
instead
application
- the name of the application to execute, for example
"Dial".
AGIException
protected int execCommand(AGIChannel channel, java.lang.String application, java.lang.String options) throws AGIException
exec(AGIChannel, String, String)
instead
application
- the name of the application to execute, for example
"Dial".options
- the parameters to pass to the application, for example
"SIP/123".
AGIException
protected void setContext(AGIChannel channel, java.lang.String context) throws AGIException
context
- the context for continuation upon exiting the application.
AGIException
protected void setExtension(AGIChannel channel, java.lang.String extension) throws AGIException
extension
- the extension for continuation upon exiting the
application.
AGIException
protected void setPriority(AGIChannel channel, java.lang.String priority) throws AGIException
priority
- the priority or label for continuation upon exiting the
application.
AGIException
protected void streamFile(AGIChannel channel, java.lang.String file) throws AGIException
file
- name of the file to play.
AGIException
protected char streamFile(AGIChannel channel, java.lang.String file, java.lang.String escapeDigits) throws AGIException
file
- name of the file to play.escapeDigits
- a String containing the DTMF digits that allow the
user to escape.
AGIException
protected void sayDigits(AGIChannel channel, java.lang.String digits) throws AGIException
digits
- the digit string to say.
AGIException
protected char sayDigits(AGIChannel channel, java.lang.String digits, java.lang.String escapeDigits) throws AGIException
digits
- the digit string to say.escapeDigits
- a String containing the DTMF digits that allow the
user to escape.
AGIException
protected void sayNumber(AGIChannel channel, java.lang.String number) throws AGIException
number
- the number to say.
AGIException
protected char sayNumber(AGIChannel channel, java.lang.String number, java.lang.String escapeDigits) throws AGIException
number
- the number to say.escapeDigits
- a String containing the DTMF digits that allow the
user to escape.
AGIException
protected void sayPhonetic(AGIChannel channel, java.lang.String text) throws AGIException
text
- the text to say.
AGIException
protected char sayPhonetic(AGIChannel channel, java.lang.String text, java.lang.String escapeDigits) throws AGIException
text
- the text to say.escapeDigits
- a String containing the DTMF digits that allow the
user to escape.
AGIException
protected void sayAlpha(AGIChannel channel, java.lang.String text) throws AGIException
text
- the text to say.
AGIException
protected char sayAlpha(AGIChannel channel, java.lang.String text, java.lang.String escapeDigits) throws AGIException
text
- the text to say.escapeDigits
- a String containing the DTMF digits that allow the
user to escape.
AGIException
protected void sayTime(AGIChannel channel, long time) throws AGIException
time
- the time to say in seconds since 00:00:00 on January 1, 1970.
AGIException
protected char sayTime(AGIChannel channel, long time, java.lang.String escapeDigits) throws AGIException
time
- the time to say in seconds since 00:00:00 on January 1, 1970.escapeDigits
- a String containing the DTMF digits that allow the
user to escape.
AGIException
protected java.lang.String getVariable(AGIChannel channel, java.lang.String name) throws AGIException
name
- the name of the variable to retrieve.
null
if not
set.
AGIException
protected void setVariable(AGIChannel channel, java.lang.String name, java.lang.String value) throws AGIException
name
- the name of the variable to retrieve.value
- the new value to set.
AGIException
protected char waitForDigit(AGIChannel channel, int timeout) throws AGIException
timeout
- timeout the milliseconds to wait for the channel to
receive a DTMF digit, -1 will wait forever.
AGIException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |