Answers.Body: <p>Thanks a lot, Kainuk for your screenshots : the error is on my side : I thought that just the number had to be a mobile number : I did not realize that, moreover, this number had to be defined as a Home <strong>Mobile</strong> phone number.</p>
  
  <p>I have now to change that in my webforms (and then fix this in all the database, but I can manage this directly with phpmyadmin).</p>
  
  <p>Thanks again a lot : I would not have found that by myself.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T16:11:26.797Z
Answers.Text: The devil is in the details :-). Glad it works now.
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T13:06:32.400Z
Answers.LastActivityDate: 2016-12-13T13:06:32.400Z
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.Body: <p>Just the start of debugging, but maybe it evolves to a complete answer. I focus on the fact that the Send SMS menu does not show on a contact with a valid mobile phone. Can you execute the following script with your test contact_id (my test contact id = 204)?</p>
  
  <pre><code>&lt;pre&gt;
  &lt;?php
    $testContactId = 204;
    civicrm_initialize();
    if(CRM_SMS_BAO_Provider::activeProviderCount()){
       echo "SMS provider configured\n";
       $mobileTypeID = CRM_Core_OptionGroup::getValue('phone_type', 'Mobile', 'name');
       echo "Mobile type id =  $mobileTypeID \n";
         print_r(CRM_Contact_BAO_Contact_Location::getPhoneDetails($testContactId, $mobileTypeID));
    } else {
       echo "NO Sms provider configured\n";
   };
  ?&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p>To execute the script save it to a file (for example <em>test.php</em>) and run it with</p>
  
  <pre><code>drush scr test.php
  </code></pre>
  
  <p>Hopefully, we get a hint if the configuration of the provider is the problem or the details of the test contact. </p>
  
  <p><em>Update</em>
  When you have only web access the code can be executed on a Drupal instance as follows:</p>
  
  <ul>
  <li>Enable the Drupal <strong>PHP Filter</strong> module.</li>
  <li>Create a new Article</li>
  <li>Past the script as contents of the article</li>
  <li>Set the filter to <strong>PHP Code</strong></li>
  <li>Use the preview button for the result.</li>
  </ul>
  
  <p>A word of warning, enabling the PHP Filter is a security risk because it allows the execution of arbitrary PHP code in every Drupal page.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T07:49:43.577Z
Answers.Text: Thanks again Kainuk. Unfortunately I am not a programmer, but I can manage that with FTP : Where should I store this file ? Can I call it via a URL (instead of drush, which I am not familiar with) ? (If not, just tell me how to use this drush command). PS : sorry for this answer delay, but I am located in France
Answers.UserDisplayName: Jacques-Marie Moranne
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T09:11:57.690Z
Answers.Text: Hi Jacques, updated the answer, with an alternative solution to execute the script. But on my test instance, I have the send SMS send menu working, so I will create a second answer, where I show them. (By the way, I am in Culemborg, the Netherlands, so we are in the same timezone).
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-12T14:55:01.630Z
Answers.LastActivityDate: 2016-12-13T09:06:11.337Z
Answers.LastEditDate: 2016-12-13T09:06:11.337Z
Answers.UserDisplayName: Kainuk - CiviCooP
Answers.Body: <p>I got the <em>send SMS</em> working on my test instance. I post here the screenshots. Maybe it will be of help if you compare?</p>
  
  <ol>
  <li>The objective is to show the <em>Send SMS</em> menu. That makes it possible to send a single SMS for testing purposes.</li>
  <li>The test contact must have a phone number of the type mobile, and it must be the <em>Primary</em>.</li>
  <li>No privacy option is set. </li>
  </ol>
  
  <p><a href="https://i.sstatic.net/80c88.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/80c88.png" alt="screenshot of an enable SMS contact"></a></p>
  
  <p>This is the configuration of my SMS provider screen. API parameters have no effect, but the checkbox <em>Is this provider active?</em> (2) does!.</p>
  
  <p><a href="https://i.sstatic.net/OFh1Q.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OFh1Q.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-13T09:30:29.217Z
