CiviCRM Community > Developer Discussion
Testing the SMS functionality in 4.2
Laryn:
I've been trying to get SMS working in a local installation of the 4.2 branch and still having some difficulty (I currently have a support request in with Clickatell to see if it's something on their end).
In the meantime, here are a few notes I've jotted along the way:
* I edited the mobile number of a demo contact and found the SMS was trying to send to the home phone (marked primary) instead of the mobile phone
* The phone numbers will need some cleansing since they need to be in international format (at least for Clickatell) which means country code at the beginning (no + or spaces though), no parentheses or spaces or dashes within the number...otherwise we get an ugly white screen "ERR: 114, Cannot route message" error.
* I was curious (since we are working within such a small amount of characters) how inserting tokens will be calculated towards the character limit -- what happens if the token makes the message go over the limit?
* Is it possible to only show templates that are specific to SMS format? (the email templates are irrelevant to the SMS system)
* Can we make the errors cleaner and avoid the white screen? E.g. display them in a standard theme in a more pleasing way
* Is the plan to add SMS to more menus as well? (e.g. in a contact view > Activities tab, like sending email is currently allowed, and the main Actions button on a contact view)
epg:
In regard to "The phone numbers will need some cleansing since they need to be in international format (at least for Clickatell) which means country code at the beginning (no + or spaces though), no parentheses or spaces or dashes within the number...otherwise we get an ugly white screen "ERR: 114, Cannot route message" error. "
Since most end-users of CiviCRM will probably not bother to put in a country code, then the country code could be determined automatically either based on the home address of of the contact, or there could be a default country code for the whole database.
totten:
Another question:
When composing a message, there's an option called "Invalid After". After grepping the codebase, I couldn't find what this does -- it appears that we pass it around as the "$smsParams[invalid_after]" and possibly "$header[invalid_after]" variables, but those variables don't seem to be used.
There is some explanation on the blog ( http://civicrm.org/blogs/mneimeyer/proto-civisms ) which describes it as an advanced feature in Clickatell, but I don't see how it can work if the variable isn't read. Has someone tested this? (I don't have a Clickatell account right now.)
Barnacle:
The international phone number cleansing seems a significant problem.
Our site is UK specific so the solution was easier than it might have been. But I had to post-process the user registration form to strip the leading zero and add the UK country code (44) to the beginning of any number that was typed in that way.
This strikes me as a disparity between CiviSMS and Clickatell. CiviSMS automatically takes out the leading zero and passes it to Clickatell, but by then it's an invalid number. If the leading zero had been kept in then at least it would work locally.
I thought I should raise this as an issue since I don't think what presently happens is the best solution.
Donald Lobo:
yes, i suspect civi will need to figure out and add code to "format" the numbers before sending them over to the SMS providers. Also we should check what phone format other SMS providers use.
For the short term, we'll need to assume folks use complete phone numbers and/or a DB hook/trigger to clean the phone numbers up.
Would really help if someone can help spearhead this improvement for a future release
lobo
Navigation
[0] Message Index
[#] Next page
Go to full version