SMS (cell phone text) Messaging

SMS (cell phone text) Messaging

by Chris Morgan -
Number of replies: 49

Has anyone managed to interface Moodle with SMS, the cell phone text messaging service. There is considerable use of it in the UK and many of our tutors want to be able to contact their students in this way.

Thanks,

Chris Morgan

Average of ratings: Useful (3)
In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Gavin McCullagh -
Hi,

At the Irish Moodle Moot there was a presentation on a system being developed by the RCSI.

http://www.moodlemoot.ie/course/view.php?id=2

4. "Acting on a Decision", Royal College Surgeons of Ireland

They say they are going to release the code for it.

Gavin
In reply to Gavin McCullagh

Re: SMS (cell phone text) Messaging

by Sigurdur Jonsson -

Hi,

Looks great. Do you know the status of the project, is it production ready? I'm very much looking forward to be able to implement something like this.

regards,

S.Fjalar

In reply to Sigurdur Jonsson

Re: SMS (cell phone text) Messaging

by Gavin McCullagh -
You'd have to ask them.  We have asked for the code but as yet have not seen it.  It was announced that it was being open sourced at that meeting.

Gavin
In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Janne Mikkonen -
I've implemented SMS interface on this project and actually it also uses glossary entries ( send them to participants if filtering word is matched ).

I'm going to release that SMS library as soon as I can ( including SMS http API's to kannel, Clickatell and NowSMS gateways).

- Janne -
In reply to Janne Mikkonen

Re: SMS (cell phone text) Messaging

by Janne Mikkonen -

And here it is! The first version of SMS library for Moodle.

Supporting:

  • Kannel Gateway ( Open Source solution ).
  • NowSMS Gateway ( commercial, but there is a 60 day trial ) supporting MMS messages also.
  • Clickatell service.

Todo list:

  • UTF-8 support (working one).
  • Better error handling.
  • Better phone number checking and cleaning.
  • Better settings checking.

- Janne -

In reply to Janne Mikkonen

Re: SMS (cell phone text) Messaging

by Martín Langhoff -
Interesting! We use Kannel over here too wink Is it in contrib?
In reply to Martín Langhoff

Re: SMS (cell phone text) Messaging

by Janne Mikkonen -
No it isn't...

