Updated Clickatell gateway module
aspope - April 22, 2009 - 14:49
| Project: | SMS Framework |
| Version: | 6.x-2.x-dev |
| Component: | Clickatell |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Description
As promised, I have updated the Clickatell gateway module, as follows:
New Features:
- Added support for long messages, with the Clickatell concat parameter.
- Added send options (corresponds to Clickatell features/params):
- sender - The Sender ID to add in the from header of the message.
- reference - Reference tag to apply to message.
- priority - Queue priority to apply to the message.
- delaymins - Delay message sending by N minutes.
- expiremins - The message send will abort if not sent within N minutes.
- expectreply - Route the message properly so that the user can reply.
- Support for a default sender ID (from header), with field in admin form.
- Receiver for messages
- Presents a path to receive messages by HTTP(S).
- Will send Clickatell params from received message to the Framework
sms_incoming().
- Receiver for delivery receipts (in draft, currently disabled in line 483)
- Presents a path to receive delivery receipts by HTTP(S).
- Will send common status and Clickatell params from receipt to the Framework
sms_receipt()(if/when implemented as per http://drupal.org/node/440384). - Added receipt callback selector to admin form.
- Added sender field to send form.
- Added array function of Clickatell message statuses.
Change of functionality from previous version:
- The MSISDN numbers must now be specified in full international format. I removed the concatenation of the country code and phone number from the send function, as this causes pain when sending programatically. Users should be encouraged to use properly formatted numbers, including the E.164 country codes (without special chars like "+" or spaces).
I have tested all features with a live Clickatell account, but would ask that someone else validates also.
Thanks all!
~ap
PS. Big credit to diggersf who wrote the original module - the code was great to work with.
| Attachment | Size |
|---|---|
| sms_clickatell.zip | 8.14 KB |

#1
Why is the sender field under /user/*/mobile - Are you allowing regular users to define who the sender should be? I don't see the purpose of that, especially since only the admin can register a sender.
I also have a bug, I am not sure if its with the code, Clickatell or my carrier but for Textual sender IDs it trims it to 7 characters, or maybe it trims off the last character because my ID is eight characters "Exterbox" and it only displays "Exterbo" - I believe the Limit is 11 but for numeric IDs it dispalys all 11 numbers I use.
#2
Update: for the previous comment about sender ID, when I change the last letter to a capital letter "ExterboX" it works - all eight characters are displayed... weird.
#3
Fair point about allowing the user to define sender IDs when Clickatell restricts them to an approved list. Maybe this feature should be removed.
I am not sure about your other bug though. The Clickatell restriction is 16 chars for numeric Sender IDs or 11 chars for alphanumeric Sender IDs. I have applied Admin form validation for this, but have not implemented any trimming. I had tested with an 11 char number and an 8 char alphanumeric ("MilkMore").
#4
I tryed to update to
smsframework-6.x-2.x-dev
and/or
smsframework-6.x-1.x-dev + sms_clickatell.zip
but no chance to send any sms.
Smsframework-6.x-1.x-dev is the last working code
#5
Hi aspope,
First of all, wow! Thanks for all of your hard work on this. The list of features that you've added is enormous and this will be very helpful to a lot of people.
Here are some thoughts at this point.
I think the send form needs work. The sender field should be removed and the help text for the country field is overwhelming. Despite this issue, I think it would be best to restore the previous behavior for now. The real solution to this would be to design a module that does smarter international number validation, which is a problem that big enough for its own issue.
Also, can you remove the HTML from block comments?
Would mind submitting future changes a patches so it's clear what has changed?
Thanks again for all of your hard work!
#6
Hi Will. Fair point about submitting patches - I will remember for next time.
I have made the requested changes as below:
Full patch submitted to this comment. Please take a look and let me know. Thanks!
#7
The patch fails for me ;(
patch unexpectedly ends in middle of linepatch: **** malformed patch at line 472:
Still, I'm lloking forward for the delivery receipts but I would like to have the country selection thing (has it can be used as a filter for the numbers).
I may also soon post a small module (I'd like to see merged with sms_user) to create a user account with an SMS verification.... still need some work...
#8
Hello,
I'm sorry for my question :$
Is this module used to send sms because I have a clickatell account with credits, or it used just to send drupal notifications?
Thank you,
Ahmed Mohamed
#9
Hi Ahmed,
This module is an extension for SMS Framework, which is used to send and receive SMS messages.
#10
Zeropaper, please try this patch. It seems that the other was malformed.
#11
This is great functionality for clickatell users!
#12
could it be possible to put international prefix into sms_user number?
...doing so, clickatell module doesn't need to use
function sms_clickatell_country_codes()#13
I'm using this on a live project where people sms a "word of the day" to a short code (in South Africa) via Clickatell. Clickatell sends me the contents via a HTTP POST to http://www.example.com/sms/clickatell/receiver and I can work with the variables by using hook_sms_incoming($op, $number, $message, $options) in my module...
...which checks if the word of the day is valid, and sms's back a response, while storing each sms as a competition entry (if valid).
So far so good! I'm not using the other functionality this patch provides (like long messages, send options, or a default sender ID) but everything else seems fine.
#14
It would be great to get this patch in.
#15
It doesn't look like this patch has the ability to support receipts from Clickatell. It does have function sms_clickatell_receive_receipt() which will only be implemented once #440384: Delivery receipts from gateways has made its way in. It's a really small patch (5 lines of code) which should really be SMS Framework. So make your way over there and review it!
#16
Hi Roger, thanks for trying this out! The receipts are still a work in progress - I am just about to review your post at #440384: Delivery receipts from gateways
~ap