login | register
Sat 05 of Jul, 2008 [03:24 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Samuel, Thu 03 of Jul, 2008 [13:41 UTC]: ok thank you
  • Mats Karlsson, Thu 03 of Jul, 2008 [13:37 UTC]: Nice Samuel, will look forward to rad it.
  • bwl_fernstudent, Thu 03 of Jul, 2008 [09:08 UTC]: Your blog shows some usefull code
  • Samuel, Thu 03 of Jul, 2008 [08:04 UTC]: I'll translate it, for sure
  • Mats Karlsson, Wed 02 of Jul, 2008 [20:46 UTC]: LOL, in french! Translate it to English and I will read it.
  • Samuel, Wed 02 of Jul, 2008 [08:07 UTC]: Hello, i wrote a blog about Asterisk, speaking about installation,programming and more http://sambranche.blogspot.com/
  • Nick Barnes, Tue 01 of Jul, 2008 [17:46 UTC]: Steve - Asterisk doesn't 'fit into linux' - it's an application which runs on top of Linux.
  • Steve, Mon 30 of Jun, 2008 [18:07 UTC]: anyone know where I can find a block diagram of how asterisk fits into linux. my f'ing bosses want me to draw something up.. ugh.
  • akbar, Fri 27 of Jun, 2008 [10:37 UTC]: marley_boyz@yahoo.com how to configure call forward, call back, call pick up using TDM and asterisk 1.2.13... please help me.. thx...
  • Matthew Williams, Tue 24 of Jun, 2008 [22:37 UTC]: We are looking for Tier II VoIP Support Technicians in St Louis. Send resumes to mwilliams AT voxitas DOT com.
Server Stats
  • Execution time: 0.40s
  • Memory usage: 2.64MB
  • Database queries: 33
  • GZIP: Disabled
  • Server load: 0.66

Asterisk cmd SendText

Synopsis

Send a Text Message

Description

 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 | Applications | Functions | Variables | Expressions | Asterisk FAQ

Created by oej, Last modification by JustRumours on Wed 12 of Dec, 2007 [19:51 UTC]

Comments Filter

by Maximillian Dornseif on Thursday 01 of May, 2008 [12:20:07 UTC]
Seemingly SIPAddHeader() does not work together with SendText() in Asterisk 1.4.18.1.

Re: Yes, but does any client support it?

by Jose G. Pestana on Friday 15 of December, 2006 [02:47:47 UTC]
Hi, You say that you tested cmd SendText in a yuxin phone. I would like to know the details of these tests, for example if the text messages were displayed during a call, and if the caller had to press any button to read the text. Thanks

by mimmus on Tuesday 07 of November, 2006 [14:47:20 UTC]
With actual firmware versione (1.1.1.14), it works also with GXP-2000 Grandstream phone!

Re: Yes, but does any client support it?

by Andy on Wednesday 11 of October, 2006 [11:53:22 UTC]
UPDATE:
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?

by squitel on Monday 02 of January, 2006 [15:16:17 UTC]
I've made some tests with a few phones here:

- 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?

by Jean-Denis Girard on Saturday 19 of November, 2005 [07:32:03 UTC]
Have a look at MozPhone http://moziax.mozdev.org/
It does support send / receive text, and receive URL (send URL is includeed in send text)

Yes, but does any client support it?

by chuljin on Monday 02 of May, 2005 [18:20:16 UTC]
I've been trying for a while to find this out, with no success.

SendText, SendURL, SendImage sound 'cool', but does anyone know of any phones (hard or soft, any technology) which support them?

Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver