Re: [Asterisk-java-devel] MessageSend Action
Brought to you by:
srt
From: Jose B. <pe...@gm...> - 2014-07-30 16:11:14
|
Hehehe, adding the new action to my project was easier than I thought! Thanks Yves! import org.asteriskjava.manager.action.AbstractManagerAction; public class MessageSendAction extends AbstractManagerAction { private static final long serialVersionUID = 1L; private String to; private String from; private String body; private String body64base; private String variable; /** * Creates a new empty MessageSendAction. */ public MessageSendAction() { super(); } /** * Creates a new MessageSendAction that Send an out of call message * to an endpoint.<p> * * * @param to The URI the message is to be sent to * @param from A From URI for the message if needed for the message * technology being used to send this message * @param body The message body text. This must not contain any newlines * as that conflicts with the AMI protocol * @since 1.0 */ public MessageSendAction(String to, String from, String body) { super(); this.to = to; this.from = from; this.body = body; } @Override public String getAction() { return "MessageSend"; } /** * Returns the TO address. */ public String getTo() { return to; } /** * Returns the FROM address. */ public String getFrom() { return from; } /** * Returns the message BODY */ public String getBody() { return body; } /** * Sets the destinatin adress.<p> */ public void setTo(String to) { this.to = to; } /** * Sets the sender address.<p> */ public void setFrom(String from) { this.from = from; } /** * Sets the message body.<p> */ public void setBody(String body) { this.body = body; } } On 30 July 2014 13:39, Jose Baez <pe...@gm...> wrote: > Hello! > > I have to send SIP text messages from asterisk-java through AMI using > MessageSend action). I'll have to code a custom Action myself. > > Thanks to a previous conversation from last weeks, Yves explained it how > to make one. > > However someone might had already made that *"MessageSendAction"* and > would like to share his/her code. Anyone? ;)) > > I'm not a Java expert, so it will take some time to do it myself. I'll > post here my code when I get something useful. :)) > > > |