Asterisk SIP Messaging
Created by: juraj,Last modification on Tue 10 of Jun, 2008 [20:07 UTC] by joel_vandal
Asterisk SIP Messaging
For correct messaging support, there are some changes required to core. Anyways, if you require this functionality within it's limits, there's a way to do it (at least for SIP). First, you'll need Asterisk presence set-up and working from CVS HEAD. Messages are delivered according to presence hints (and not according to dialplan). If you want, you can enable queuing, which requires sqlite3 database.
After applying presence patch and configuring presence, visit this page: http://juraj.bednar.sk/work/software/asterisk/messaging/. sip_message_support.patch is a patch for chan_sip.c. On the top, choose if you want queuing support (queuing messages for delivery to devices when they become online): if you don't want queuing support, comment out the include, compile and that's all.
Otherwise, edit channels/Makefile and add -lsqlite3 to chan_sip.so CC line. Grab the chan_sip_queue* files, edit chan_sip_queue.h and set the path to the queue database (you will probably want to change that). Run chan_sip_queue_init.sh (from the channels directory, it needs chan_sip_queue.h in current directory to determine the path), which will initialize the queue (create a database and a table which will hold the queue). Compile, run and there you should go.
Tested with Xten's eyeBeam. There should probably be better delivery checking, cleaner installation, etc. Patches should be mailed to author and asterisk (at) bednar (dOt) sk.
There's also an interview http://www.sineapps.com/news.php?rssid=933 with Joshua Colp on Asterisk News page, where he mentions he is working on better messaging implementation for Google's Summer of Code. His work is availaible for download http://quark.file-radio.com/asterisk/asterisk-messaging-1.tgz, although I have no idea how it works besides what's mentioned in the interview. I hope he'll finish soon and post 1.2 asterisk will include comprehensive messaging support.
Here is a version of the patch for asterisk 1.4.0 as 1.4.0 does not support SIP/SIMPLE messaging without the patch. It has been moderately tested so use with care. http://www.sipalive.com/dev/asterisk/
You can get more details and patches (work in progress) for Asterisk (currently 1.4.20) and OpenFire (3.5) with the following extensions at ScopServ http://devel.scopserv.com/docs/im/ (Currently under development, patches will be available very soon) (2008/06/08)
- SIP MESSAGE (RFC 3428)
- SDP Extensions for SIP Instant Message Sessions
- SIP Instant Message Sessions
- SIMPLE-XMPP Gateway
Comment by oej:
Although this is a great SIP patch, it will not be included in Asterisk due to it's one-channel perspective. As Juraj says, this is a hack and proof-of-concept. There are work going on to create a multi-protocol IM and presense solution for Asterisk.
Tip
If all breaks you could at least dig warnings like the one (taken from Asterisk 1.4.9) below out of /var/log/asterisk/messages:WARNING10670: chan_sip.c:9419 receive_message: Received message to 502 <sip:1234@192.168.10.9> from <sip:@192.168.10.212>;tag=1000--849473249, dropped it...
Content-Type:text/plain
Message: This was a test message.
See also
- Asterisk cmd SendText
- Asterisk call notification
- Sipsak
- Asterisk Jabber
- Asterisk presence
- receive text: AGI command
Comments
333not worrking
Sep 18 12:02:27 WARNING2722: chan_sip.c:7545 receive_message: Received message to "222"<sip:222@voip.ung.ac.id> from "Iwan"<sip:555@voip.ung.ac.id>;tag=91435f6e, dropped it...
Content-Type:text/html
Message: <FONT face=Arial size=2>test</FONT>
can you help me please
333Jurai patch updated.
I've notified Jurai, in the meanwhile you can get it here: http://www.rlyeh.it/tmp/sip_message_support_1.2.5.patch.gz (this is only the diff file, you must download the other files from Jurai's site).
If I've missed some other working alternatives or upgrades to Asterisk, please le me know! :)