public class MessageSendAction extends AbstractManagerAction
Constructor and Description |
---|
MessageSendAction() |
Modifier and Type | Method and Description |
---|---|
String |
getAction()
Returns the name of the action for example "Hangup".
|
String |
getBase64body()
Retrieves content encoded in base64
|
String |
getBody()
Content of the message in plain text ascii
Please consider to use getBase64Body instead to avoid encoding problems
|
String |
getFrom()
get From String
|
String |
getTo()
Retrives destination of message
|
Map<String,String> |
getVariables()
Returns the variables to set on the originated call.
|
void |
setBase64body(String base64body)
Sets the content of the message body encode in base64
MessageSendAction sipSendMessage = new MessageSendAction();
sipSendMessage.setTo("sip:phoneuserid");
sipSendMessage.setVariable("Content-Type", "text/plain");
sipSendMessage.setVariable("P-hint", "usrloc applied");
sipSendMessage.setActionId(UUID.randomUUID().toString());
sipSendMessage.setBase64body(new String(Base64.encodeBase64(message.getBytes("UTF-8")), "UTF-8"));
|
void |
setBody(String body)
Sets the content of the message
Please consider to use setBase64Body instead to avoid encoding problems
|
void |
setFrom(String from)
set From String
|
void |
setTo(String to)
Set destination of message
|
void |
setVariable(String name,
String value)
Sets an variable on the originated call.
|
getActionId, setActionId, toString
public String getAction()
ManagerAction
getAction
in interface ManagerAction
getAction
in class AbstractManagerAction
public Map<String,String> getVariables()
public void setVariable(String name, String value)
name
- the name of the variable to set.value
- the value of the variable to set.public String getTo()
public void setTo(String to)
to
- String in format like sip:useridpublic String getFrom()
public void setFrom(String from)
String
- from in form like sip:asterisk@server-ippublic String getBody()
public void setBody(String body)
body
- String with plain ascii contentpublic String getBase64body()
public void setBase64body(String base64body)
MessageSendAction sipSendMessage = new MessageSendAction();
sipSendMessage.setTo("sip:phoneuserid");
sipSendMessage.setVariable("Content-Type", "text/plain");
sipSendMessage.setVariable("P-hint", "usrloc applied");
sipSendMessage.setActionId(UUID.randomUUID().toString());
sipSendMessage.setBase64body(new String(Base64.encodeBase64(message.getBytes("UTF-8")), "UTF-8"));
base64body
- Copyright © 2004–2020. All rights reserved.