Do you use mbuni also? I almost got it working. It's sending information of received MMS message but the phone doesn't seem to know how to get the message ( I've tried all possible configurations in my phone ). So possibly it's combination of my mbuni configuration and my phone configuration and haven't found any reasonable documentation from mbuni.org's site ( all of user mailing list achives seems to go straight to dead end ).

It just would be nice to add MMS support to kannel class.

- Janne -
In reply to Janne Mikkonen

Re: SMS (cell phone text) Messaging

by Josiah Pease -
Damn,
I've just reinvented the wheel.
I implemented a system based on this thread
With clickatell (http) support, but modular.
So people had the option to SMS via messageselect.php
Have you any idea if/when your code will get into the core CVS ?

Josiah.
In reply to Janne Mikkonen

Re: SMS (cell phone text) Messaging

by Paolo Diprox -
Hi guys, I just saw this topic today,
I've been working with sms gateways for about 1 year now, and i set up a service called quebby (http://www.quebbyworld.com/). I integrated the sms gatway both with mobile java phones, web, windows, and facebook.
My university use moodle and wants an sms service too, so i will take a look at the sms library and try to integrate it with quebby.
Cheers.
In reply to Janne Mikkonen

Re: SMS (cell phone text) Messaging

by Tim King -

I apologise for this blatant commercial approach!

I represent a text messaging company, 2sms. We have been asked by a UK customer to add SMS to Moodle. Might you consider adding the 2sms SMS web services at http://www.2sms.com/WebServices/1.2/SMSService.asmx?WSDL to your project. Could we work together to build something for the community. While we are a commerical organisation, we could conceptually pass some sales revenue back to Moodle to help support them.

Tim.

In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Ludo (Marc Alier) -
Hi,
in Las Moodlemot 05 spain somebody presented a development of SMS bridge in moodle. Soon will be the presentations online.
Ludo
In reply to Ludo (Marc Alier)

Re: SMS (cell phone text) Messaging

by Felipe Pablos -
We are very interested in this module. We want to know how is it and if we have to purchase some phone service. Thanks
In reply to Felipe Pablos

Re: SMS (cell phone text) Messaging

by John Doe II -

I have developed an integration of Moodle with SMS services. Basically, for now it works with 2 activity modules: forums and choice.

1. Forum module

The administrator or teacher can decide to send a post also via SMS; the SMS is sent only to subscribed users.

3. Choice module

The administrator or teacher can send an SMS to all users who answered a choice question. (We need this one as we use choice for exam subscription, and we like to have the possibility to communicate just-in-time the room and eventual changes in time or date)

I attach a sample of both interfaces.

If you need more info, I can write more.

Cheers.

Attachment sms.JPG
In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Josep M. Fontana -
This will need to work in conjunction with some kind of SMS server, right?
I'd be interested in using something like this. What would I need in addition to the code you have developped?

Josep M.
In reply to Josep M. Fontana

Re: SMS (cell phone text) Messaging

by John Doe II -

Yes of course. I have an SMS provider who provides me with a gateway where I pass all the data for SMS post.

Basically, after collecting and cleaning up all the relevant data (students' phone numbers, the text message to send) I pass it to the SMS provider via a fsocket with somethin like this:

                $qs = array();

                foreach ($smsfields as $k => $v)
                        $qs[] = $k.'='.urlencode($v);
                $qs = join('&', $qs);

                $errno = $errstr = '';
                $host='***.***.com'; // I'm hidding here the SMS provider's address
                $url='/sms/batch.php';
                if ($fp = @fsockopen($host, 80, $errno, $errstr,30))
                {
                fputs($fp, "POST ".$url." HTTP/1.0\r\n");
                fputs($fp, "Host: ".$host."\r\n");
                fputs($fp, "User-Agent: PHP/".phpversion()."\r\n");
                fputs($fp,"Content-Type:application/x-www-form-urlencoded\r\n")
                fputs($fp, "Content-Length: ".strlen($qs)."\r\n");
                fputs($fp, "Connection: close\r\n");
                fputs($fp, "\r\n".$qs);

                $content = '';
                while (!feof($fp))
                        $content .= fgets($fp, 1024);

                fclose($fp);

                print "<br><br><b>SMS status: " .  preg_replace("/^.*?\r\n\r\n/s", '', $content) . "</b>";
                }

If you need me to comment more on this, let me know.

Cheers.

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Darren Smith -
How much does this cost? The SMS provider that is. Do you pay by text or, say, monthly?

Thanks in advance,

Darren
In reply to Darren Smith

Re: SMS (cell phone text) Messaging

by John Doe II -

By SMS. I pay 0,045 per each SMS.

This means if I have 50 students subscribed for a forum, and I decide to send an SMS, I pay   2,25.

It's not much, it depends how and what are you using it for .

Besides, maybe in your country there are cheaper providers and better pricing schemes for mass-smsing.

Ciao.

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Chris Jeffries -

It sound to me like we should urgently (unless I have missed it and we already have) define an interface standard in Moodle for sending (and perhaps for receiving) SMS.

I am thinking of a function call of the form

sendsms($providername, $phonenumbers[], $message);

This then forwards the call to a  function called send() in a file called

something like sms.php in a folder called $providername in rather the same way that many other exntensible parts of Moodle are handled.

This way, we can each add a module for the sms service provider we use, and module writers can link to SMS through a common interface.

In reply to Chris Jeffries

Re: SMS (cell phone text) Messaging

by Dan Stowell -
V good suggestion. The functions should be named according to moodle's conventions, though. I'd suggest that 'sendsms()' should be 'sms_send()' and 'send()' should be 'sms_provider_send()'.

The sms_send() could perhaps go in /lib/sms.php - but where would you suggest the provider-specific files should go? In a new root folder /sms, perhaps?
In reply to Dan Stowell

Re: SMS (cell phone text) Messaging

by Chris Jeffries -

Yes, a root folder seems the obvious place. That's where /rss is.

In hindsight, perhaps there should have been a moodle/interfaces folder to contain rss, sms etc.

In reply to Chris Jeffries

Re: SMS (cell phone text) Messaging

by John Doe II -

Hi Chris,

I'm not sure that is something you can standardise. As far as I know, different "SMS providers" offer different protocols and ways to send data to their service: some offer just a http access, others use Web services, etc.

So, yes, you can have a proto of the function you suggest, but what's inside pretty much depends on the carrier you're using.

Receiving SMS is a completely different issue. Here you don't need to use an SMS provider. A specific modem is just enough (in poor words: a mobile-phone connected to a server). Then you need to workout the protocol between the modem and the server, but it all depends on what kind of interactivity do you need.

Cheers.

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Davide Casella -

Hi John,

can you tell me your sms provider's name? Is it an Italian Provider?

I'm interested in this solutions for my FaD applications.

Thanks

Ciao

Davide

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Dan Stowell -
I think you've misunderstood Chris's point. His point is that every time someone writes a script to connect Moodle to their specific SMS provider, the script that they write can do whatever it likes (http, web services) but it should present exactly the same set of PHP functions for Moodle to hook into.

That way, these connections can be interchangeable, and there can in future be a standard way for Moodle scripts to send SMSes, without having to worry about the details of the exact SMS provider being used.
In reply to John Doe II

Re: SMS (cell phone text) Messaging * ICQ Gateway

by daniel ginerman -
Shalom 2all,
Just discovered this "already old" thread... the SMS involvement for moodle's forums interests me since the very first moment (we deliver live online lectures, and send a reminder trhough the "news forum" of the respective course an hour before every lecture; and we are very very interested in performing these reminders also via SMS - not only that, we'd like to have the possiblity of sending SMS issue reminders from inside the calendar too).
An innocent question from a non-programmer still creator: has anybody got into the possibility of using the ICQ gateway (or something alike)? From inside ICQ, you can send SMS without any problem to most cellular networks of many countries.
besides.... has anybody succeded to advance a bit more in this topic?
thanx in advance,

daniEl
In reply to daniel ginerman

Re: SMS (cell phone text) Messaging * ICQ Gateway

by Tony Hursh -
There's a list of free (to the sender) email to SMS gateways here that may be useful to those who are interested in this:

http://en.wikipedia.org/wiki/SMS_gateways

Most of the ones listed are in the US and Canada, but there are a few in other countries (of course, it's a Wikipedia page, so it's easy enough to add your own).

These are run by the carriers themselves and only work with phone numbers handled by that carrier, so you have the problem of associating a number with a carrier. That's sort of tricky in areas where people are allowed to keep the same number when they switch carriers. You'd also need to have them select their carrier and update it if they changed.

There's a slightly dodgy way of getting around that problem that I read about a while back (note that I'm not recommending this). You just send a test email to at all possible carriers, then monitor for bounce messages. The one that doesn't bounce is presumed to be the good one, and you save it in database entry for that number.

