Ok, I realised that a very large percentage of the issues have to deal with number format problems. I saw a site which used input masks to solve this problem beautifully, I mentioned them is this issue: . So I sorta copied their method and did it up for SMSframework. Attached is the edited module with all the fixes to allow for an input mask.

Note:
This is my first Drupal code submission so I havent gotten around to learning how to patch or apply patches. Therefore I will give a verbal patchfile :)

I added the country selection from the clickatell gateway module to the sms_user module. Why? It makes sense to specify which country you are in regardless of your gateway. Besides, that is what I used to format the country specific input mask for the numbers.
With regards to the list of supported countries - I went to wikipedia to find out how the format for phone numbers across the world were but met upon a nightmare. http://en.wikipedia.org/wiki/List_of_country_calling_codes
The way my code is designed is that it takes the area code as well as the number of digits in the the telephone number. finding the area code for all the countries in the world is fine but the only zone that gave me clear info as to how many numbers were in the entire phone number was Zone 1 – North American Numbering Plan Area. And fortunately for me Jamaica fell in that zone - "One Love Rasta :D". So NANPA is the only zone I have in this module - along with spain and UK which had their details (area code and length) listed in the new yet dormant sms international module.

So clickatell no longer ask for you country, but its provided for all gateways.

I am seeing a number of issues about a leading 0 - not sure how that works, maybe you can look into the module to see if you can make a mask to fit your needs.

to create a mask for your country, its as simple as adding your aeracode plus the number of other digits in the tel num.

eg:where areacode is 1876 the format will look like "1876|18765555555"

Other notes: I added 2 Javascript files, mask.js and sms.js
I edited sms_user.module, sms_clickatell.module and sms.module

So far it work great for me and hopefully for every body else in the europe and asia etc can get it going for them 2.

CommentFileSizeAuthor
smsframework.zip62.08 KBfrazras
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

glennnz’s picture

Hi frazras

This is a step forward, but not quite working for my situation:

1. I am in New Zealand, mobile numbers here do not have a fixed number of digits. The mask needs to allow for a variable number of digits.

2. Confirmation works fine, but content notifications still don't work via Clickatell.

Thanks

Glenn

frazras’s picture

The mask actually allows for variable numbers, it doesn't prevent a shorter than max input - I think it only gives a javascript alert warning. So maybe if you used the maximum allowable characters as the mask then it may work.

With regards to Clickatell, I have gotten content notifications to work, maybe you need to look into your configuration, also try swapping gateways [use the log] or even methods [try email].

glennnz’s picture

I've added the following line to sms.module:

  "64|645555555555" => "New Zealand (+64)",

This appears in the dropdown fine.

If I enter, for my mobile number, "21123456", I get a javascript popup telling me, "Your entry may have been too short", and after I've clicked OK on the js popup, I get a Drupal error message saying, "The phone number is invalid."

This Drupal error message is coming from function sms_validate_number, line 445 of sms.module.

My notifications are for OG posts, have you tested this?

Thanks

Glenn

frazras’s picture

Ok, Well perhaps what you could do is disable the sms_validate_number, I did not look into that because all my numbers are valid according to its regex. Maybe it needs to be re-evaluated or removed, and have a strict input mask as the alternative - Im not too sure.

I used notification with OG and it worked for me, I did it for a test site that I have here a long time ago http://texbox.exterbox.com/, OG, Notifications and SMSFramework.

glennnz’s picture

Hmm, I can't get this to work.

Disabled the function, I still get the javascript error. Disabled javascript and the whole thing falls over.

dpi’s picture

Status: Needs review » Closed (outdated)