Synopsis
Send a Text MessageDescription
SendText(text)Send text to the client on the connected channel.
This application accepts a text string as argument and attempts to send it to the calling client via the sendtext function of the channel driver.
See the channel driver documentation for support of text. In Asterisk SIP, for example, sendtext is implemented via the SIP MESSAGE method, sending payload data in the signalling messages with content type text/plain. This means any SIP phone that implements the SIP MESSAGE method should be supported.
The application does not encode characters in any special way, it simply passes the given text buffer to the channel driver service routine.
Example
exten => 123, 1, Answer
exten => 123, 2, SendText(hello world)
exten => 123, 3, HangUp
NOTE: The Answer step at priority 1 is needed, since the channel need to be established before anything can be sent on it. Look at auto-answer mode on your phone, possibly together with an Asterisk .call file (or SIPSAK) to send text messages from a remote device or process.
This command was added to the development (CVS) edition of Asterisk on 2004-04-07. It does exist at least in some versions of the Asterisk 1.0 branch, e.g. in 1.0.6.
Receiving text with Asterisk
Asterisk does not have a ReceiveText() dialplan application, however here is how you can send and receive text using an AGI script:print STDERR "1. Testing 'sendtext'...";
print "SEND TEXT \"hello world\"\n";
my $result = <STDIN>;
&checkresult($result);
print STDERR "2. Receiving Text 'receivetext'...";
print "RECEIVE TEXT 3000\n";
my $result = <STDIN>;
&checkresult($result);
SNOM phones
When 123 (see example above) is called on a SNOM phone, you should hangup and the Message Waiting Indicator lamp will start blinking. The screen will indicate "SMS". Press the SMS softkey (snom190) or the Message button (snom 320/360) and the screen will display the message, shown to originate from 123. On the snom 320 you have 2x24 characters minus the Caller ID/ Called extension to display the message; scrolling is not possible. Apparently the snom 190 show the sms only if it is less than 9 char long.See the SNOM FAQ entry for more on this topic.
Firmware 7 The XML Minibrowser is now also implemented for SNOM 320 and 300 (next to 370 and 360).
Firmware 4.0 & 4.1 Now it works even the SIPSAK option "-O desktop", just set the phone settings "Support broken registrar" to "on" and "Long SIP-Contact (RFC3840)" to "off" and "Refer-To Brackets" to "off". but off course it will only work after the call is answered. If you don't want this use SIPSAK via System() or TrySytem() in Asterisk to send a message.
Firmware 3.60r: Partial success together with Asterisk 1.0.2bristuffed and a SNOM line set to auto-answer mode: Depending on the line's SIP setting "Support broken registrar" the SNOM 360 will either reply with "404 Not Found" (broken registrar OFF) or "200 Ok" (broken registrar ON) in combination with Asterisk's SendText() application. SIPSAK also works, but only when the option "-O desktop" is not used.
Firmware 3.60i: Although above example gives the desired result of displaying the message, the recent revisions (3.60i) of SNOM phone firmware have a protocol bug, they sent a misformulated 200 OK response back to the server.
Firmware 3.56y: The snom200 phone does not implement receiving a MESSAGE request within a dialog. It returns a "501 Not Implemented" message, although you can send out-of-dialog MESSAGE requests successfully.
Cisco Phones
With chan_sccp2 version 20051019 SendText is supported.Alternative approaches
- Create a custom SIP header with SIPAddHeader and carry your text within, read it it with SIP_HEADER
- Use the IAX2 patch 7619 that can carry variables from Asterisk to Asterisk
- In case of two Asterisk boxes connected through an analog line: Use SendDTMF and Read and encode your text as DTMF - for a related (non-Asterisk) solution check out MF TeleType
- Use Asterisk's SMS application to send and receive short messages
See also
- Asterisk text: Overview which channels support what type of text messages
- Asterisk cmd SendUrl
- Asterisk cmd SendImage
- Asterisk cmd SMS: Send a SMS (GSM) message
- Asterisk phone snom: How to use SIPSAK to transmit a SIP MESSAGE to a SNOM phone
- Asterisk unistim channels: Sendtext support for Nortel phones
- Asterisk call notification: Send notifcation messages using smbclient, ICQ, Jabber etc.
- Asterisk SIP Messaging: Patch for receiving SIP/SIMPLE messages (proof-of-concept)
- receive text: AGI command
- Sipsak
- Asterisk Jabber
Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ
Page Changes
Re: Yes, but does any client support it?
Re: Yes, but does any client support it?
GXP-2000 with latest stable firmware (1.1.1.14) now support it.
My question, any way of sending text to the person RECEIVING the call, not originating it?
Re: Yes, but does any client support it?
- Cisco 7940/7960 : nothing displayed
- Grandstream GXP-2000 : nothing displayed
- Yuxin YWH200 : text correctly displayed
- Yuxin YWH500 : text correctly displayed (http://www.yntx.com)
- X-Lite : nothing displayed
SendURL however produced no effect on any of these phones...
Re: Yes, but does any client support it?
It does support send / receive text, and receive URL (send URL is includeed in send text)
Yes, but does any client support it?
SendText, SendURL, SendImage sound 'cool', but does anyone know of any phones (hard or soft, any technology) which support them?