As I said, it's a little shady... it's not too much of a load if you only do it one time for each user, though. How reliable the carriers are about sending bounces, I don't know.

Probably best to have them input their carrier if you're going to use this method.

The upside would be that you wouldn't need any special gateway or transmitting code for the Moodle side, as the message could be sent using the normal PHP mail functions, and you'd also avoid any gateway charges.



In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Tim King -

www.2sms.com

We do XML, web services, have php code on our web site. www.2sms.com/software
We deliver to all of Europe, USA, Asia and beyond.

Our IT team would be more than happy to supply code and support if you want to use us.

Tim.

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Tim King -

2way text messaging can be done one of two ways.

1. GSM modem hanging out the back of a PC. Pay around Euro 100 for a decent one. It will require a SIM card, and a pricing plan. The 2way routing will be to/from the cell phone number of the SIM card. This option is cheap, but slow and unreliable. Commercial service. www.2sms.com or one of our competitors http://www.2sms.com/info.aspx?section=competitors

Expect to pay around Euro 0.10 per message. You can pay less, but you will be using Economy routes (e.g. seriously unreliable).

The reply piece can be done using a 'virtual long number', e.g. a cell phone number that is internet based. You need to choose one with the same country code as your message recipients, otherwise international rates apply. Monthly rental on these numbers ranges from Euro 20 a month for UK numbers to more than Euro 100 a month for some countries.

