Answers.Body: <p>I just faced (and fixed) this problem three days ago for a client by patching the Clickatell extension to prepend the "1" where it doesn't already exist.</p>
  
  <p>In short - someone already wrote this patch, but it only works if you don't have contacts you want to text outside the US and UK.  The patch is referenced on <a href="https://issues.civicrm.org/jira/browse/CRM-14160" rel="nofollow">CRM-14160</a> - or just find it <a href="https://github.com/civicrm/civicrm-core/pull/2447" rel="nofollow">here</a>.</p>
  
  <p>If you're not a developer, but you feel comfortable installing an extension from a zip file, I just made a <a href="https://github.com/PalanteJon/org.civicrm.sms.clickatell" rel="nofollow">Github repo here</a> with the patched extension.  That said - I don't want to post it as the "new" Clickatell extension, because it makes some country-specific assumptions.</p>
  
  <p>You can see that I updated the CRM-14160 ticket with what I think is the ultimate solution - which is for CiviCRM to know the country code associated with each country.  Then the Clickatell extension could check for whether it's present or not - and if not, then prepend it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-23T01:15:05.510Z
Answers.LastActivityDate: 2016-02-23T01:39:59.173Z
Answers.LastEditDate: 2016-02-23T01:39:59.173Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>Update your numbers to include a country code.</p>
  
  <p>This will vary based on the format you've input data, but the below works for the sample dataset used on the demo sites.</p>
  
  <pre><code>-- a couple of formats including area code and local number
  UPDATE civicrm_phone SET phone = CONCAT('+1 ', phone) 
   WHERE phone LIKE '(___) ___-____';
  UPDATE civicrm_phone SET phone = CONCAT('+1 ', phone) 
   WHERE phone LIKE '___ ___-____';
  
  -- local numbers get your assumed area code prepended also
  UPDATE civicrm_phone SET phone = CONCAT('+1 555 ', phone) 
   WHERE phone LIKE '___-____';
  </code></pre>
  
  <p>When doing this, make sure to make backups and work on test data so you avoid loss.</p>
  
  <p>There is a trigger <code>civicrm_phone_before_update</code> which will handle updating the <code>civicrm_phone_numeric</code> column.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-02-22T20:55:40.933Z
Answers.LastActivityDate: 2016-02-22T20:55:40.933Z
Answers.UserDisplayName: Chris Burgess
Body: <p>I set up a clickatell account and configured it in Civi. It only works if the phone number has a 1 in front for the country code. None of our numbers have the country code, is there a way around this?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-22T19:05:27.440Z
Comments.Text: That is the reason we decided to go with Twilio. It was either reformat all of our phone numbers into a format which would be strange for normal usage or go with a different SMS provider.
Comments.UserDisplayName: Allen Hutchison
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-22T19:16:27.107Z
Comments.Text: It's also possible to do some customization to prepend the country code before sending so you don't have to add it in the UI.  You might need a developer/consultant's help with this but it's certainly been done, and AFAIK works well.
Comments.UserDisplayName: Lesley Carter - BackOffice
Tags: <sms>
Title: Number format with SMS Clickatell provider
ThreadText: # Number format with SMS Clickatell provider
  
  (Asked by: username_0 on 2016-02-22)
  
  I set up a clickatell account and configured it in Civi. It only works if the phone number has a 1 in front for the country code. None of our numbers have the country code, is there a way around this?
  
  **Tags:** sms
  
  > **Comments:**
  > **username_1**: That is the reason we decided to go with Twilio. It was either reformat all of our phone numbers into a format which would be strange for normal usage or go with a different SMS provider.  
  > **username_2**: It's also possible to do some customization to prepend the country code before sending so you don't have to add it in the UI.  You might need a developer/consultant's help with this but it's certainly been done, and AFAIK works well.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2016-02-23. Score: 2
  
  I just faced (and fixed) this problem three days ago for a client by patching the Clickatell extension to prepend the "1" where it doesn't already exist.
  
  In short - someone already wrote this patch, but it only works if you don't have contacts you want to text outside the US and UK. The patch is referenced on [CRM-14160](https://issues.civicrm.org/jira/browse/CRM-14160) - or just find it [here](https://github.com/civicrm/civicrm-core/pull/2447).
  
  If you're not a developer, but you feel comfortable installing an extension from a zip file, I just made a [Github repo here](https://github.com/PalanteJon/org.civicrm.sms.clickatell) with the patched extension. That said - I don't want to post it as the "new" Clickatell extension, because it makes some country-specific assumptions.
  
  You can see that I updated the CRM-14160 ticket with what I think is the ultimate solution - which is for CiviCRM to know the country code associated with each country. Then the Clickatell extension could check for whether it's present or not - and if not, then prepend it.
  
  
  ---
  
  ### Answer by username_4 on 2016-02-22. Score: 1
  
  Update your numbers to include a country code.
  
  This will vary based on the format you've input data, but the below works for the sample dataset used on the demo sites.
  
  ```
  -- a couple of formats including area code and local number
  UPDATE civicrm_phone SET phone = CONCAT('+1 ', phone) 
   WHERE phone LIKE '(___) ___-____';
  UPDATE civicrm_phone SET phone = CONCAT('+1 ', phone) 
   WHERE phone LIKE '___ ___-____';
  
  -- local numbers get your assumed area code prepended also
  UPDATE civicrm_phone SET phone = CONCAT('+1 555 ', phone) 
   WHERE phone LIKE '___-____';
  
  ```
  
  When doing this, make sure to make backups and work on test data so you avoid loss.
  
  There is a trigger `civicrm_phone_before_update` which will handle updating the `civicrm_phone_numeric` column.
  
  
  ---
  
  