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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frazras’s picture

Status: Needs review » Active

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.

frazras’s picture

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.

aspope’s picture

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").

Anonymous’s picture

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

Will White’s picture

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!

aspope’s picture

Status: Active » Patch (to be ported)
FileSize
18.87 KB

Hi Will. Fair point about submitting patches - I will remember for next time.

I have made the requested changes as below:

  • In send form: Reverted all changes: restored country field description and removed sender field.
  • In send function: Returned the country code prepend to $number, but only if $options['country'] exists.
  • Removed HTML in block comments.

Full patch submitted to this comment. Please take a look and let me know. Thanks!

zeropaper’s picture

The patch fails for me ;(

patch unexpectedly ends in middle of line
patch: **** 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...

Ahmed’s picture

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

aspope’s picture

Hi Ahmed,
This module is an extension for SMS Framework, which is used to send and receive SMS messages.

aspope’s picture

Zeropaper, please try this patch. It seems that the other was malformed.

patrickharris’s picture

This is great functionality for clickatell users!

Anonymous’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Category: task » feature

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()

burningdog’s picture

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.

patrickharris’s picture

It would be great to get this patch in.

burningdog’s picture

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!

aspope’s picture

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

aspope’s picture

Assigned: Unassigned » aspope
Status: Patch (to be ported) » Reviewed & tested by the community

This module has now been committed to 6.x-1.x-dev

Anonymous’s picture

Anonymous’s picture

I have downgraded from 6.x-2.x-dev and I got following errors:

user warning: Unknown column 'delta' in 'field list' query: SELECT number, delta, status, code, gateway FROM sms_user WHERE uid = 1 in /sites/all/modules/smsframework/modules/sms_user/sms_user.module on line 329.

Warning: Call-time pass-by-reference has been deprecated in /sites/all/modules/smsframework/sms.install on line 95

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of sms_country_codes_insert_initial_data(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /sites/all/modules/smsframework/sms.install on line 96

aspope’s picture

@giorez: Unfortunately, as you have discovered, the 1.x code is not compatible with the 2.x database schema - you cannot downgrade like that.

The sms_user database table schema changed between 1.x and 2.x, and the delta column does not exist in 2.x. You have two options:
1. Disable the sms_user module. Add the delta column: ALTER TABLE sms_user ADD COLUMN delta INT UNSIGNED NOT NULL;
2. Try using the 2.x sms_user module with 6.x-1.x-dev - but I cannot guarantee the result. I can't remember whether the code is 100% compatible from memory.

heander’s picture

Hi!

I have ported this (very nice patch) to 6.x-2.x-dev. I have applied the patch to the latest tarball (2010-Jul-11) and tested it against our clickatell account.

Best Regards
Johan

burningdog’s picture

Assigned: aspope » Unassigned
Status: Reviewed & tested by the community » Needs review

Thanks Johan. Marking as "needs review".

grub3’s picture

Status: Needs review » Reviewed & tested by the community

This works fine for me. Finally !
Also I read the code.
It seems to comply with Clickatel rules.

Setting status to "reviewed by community"

grub3’s picture

This patch was installed on our live site, I see no problem, it is working.

univate’s picture

Actually the patch does not apply cleanly since its not in the proper patch format, but in a the git patch format.

Attached is a patch that applies to 2.x

Will leave at RTBC since I didn't change any code in this re-roll of the patch.

grub3’s picture

This patch is in production since October 8 without any problem. It can be committed safely.

univate’s picture

Status: Reviewed & tested by the community » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.