Code for sending SMS. It varies between suppliers, but a full list of code for the 2sms service is at http://www.2sms.com/software.aspx?Section=Developers incl code for

ASP
C#
Java
PHP
Perl
Python
VB
VB.NET
VBA

Web services at http://www.2sms.com/software.aspx?section=WebService and XML gateway at http://www.2sms.com/software.aspx?section=XMLGateway

Even if you don't want to consider a commerical service, drop questions in this thread or at www.2sms.com/forum and I'll try and answer them.

In reply to Darren Smith

Re: SMS (cell phone text) Messaging

by Mike Vybiral -
We are trialling a system that sends SMS texts via a mobile phone connected to a PC or server. Depending on the SIM deal, this can reduce marginal costs to 1p per text. Sending texts is currently via our normal mail server using the format mobilenumber@smsgatewaydomain. This forwards to a POP3 account from which messages are collected by the SMS system.

What we lack is sensible integration with e.g. quickmail and a means of collecting mobile phone numbers from students in a way that is private. Any pointers on this would be welcome.

Regards to all,
Mike
In reply to Mike Vybiral

Re: SMS (cell phone text) Messaging

by Tim King -

I declare an interest as a commerical SMS provider, working for www.2sms.com.

The interconnect fee that all suppliers face for delivery into the UK is 3p per message. This is what the carriers charge at the wholesale rate. It is true that you can get 'lowe' than this rate if you use a SIM card and a GSM modem, but your throughput will be about 1 message per second. Fine for small batches of messages, but not good for an emergency broadcast. You will also need to be aware of 'fair usage' policies.

If you are looking for reliable non GSM modem delivered messages, with audit trail, ISO27001 certification, and a SLA, then expect to pay in excess of 5p per message. Any less, and the risk truely is in the price, for all but small volume traffic.

(We have some USA University comments at www.2sms.blogspot.com that may be of interest.)

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Mónica Velosa -

I John Doe II,

I need your help.

Can you describe the steps I have to do to get this image (module / block) in my moodle?

thanks

Mónica

In reply to John Doe II

Re: SMS (cell phone text) Messaging

by Sarah Dutcher -
Hi John,
I realize I am extremely late in my reply, but can you tell me what versions of Moodle your code works with? It seems like it would work great for us.
Please let me know. thanks!

Sarah D
In reply to Sarah Dutcher

Re: SMS (cell phone text) Messaging

by John Doe II -

Hi Sarah,

Now it's me who's late in answering.

If you're still interested, the above code worked for Moodle 1.5, but with few little adaptations, including the hook with the new 1.7+ role-based permission system, it runs (happily) on 1.8 and 1.9.

If you’re still interested, I can provide more information.

Regards.

In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Alan Warden -
Hi

Would mdl_student_user and mdl_user be the correct table to grab the users from to send the sms to ?

Regards

Alan warden
In reply to Alan Warden

Re: SMS (cell phone text) Messaging

by Lionel Redelinghuys -
Hi

I see this discussion has come a really long way.

I am from South Africa (Yes, where we all live in huts and so on. LOL. Not true though). We have recently implemented moodle for staff training purposes for one of the largest franchise groups in the continent (Mica Hardware with more than 500 franchises).

They sortf off demand an SMS service. I am not a PHP fundi and unfortunately I do not know anyone that is. Is there 'n simple to use SMS module available that I can install by myself that will support our local SMS services?
In reply to Lionel Redelinghuys

