Class AsteriskOriginator
- java.lang.Object
-
- org.opennms.netmgt.asterisk.utils.AsteriskOriginator
-
public class AsteriskOriginator extends Object
Originates a call using the Asterisk Manager API- Version:
- $Id: $
- Author:
- Jeff Gehlbach
-
-
Constructor Summary
Constructors Constructor Description AsteriskOriginator()Default constructor.AsteriskOriginator(Properties amiProps)Constructor for AsteriskOriginator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.asteriskjava.manager.action.OriginateActionbuildOriginateAction()Build a complete OriginateAction ready for dispatching.StringgetAmiHost()getAmiHostPropertiesgetAmiProps()This returns the properties configured in the asterisk-configuration.properties file.StringgetCallerId()getCallerIdStringgetChannelVariable(String name)Retrieves a named channel variable for the originated callMap<String,String>getChannelVariables()Retrieves a Map of channel variables for the originated callStringgetLegAChannel()getLegAChannelStringgetLegAExtension()getLegAExtensionStringgetMessageText()getMessageTextStringgetSubject()getSubjectbooleanisDebug()isDebugvoidoriginateCall()Originates a call based on properties set on this bean.voidsetAmiHost(String amiHost)setAmiHostvoidsetCallerId(String cid)setCallerIdvoidsetChannelVariable(String name, String value)Sets a variable on the channel used for the originated callvoidsetDebug(boolean debug)setDebugvoidsetLegAChannel(String chan)setLegAChannelvoidsetLegAExtension(String exten)setLegAExtensionvoidsetMessageText(String messageText)setMessageTextvoidsetSubject(String subject)setSubject
-
-
-
Constructor Detail
-
AsteriskOriginator
public AsteriskOriginator(Properties amiProps) throws AsteriskOriginatorException
Constructor for AsteriskOriginator.
- Parameters:
amiProps- aPropertiesobject.- Throws:
AsteriskOriginatorException- if any.
-
AsteriskOriginator
public AsteriskOriginator() throws AsteriskOriginatorExceptionDefault constructor. Default properties from asterisk-properties are set into session.- Throws:
AsteriskOriginatorException- if any.
-
-
Method Detail
-
originateCall
public void originateCall() throws AsteriskOriginatorExceptionOriginates a call based on properties set on this bean.- Throws:
AsteriskOriginatorException- if any.
-
buildOriginateAction
public org.asteriskjava.manager.action.OriginateAction buildOriginateAction() throws AsteriskOriginatorExceptionBuild a complete OriginateAction ready for dispatching.- Returns:
- completed OriginateAction, ready to be passed to ManagerConnection.sendAction
- Throws:
AsteriskOriginatorException- if any of the underlying operations fail
-
getCallerId
public String getCallerId()
getCallerId
- Returns:
- Returns the Caller ID
-
setCallerId
public void setCallerId(String cid)
setCallerId
- Parameters:
cid- The from address to set.
-
getAmiHost
public String getAmiHost()
getAmiHost
- Returns:
- Returns the AMI host.
-
setAmiHost
public void setAmiHost(String amiHost) throws UnknownHostException
setAmiHost
- Parameters:
amiHost- Sets the mail host.- Throws:
UnknownHostException- if any.
-
getMessageText
public String getMessageText()
getMessageText
- Returns:
- Returns the message text.
-
setMessageText
public void setMessageText(String messageText)
setMessageText
- Parameters:
messageText- Sets the message text.
-
getSubject
public String getSubject()
getSubject
- Returns:
- Returns the message Subject.
-
setSubject
public void setSubject(String subject)
setSubject
- Parameters:
subject- Sets the message Subject.
-
getLegAExtension
public String getLegAExtension()
getLegAExtension
- Returns:
- Returns the extension for Leg A
-
setLegAExtension
public void setLegAExtension(String exten)
setLegAExtension
- Parameters:
exten- Sets the extension for Leg A
-
getLegAChannel
public String getLegAChannel()
getLegAChannel
- Returns:
- Returns the channel for Leg A
-
setLegAChannel
public void setLegAChannel(String chan)
setLegAChannel
- Parameters:
chan- Sets the channel for Leg A
-
isDebug
public boolean isDebug()
isDebug
- Returns:
- a boolean.
-
setDebug
public void setDebug(boolean debug)
setDebug
- Parameters:
debug- a boolean.
-
getAmiProps
public Properties getAmiProps()
This returns the properties configured in the asterisk-configuration.properties file.- Returns:
- a
Propertiesobject.
-
setChannelVariable
public void setChannelVariable(String name, String value)
Sets a variable on the channel used for the originated call- Parameters:
name- Name of variable to setvalue- Value to set for variable
-
getChannelVariables
public Map<String,String> getChannelVariables()
Retrieves a Map of channel variables for the originated call- Returns:
- A Map of channel variable names and values
-
-