Asterisk-Java

org.asteriskjava.fastagi.internal
Class AgiRequestImpl

java.lang.Object
  extended by org.asteriskjava.fastagi.internal.AgiRequestImpl
All Implemented Interfaces:
AgiRequest

public class AgiRequestImpl
extends java.lang.Object
implements AgiRequest

Default implementation of the AGIRequest interface.

Version:
$Id: AgiRequestImpl.java 1287 2009-04-04 09:48:03Z srt $
Author:
srt

Method Summary
 java.lang.String getAccountCode()
          Returns the account code set for the call.
 java.lang.String[] getArguments()
          Returns the array of arguments passed from the AGI dialplan command.
 java.lang.String getCallerId()
          Returns the Caller*ID number, for example "1234".
 java.lang.String getCallerIdName()
          Returns the the Caller*ID Name, for example "John Doe".
 java.lang.String getCallerIdNumber()
          Returns the Caller*ID number, for example "1234".
 java.lang.Integer getCallingAni2()
          Returns the Callerid ANI 2 (Info digits).
 java.lang.Integer getCallingPres()
          Returns the Callerid presentation/screening.
 java.lang.Integer getCallingTns()
          Returns the Callerid Transit Network Select.
 java.lang.Integer getCallingTon()
          Returns the Callerid Type of Number.
 java.lang.String getChannel()
          Returns the name of the channel.
 java.lang.String getContext()
          Returns the context in the dial plan from which the AGI script was called.
 java.lang.String getDnid()
          Returns the number, that has been dialed by the user.
 java.lang.Boolean getEnhanced()
          Returns wheather this agi is passed audio (EAGI - Enhanced AGI).
 java.lang.String getExtension()
          Returns the extension in the dial plan from which the AGI script was called.
 java.lang.String getLanguage()
          Returns the language set for the current channel, for example "en".
 java.net.InetAddress getLocalAddress()
          Returns the local address this channel, that is the IP address of the AGI server.
 int getLocalPort()
          Returns the local port of this channel, that is the port the AGI server is listening on.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of a request parameter as a String, or null if the parameter does not exist.
 java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
          Returns a Map of the parameters of this request.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns an array of String objects containing all of the values the given request parameter has, or an empty array if the parameter does not exist.
 java.lang.Integer getPriority()
          Returns the priority of the dial plan entry the AGI script was called from.
 java.lang.String getRdnis()
          If this call has been forwared, the number of the person doing the redirect is returned (Redirected dialed number identification service).
 java.net.InetAddress getRemoteAddress()
          Returns the remote address of this channel, that is the IP address of the Asterisk server.
 int getRemotePort()
          Returns the remote port of this channel, that is the client port the Asterisk server is using for the AGI connection.
 java.util.Map<java.lang.String,java.lang.String> getRequest()
          Returns a Map containing the raw request name/value pairs.
 java.lang.String getRequestURL()
          Returns the full URL of the request in the form agi://host[:port][/script].
 java.lang.String getScript()
          Returns the name of the script to execute.
 java.lang.String getType()
          Returns the type of the channel, for example "SIP".
 java.lang.String getUniqueId()
          Returns the unqiue id of the channel.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getRequest

public java.util.Map<java.lang.String,java.lang.String> getRequest()
Description copied from interface: AgiRequest
Returns a Map containing the raw request name/value pairs.

Specified by:
getRequest in interface AgiRequest
Returns:
Map contain raw request name/value pairs.

getScript

public java.lang.String getScript()
Returns the name of the script to execute.

Specified by:
getScript in interface AgiRequest
Returns:
the name of the script to execute.

getRequestURL

public java.lang.String getRequestURL()
Returns the full URL of the request in the form agi://host[:port][/script].

Specified by:
getRequestURL in interface AgiRequest
Returns:
the full URL of the request in the form agi://host[:port][/script].

getChannel

public java.lang.String getChannel()
Returns the name of the channel.

Specified by:
getChannel in interface AgiRequest
Returns:
the name of the channel.

getUniqueId

public java.lang.String getUniqueId()
Returns the unqiue id of the channel.

Specified by:
getUniqueId in interface AgiRequest
Returns:
the unqiue id of the channel.

getType

public java.lang.String getType()
Description copied from interface: AgiRequest
Returns the type of the channel, for example "SIP".

Specified by:
getType in interface AgiRequest
Returns:
the type of the channel, for example "SIP".

getLanguage

public java.lang.String getLanguage()
Description copied from interface: AgiRequest
Returns the language set for the current channel, for example "en".

Specified by:
getLanguage in interface AgiRequest
Returns:
the language set for the current channel, for example "en".

getCallerId

public java.lang.String getCallerId()
Description copied from interface: AgiRequest
Returns the Caller*ID number, for example "1234".

Note: even with Asterisk 1.0 is contains only the numerical part of the Caller ID.

Specified by:
getCallerId in interface AgiRequest
Returns:
the Caller*ID number, for example "1234", if no Caller*ID is set or it is "unknown" null is returned.

getCallerIdNumber

public java.lang.String getCallerIdNumber()
Description copied from interface: AgiRequest
Returns the Caller*ID number, for example "1234".

Note: even with Asterisk 1.0 is contains only the numerical part of the Caller ID.

Specified by:
getCallerIdNumber in interface AgiRequest
Returns:
the Caller*ID number, for example "1234", if no Caller*ID is set or it is "unknown" null is returned.

getCallerIdName

public java.lang.String getCallerIdName()
Description copied from interface: AgiRequest
Returns the the Caller*ID Name, for example "John Doe".

Specified by:
getCallerIdName in interface AgiRequest
Returns:
the the Caller*ID Name, for example "John Doe", if no Caller*ID Name is set or it is "unknown" null is returned.