Answers.LastActivityDate: 2016-12-13T09:30:29.217Z
Answers.UserDisplayName: Kainuk - CiviCooP
Body: <p>I am on Drupal 7.51 / CiviCRM 4.7.12</p>
  
  <p>I have just installed Twilio (SMS) Extension, purchased a number (+33... (France) from Twilio), upgraded my account, and configured Twilio Extension accordingly (as per <a href="https://wiki.civicrm.org/confluence/display/CRMDOC/Setting+up+a+SMS+Provider+for+CiviSMS" rel="nofollow noreferrer">https://wiki.civicrm.org/confluence/display/CRMDOC/Setting+up+a+SMS+Provider+for+CiviSMS</a>) : filling username and password with the LIVE API Credentials specified at <a href="https://www.twilio.com/console/account/settings" rel="nofollow noreferrer">https://www.twilio.com/console/account/settings</a>.</p>
  
  <p>When I test it (on a test Group), I get the following Error Message :</p>
  
  <p>The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased. </p>
  
  <p>(I did not configure inbound SMS)</p>
  
  <p>Any suggestion would be welcome</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-11T18:27:53.393Z
Comments.Text: Just to be complete, the phone must be of the type _Mobile_. Did you succeed sending a single SMS?
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-12T08:15:58.967Z
Comments.Text: Thank you Kainuk for your attention ; of course, the phone called is mobile.  When I select and consult an individual, the SMS action is not available in the action list ; when I select (tag) an individual in a search result and send him a SMS, I get the error message.
Comments.UserDisplayName: Jacques-Marie Moranne
Tags: <sms>
Title: Twilio Extension: "The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased."
ThreadText: # Twilio Extension: "The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased."
  
  (Asked by: username_0 on 2016-12-11)
  
  I am on Drupal 7.51 / CiviCRM 4.7.12
  
  I have just installed Twilio (SMS) Extension, purchased a number (+33... (France) from Twilio), upgraded my account, and configured Twilio Extension accordingly (as per <https://wiki.civicrm.org/confluence/display/CRMDOC/Setting+up+a+SMS+Provider+for+CiviSMS>) : filling username and password with the LIVE API Credentials specified at <https://www.twilio.com/console/account/settings>.
  
  When I test it (on a test Group), I get the following Error Message :
  
  The selected contacts have no valid phone, or prefer not to receive SMS, or are deceased.
  
  (I did not configure inbound SMS)
  
  Any suggestion would be welcome
  
  **Tags:** sms
  
  > **Comments:**
  > **username_1**: Just to be complete, the phone must be of the type _Mobile_. Did you succeed sending a single SMS?  
  > **username_0**: Thank you Kainuk for your attention ; of course, the phone called is mobile.  When I select and consult an individual, the SMS action is not available in the action list ; when I select (tag) an individual in a search result and send him a SMS, I get the error message.  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2016-12-13. Score: 0 | Accepted answer
  
  Thanks a lot, Kainuk for your screenshots : the error is on my side : I thought that just the number had to be a mobile number : I did not realize that, moreover, this number had to be defined as a Home **Mobile** phone number.
  
  I have now to change that in my webforms (and then fix this in all the database, but I can manage this directly with phpmyadmin).
  
  Thanks again a lot : I would not have found that by myself.
  
  > **Comments:**
  > **username_1**: The devil is in the details :-). Glad it works now.  
  
  ---
  
  ### Answer by username_1 on 2016-12-12. Score: 1
  
  Just the start of debugging, but maybe it evolves to a complete answer. I focus on the fact that the Send SMS menu does not show on a contact with a valid mobile phone. Can you execute the following script with your test contact_id (my test contact id = 204)?
  
  
  
  
  To execute the script save it to a file (for example test.php) and run it with
  drush scr test.php
  
  Hopefully, we get a hint if the configuration of the provider is the problem or the details of the test contact. 
  Update
  When you have only web access the code can be executed on a Drupal instance as follows:
  
  Enable the Drupal PHP Filter module.
  Create a new Article
  Past the script as contents of the article
  Set the filter to PHP Code
  Use the preview button for the result.
  
  A word of warning, enabling the PHP Filter is a security risk because it allows the execution of arbitrary PHP code in every Drupal page.
  
  > **Comments:**
  > **username_0**: Thanks again Kainuk. Unfortunately I am not a programmer, but I can manage that with FTP : Where should I store this file ? Can I call it via a URL (instead of drush, which I am not familiar with) ? (If not, just tell me how to use this drush command). PS : sorry for this answer delay, but I am located in France  
  > **username_1**: Hi Jacques, updated the answer, with an alternative solution to execute the script. But on my test instance, I have the send SMS send menu working, so I will create a second answer, where I show them. (By the way, I am in Culemborg, the Netherlands, so we are in the same timezone).  
  
  ---
  
  ### Answer by username_1 on 2016-12-13. Score: 0
  
  I got the *send SMS* working on my test instance. I post here the screenshots. Maybe it will be of help if you compare?
  
  1. The objective is to show the *Send SMS* menu. That makes it possible to send a single SMS for testing purposes.
  2. The test contact must have a phone number of the type mobile, and it must be the *Primary*.
  3. No privacy option is set.
  
  [![screenshot of an enable SMS contact](https://i.sstatic.net/80c88.png)](https://i.sstatic.net/80c88.png)
  
  This is the configuration of my SMS provider screen. API parameters have no effect, but the checkbox *Is this provider active?* (2) does!.
  
  [![enter image description here](https://i.sstatic.net/OFh1Q.png)](https://i.sstatic.net/OFh1Q.png)
  
  
  ---
  
  