Continued from the discussion at http://drupal.org/node/532006.
When a user enters their mobile number, the leading zero is not stripped off.
At confirmation time, if I enter 012 234 456, and select the country, it fails. If I enter 12 234 456 and enter the country code, a confirmation SMS is sent fine and all is well.
Notifications do not work though for confirmed numbers. The country code is not being added to the outgoing number and a 114 error is returned from Clickatell.
As I write this, I'm wondering if it's because the user's country setting is not being stored anywhere, so it is lost after the initial confirmation process? I'll have a look at that in the next couple of days.
Cheers
Glenn
Comments
Comment #1
glennnz CreditAttribution: glennnz commentedAfter a very quick test, that is exactly what is happening. For a notification, the country code is not being added.
The error then is in line 94 off sms_clickatell.module:
$options['country'] is not working.
Glenn
Comment #2
halfiranian CreditAttribution: halfiranian commentedWow - good spot. That was causing me a lot of trouble.
Is there a patch?
Comment #3
glennnz CreditAttribution: glennnz commentedNot yet... :-(
I've fiddled with the code, but can't get it working.
I've run out of ideas. It seems like this module is not being actively maintained, can anyone shed light on this?
Comment #4
N1029676 CreditAttribution: N1029676 commentedI've kinda been going crazy trying to figure this out.
I have the verification code sent out correctly as well as the SMS Blast. But any other module that tries to send out an SMS message (Even the testing module) results in an error, or gives an ok but the number receives nothing.
I've been having this issue on all versions of the Framework.
I'm not sure where these errors are logged, but it is not in the watchdog area of Drupal.
Comment #5
glennnz CreditAttribution: glennnz commentedHave you figured out a fix?
Comment #6
espenmoe CreditAttribution: espenmoe commentedI have all my users from the same country. Would it be possible to tweak sms_clickatell.module to automatically add the norwegian country code - 47?
Comment #7
buddaAlso suffering form the same problem with a new SMS gateway I've written.
The users country code is saved under the 'gateway' data.
I'll have a play and report back the fix, if any.
Comment #8
buddaHmm, in the hook_send() it would appear as if the $options argument passed in should contain information about the country.
For example:
In my debug tests $options is coming through empty every time.
Comment #9
NROTC_Webmaster CreditAttribution: NROTC_Webmaster commentedI've run across a very similar issue. I'm using the sms - email gateway and it appears that the number is stored but it is not recalling the users carrier. I have tried to manually do this but I have a limited working knowledge of php and I cannot for the life of me get it to work. If anyone has found a way to resolve this that would be a true blessing. The simplest way I see for this to work is instead of it storing country codes and gateways separate from the number is to have them all stored in the same variable. This would pose problems in the future if the admin changes the gateway but it would seem to resolve other issues with the database.
Please let me know if anyone has found a solution.
Comment #10
buddaYes you could hack the module and replace the line you identified with:
This is assuming your $number stored for each user doesn't start with the 0 -- otherwise you will need to remove that first. ltrim() should do it if needed.
Comment #11
buddaThe problem for me was in the messaging_sms module (part of the messaging project).
I fixed it with a one-liner - see http://drupal.org/node/337518#comment-3896748
Comment #12
dpi