CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviSMS »
  • Twilio incoming SMS messages
Pages: [1]

Author Topic: Twilio incoming SMS messages  (Read 3183 times)

josue

  • I post occasionally
  • **
  • Posts: 81
  • Karma: 7
    • PTP
  • CiviCRM version: 3.4.4, 4.1.1
  • CMS version: Drupal 6.24, Drupal 7.12
  • MySQL version: 5.0
  • PHP version: 5.2
Twilio incoming SMS messages
March 27, 2014, 11:17:04 am
I am trying to figure out how to get the SMS replies that are made to my Twilio SMS messages back into CiviCRM.

I found this in this forum:

Quote from: jcm55 on November 15, 2012, 08:55:44 pm
Thanks for this -- I started with your patch and added inbound functionality, as well as improving inbound overall, so that CiviCRM creates new contact records for inbound SMS from unknown mobile numbers.

See new patch in CRM-11299:

http://issues.civicrm.org/jira/browse/CRM-11299

There does seem to be a function in the code called processInbound. For Clickatell, there is a Callback URL that needs to be entered on the Clickatell administration page. I do not see any instructions about something like this for Twilio.

On the Twilio side of things, I did notice that when I replied to a text, I received a text back from Twilio, thanking me for my message (and charging the account for that automated message!). In your Twilio account, that functionality is found under the menu item called Numbers.

If you click on your phone number on that screen, you can edit the Messaging option. Is this where a Callback URL would go?

Did the person who wrote the code have some other way for CiviCRM to learn about a reply SMS message?

Thanks!


allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Twilio incoming SMS messages
January 28, 2015, 04:45:11 pm
Hi Josue,

I just sorted this out; don't know if you still need the info, but here goes:

In your Twilio phone number (like you observed, click the phone number you want to edit), under messaging, put in

http://yourwebsite.com/civicrm/sms/callback?provider=org.civicrm.sms.twilio

and make sure that line is set to HTTP POST.

Also, here is what I have in the API Parameters in my SMS provider setting in CiviCRM:

Code: [Select]
From=[ten digit phone number from Twilio with no spaces, dashes, etc. and not including these brackets]
mo=1

You will get charged for each reply you receive, but they should then appear in Civi as an Inbound SMS activity for the contact who sent it.
« Last Edit: January 28, 2015, 04:48:58 pm by allenthehusband »

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: Twilio incoming SMS messages
February 23, 2015, 10:38:18 am
Hi allenthehusband,
I'm wondering if you could provide some more information on your setup. I tried to configure Twilio/CiviCRM so that CiviCRM receives incoming SMS messages but the suggested changes you posted don't work for me. I see the responses coming to Twilio account but CiviCRM doesn't seem to be aware of them.

My settings:
1. Setup SMS Providers as per http://wiki.civicrm.org/confluence/display/CRMDOC/Setting+up+a+SMS+Provider+for+CiviSMS#SettingupaSMSProviderforCiviSMS-twilio but with the change under API Parameters to be From=[fullphonenumberwith1] (instead of FROM as per original documentation suggested, I corrected that)
Also, added mo=1 to API Parameters

2. In Twilio, edited the phone number and under Messaging > Request URL update the URL to be http://yourwebsite.com/civicrm/sms/callback?provider=org.civicrm.sms.twilio and HTTP POST type.

Sending SMS from CiviCRM works fine, responding to those SMS gets the SMS recorded in Twilio but not in CiviCRM.
Any insight would be apprieciated.
Kasia Wakarecy
http://kasuwade.ca

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: Twilio incoming SMS messages
February 23, 2015, 11:22:53 am
OK, I got some more info. In Twilio account, under Logs > Messages, there is a list of Incoming Messages to review. When clicked on any of my messages (the ones that didn't show up in CiviCRM), I see information under Error and Warning Notifications: "11200 HTTP retrieval failure" with description: "An attempt to retrieve content from http://yoursiteurl/civicrm/sms/callback?provider=org.civicrm.sms.twilio returned the HTTP status code 401."
Kasia Wakarecy
http://kasuwade.ca

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: Twilio incoming SMS messages
February 23, 2015, 12:17:31 pm
It must be a long day at the keyboard. The reason I was getting that error in Twilio account was because that website I was connecting to had a password protection on the whole directory so Twilio could not connect to it for obvious reasons. Testing with a regular site that didn't have the password protection on the directory is working. I will update Twilio installation details about setting the inbound SMS, thanks allenthehusband for sharing the details.
Kasia Wakarecy
http://kasuwade.ca

allenthehusband

  • I’m new here
  • *
  • Posts: 27
  • Karma: 2
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Twilio incoming SMS messages
February 24, 2015, 09:46:37 am
Kasiawaka, I'm so glad you got it sorted out!  A thing I recently discovered that helps us manage the inbound SMS... you can create a scheduled reminder to happen 0 hours after an inbound SMS activity happens... so you can get an email whenever someone sends an inbound SMS.

kasiawaka

  • I post occasionally
  • **
  • Posts: 42
  • Karma: 4
    • Kasuwade Solutions Inc.
Re: Twilio incoming SMS messages
March 06, 2015, 01:59:52 pm
Thanks, that's a useful tip!
Kasia Wakarecy
http://kasuwade.ca

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviSMS »
  • Twilio incoming SMS messages

This forum was archived on 2017-11-26.