Απάντηση: Re: SMS (cell phone text) Messaging

by Lef Plom -
@ John Doe II

You said:

"I have developed an integration of Moodle with SMS services. Basically, for now it works with 2 activity modules: forums and choice."

SO, I want your help. I have to do the same work on a project!!!

This is the source code for sending sms through the forum module? If not, is it possible to show me the way that you 've done it...

All I want to do is to send sms to the subscribed users. Under the checkbox "Email now" i want to put another checkbox like "sms now" doing the sms forwarding through a sms getaway... Thanks....
In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Greg J Preece -
Just thought I'd put in that our moodletxt block (available from the modules/plugins section) is a two-way SMS block that sends through our own SMS gateway. It requires no additional hardware, and works simply through available web ports. Anyone interested in implementing this functionality can contact me directly, or check out the page at:

http://moodle.org/mod/data/view.php?d=13&rid=958&filter=1
In reply to Greg J Preece

Απάντηση: Re: SMS (cell phone text) Messaging

by Lef Plom -
Greg Preece

Well thanks for your replying.

But all i want is only to send sms from the forum to subscribed users... Do you have something like that(As John Doe II above did).

Thanks and i hope for replying....


In reply to Lef Plom

Re: Απάντηση: Re: SMS (cell phone text) Messaging

by Greg J Preece -
Hi Lef,

Unfortunately, our block does not do this as of yet. The block is designed to be self-contained, so it can be simply dropped into an installation and run immediately. However, we are looking at developing such features later in the year - for compatibility with Moodle 2.

Many thanks,

Greg Preece
In reply to Greg J Preece

Re: SMS (cell phone text) Messaging

by umesh chavan -
hii greg,

i have installed the tool moodletext..its really looks gr8...but at my end it didnt wokred...it gives the error....

my moodle is hosted on intranet ( inhouse webserver ) and not with ISP. is this a reason?
can you guide me?

umesh
Attachment mm.jpg
In reply to umesh chavan

Απάντηση: Re: SMS (cell phone text) Messaging

by Lef Plom -
Please i need help

Does anybody can tell me where the integration for forum that john doe above did where is?

Thanks and i hope for replying....

In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by carolyn joseph -
Wire2air is a US based company engaged in providing sms gateway, bulk sms, mobile contents delivery (like ringtones, wallpapers, videos, images, animations) and mobile marketing solutions and platforms.You can easily start sms alert system buy which you can send sms to students or for any purposes after sign up of the page.


http://www.wire2air.com

(sms gateway and mobile marketing solution sprovider)
228 Park Avenue S
New York


In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by justin bryan -
Today text messaging is no doubt used by most teenagers to interact about their favorite topics of subject. Simple and afford less method to know your classmate. Yesterday i read a article on site http://www.mobilemarketer.com/cms/news/research/6276.html about the role of texting in teen study. great article just and respond quickly.


Mobile Marketing service provider.

In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Robart Dino -

Wapframe is one of the best text messsaging or text voting Mobile Site Builder company and provide too latest and user friendly mobile application.

In reply to Chris Morgan

Re: SMS (cell phone text) Messaging

by Vitor Tavares -

Hi Chris,

E-goi has just lunch a Plugin that send email and SMS notifications or campaigns. Take a look it could be useful: http://moodle.org/mod/data/view.php?d=13&rid=4673

In reply to Vitor Tavares

Re: SMS (cell phone text) Messaging

by ibra abo -

Hi everybody, i have a question, i have add a block that allows teachers and administrators to send SMS or notification to one students or group or all class directly from the Moodle course page.
Also i add one block as online Journal allows students to publish thier work online. this block include upload file, authors names and also review proccess is included to make moodle journal like any other online journals which allows the students and the instructors to share thier work with world wide network.is this consider as a contribution? im mean for my project as student or can i take any recommendation form here which can support me in my final presentation?
Thanks