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

  • Just to be complete, the phone must be of the type Mobile. Did you succeed sending a single SMS? Dec 11, 2016 at 18:27
  • 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. Dec 12, 2016 at 8:15

3 Answers 3


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)?

  $testContactId = 204;
     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";

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.

  • 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 Dec 13, 2016 at 7:49
  • 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). Dec 13, 2016 at 9:11

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

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


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.

  • The devil is in the details :-). Glad it works now. Dec 13, 2016 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.