Re: [Asterisk-java-devel] MessageSend Action
Brought to you by:
srt
From: Yves A. <yv...@gm...> - 2014-07-30 17:32:57
|
:-) your welcome! thanks for sharing your experience! yves Am 30.07.2014 um 18:11 schrieb Jose Baez: > 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 <http://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 <http://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... > <mailto: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. :)) > > > > > > ------------------------------------------------------------------------------ > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > > > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel |