# SMS Replies via Twilio Webhook

**URL:** <https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240>\
**Category:** General Discussion\
**Created:** [July 22, 2021, 8:57pm UTC](https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240 "2021-07-22T20:57:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 22, 2021, 8:57pm UTC](https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240/1 "2021-07-22T20:57:54Z")

</div>

Mautic 3.3.3, ec2 server, ubuntu 20.4, apache

Does anyone know if you need to turn something on in order to RECEIVE sms replies via twilio?

I followed the instructions here: [SMS Text Messages | Mautic](https://docs.mautic.org/en/channels/marketing-messages/sms)  
for setting up the webhook in Twilio and I have verified that Twilio receives the reply and attempts to send it to [https://myurl.online/sms/twilio/callback](https://myurl.online/sms/twilio/callback). However, it always results in a 500 server error.

Twilio plugin is turned on (so I can send SMS no problem).

Any ideas?

Thanks!

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 28, 2021, 9:17pm UTC](https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240/2 "2021-07-28T21:17:33Z")

</div>

We will be able to help you better if you give us more details about the 500 error, like the logs

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 28, 2021, 9:48pm UTC](https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240/3 "2021-07-28T21:48:53Z")

</div>

Thanks, @nsomaru

I just replied to a text message with a return text message (which didn’t go through to mautic), and I can see this in the UI error log for the same time my text was sent (the one in mautic, not the server).

`[2021-07-28 21:32:58] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\UndefinedFunctionException: "Attempted to call function "mb_strcut" from namespace "libphonenumber"." at /var/www/html/vendor/giggsey/libphonenumber-for-php/src/Matcher.php line 72 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException(code: 0): Attempted to call function \"mb_strcut\" from namespace \"libphonenumber\". at /var/www/html/vendor/giggsey/libphonenumber-for-php/src/Matcher.php:72)"} []`

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 28, 2021, 10:10pm UTC](https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240/4 "2021-07-28T22:10:38Z")

</div>

Looking like you’re missing the php mbstring package. Depending on your OS and deployment, a google search should direct you on how to install it.

For Ubuntu 20.04 and php 7.4 it should be: `sudo apt-get install php7.4-mbstring`

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 29, 2021, 5:58pm UTC](https://forum.mautic.org/t/sms-replies-via-twilio-webhook/20240/5 "2021-07-29T17:58:40Z")

</div>

@nsomaru Thank you. That was exactly it, though I’m running php7.3, so adjusted your code accordingly and then verified it was enabled with `php -i | grep mbstring`

 ![2021-07-29_13-58-00](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/e/e9e896f6c80afef9fa18ea25f2dc32f9ce531abe.png)