getDnid

public java.lang.String getDnid()
Description copied from interface: AgiRequest
Returns the number, that has been dialed by the user.

Specified by:
getDnid in interface AgiRequest
Returns:
the dialed number, if no DNID is available or it is "unknown" null is returned.

getRdnis

public java.lang.String getRdnis()
Description copied from interface: AgiRequest
If this call has been forwared, the number of the person doing the redirect is returned (Redirected dialed number identification service).

This is usally only only available on PRI.

Specified by:
getRdnis in interface AgiRequest
Returns:
the number of the person doing the redirect, , if no RDNIS is available or it is "unknown" null is returned.

getContext

public java.lang.String getContext()
Description copied from interface: AgiRequest
Returns the context in the dial plan from which the AGI script was called.

Specified by:
getContext in interface AgiRequest
Returns:
the context in the dial plan from which the AGI script was called.

getExtension

public java.lang.String getExtension()
Description copied from interface: AgiRequest
Returns the extension in the dial plan from which the AGI script was called.

Specified by:
getExtension in interface AgiRequest
Returns:
the extension in the dial plan from which the AGI script was called.

getPriority

public java.lang.Integer getPriority()
Description copied from interface: AgiRequest
Returns the priority of the dial plan entry the AGI script was called from.

Specified by:
getPriority in interface AgiRequest
Returns:
the priority of the dial plan entry the AGI script was called from.

getEnhanced

public java.lang.Boolean getEnhanced()
Description copied from interface: AgiRequest
Returns wheather this agi is passed audio (EAGI - Enhanced AGI).

Enhanced AGI is currently not supported on FastAGI.

Specified by:
getEnhanced in interface AgiRequest
Returns:
Boolean.TRUE if this agi is passed audio, Boolean.FALSE otherwise.

getAccountCode

public java.lang.String getAccountCode()
Description copied from interface: AgiRequest
Returns the account code set for the call.

Specified by:
getAccountCode in interface AgiRequest
Returns:
the account code set for the call.

getCallingAni2

public java.lang.Integer getCallingAni2()
Description copied from interface: AgiRequest
Returns the Callerid ANI 2 (Info digits).

Available since Asterisk 1.2.

Specified by:
getCallingAni2 in interface AgiRequest
Returns:
the Callerid ANI 2 (Info digits).

getCallingPres

public java.lang.Integer getCallingPres()
Description copied from interface: AgiRequest
Returns the Callerid presentation/screening.

Available since Asterisk 1.2.

Specified by:
getCallingPres in interface AgiRequest
Returns:
the Callerid presentation/screening.

getCallingTns

public java.lang.Integer getCallingTns()
Description copied from interface: AgiRequest
Returns the Callerid Transit Network Select.

Available since Asterisk 1.2.

Specified by:
getCallingTns in interface AgiRequest
Returns:
the Callerid Transit Network Select.

getCallingTon

public java.lang.Integer getCallingTon()
Description copied from interface: AgiRequest
Returns the Callerid Type of Number.

Available since Asterisk 1.2.

Specified by:
getCallingTon in interface AgiRequest
Returns:
the Callerid Type of Number.

getParameter

public java.lang.String getParameter(java.lang.String name)
Description copied from interface: AgiRequest
Returns the value of a request parameter as a String, or null if the parameter does not exist. You should only use this method when you are sure the parameter has only one value.

If the parameter might have more than one value, use AgiRequest.getParameterValues(String).

If you use this method with a multivalued parameter, the value returned is equal to the first value in the array returned by getParameterValues.

Specified by:
getParameter in interface AgiRequest
Parameters:
name - a String containing the name of the parameter whose value is requested.
Returns:
a String representing the single value of the parameter.
See Also:
AgiRequest.getParameterValues(String)

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface: AgiRequest
Returns an array of String objects containing all of the values the given request parameter has, or an empty array if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.

Specified by:
getParameterValues in interface AgiRequest
Parameters:
name - a String containing the name of the parameter whose value is requested.
Returns:
an array of String objects containing the parameter's values.

getParameterMap

public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
Description copied from interface: AgiRequest
Returns a Map of the parameters of this request.

Specified by:
getParameterMap in interface AgiRequest
Returns:
a java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array.

getArguments

public java.lang.String[] getArguments()
Description copied from interface: AgiRequest
Returns the array of arguments passed from the AGI dialplan command.

Example: AGI(agi://localhost/HelloWorld,value1,,value2) results in getArguments()[0] = "value1", getArguments()[1] = null and getArguments()[2] = "value2".

Available since Asterisk 1.6

Specified by:
getArguments in interface AgiRequest
Returns:
the array of arguments passed from the AGI command, never null.

getLocalAddress

public java.net.InetAddress getLocalAddress()
Description copied from interface: AgiRequest
Returns the local address this channel, that is the IP address of the AGI server.

Specified by:
getLocalAddress in interface AgiRequest
Returns:
the local address this channel.

getLocalPort

public int getLocalPort()
Description copied from interface: AgiRequest
Returns the local port of this channel, that is the port the AGI server is listening on.

Specified by:
getLocalPort in interface AgiRequest
Returns:
the local port of this socket channel.

getRemoteAddress

public java.net.InetAddress getRemoteAddress()
Description copied from interface: AgiRequest
Returns the remote address of this channel, that is the IP address of the Asterisk server.

Specified by:
getRemoteAddress in interface AgiRequest
Returns:
the remote address of this channel.

getRemotePort

public int getRemotePort()
Description copied from interface: AgiRequest
Returns the remote port of this channel, that is the client port the Asterisk server is using for the AGI connection.

Specified by:
getRemotePort in interface AgiRequest
Returns:
the remote port of this channel.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Asterisk-Java

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