Asterisk-Java

org.asteriskjava.fastagi.command
Class GosubCommand

java.lang.Object
  extended by org.asteriskjava.fastagi.command.AbstractAgiCommand
      extended by org.asteriskjava.fastagi.command.GosubCommand
All Implemented Interfaces:
Serializable, AgiCommand

public class GosubCommand
extends AbstractAgiCommand

Calls a subroutine from dialplan.

Example return code: 200 result=0 Gosub complete

This command is available since Asterisk 1.6.

Since:
1.0.0
Author:
fadishei
See Also:
Serialized Form

Constructor Summary
GosubCommand(String context, String extension, String priority)
          Creates a new GosubCommand.
GosubCommand(String context, String extension, String priority, String... arguments)
          Creates a new GosubCommand.
 
Method Summary
 String buildCommand()
          Returns a string suitable to be sent to asterisk.
 String[] getArguments()
          Returns the arguments to be passed to the subroutine.
 String getContext()
          Returns the context of the subroutine to call.
 String getExtension()
          Returns the extension within the called context.
 String getPriority()
          Returns the priority of the called extension.
 void setArguments(String[] arguments)
          Sets the arguments to be passed to the subroutine.
 void setContext(String context)
          Sets the context of the subroutine to call.
 void setExtension(String extension)
          Sets the extension within the called context.
 void setPriority(String priority)
          Sets the priority of the called extension.
 
Methods inherited from class org.asteriskjava.fastagi.command.AbstractAgiCommand
escapeAndQuote, escapeAndQuote, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GosubCommand

public GosubCommand(String context,
                    String extension,
                    String priority)
Creates a new GosubCommand.

Parameters:
context - context of the called subroutine.
extension - the extension in the called context.
priority - of the called extension.

GosubCommand

public GosubCommand(String context,
                    String extension,
                    String priority,
                    String... arguments)
Creates a new GosubCommand.

Parameters:
context - context of the called subroutine.
extension - the extension in the called context.
priority - the priority of the called extension.
arguments - the arguments to be passed to the called subroutine.
Method Detail

getContext

public String getContext()
Returns the context of the subroutine to call.

Returns:
the context of the subroutine to call.

setContext

public void setContext(String context)
Sets the context of the subroutine to call.

Parameters:
context - the context of the subroutine to call.

getExtension

public String getExtension()
Returns the extension within the called context.

Returns:
the extension within the called context.

setExtension

public void setExtension(String extension)
Sets the extension within the called context.

Parameters:
extension - the extension within the called context.

getPriority

public String getPriority()
Returns the priority of the called extension.

Returns:
the priority of the called extension.

setPriority

public void setPriority(String priority)
Sets the priority of the called extension.

Parameters:
priority - the priority of the called extension.

getArguments

public String[] getArguments()
Returns the arguments to be passed to the subroutine.

Returns:
the arguments to be passed to the subroutine.

setArguments

public void setArguments(String[] arguments)
Sets the arguments to be passed to the subroutine.

Parameters:
arguments - the arguments to be passed to the subroutine.

buildCommand

public String buildCommand()
Description copied from interface: AgiCommand
Returns a string suitable to be sent to asterisk.

Specified by:
buildCommand in interface AgiCommand
Specified by:
buildCommand in class AbstractAgiCommand
Returns:
a string suitable to be sent to asterisk.

Asterisk-Java

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