1

Oh, boy - this is a new one for me.

I've had a Plivo-powered SMS application running (more or less flawlessly) for several months. 2 days ago, for no reason, it stopped responding to my inbound texts. I didn't have a lot of time to figure it out then, but I finally got time to look at things and it's frankly ugly.

As much detail as I can provide: I'm running my webserver through HostGator, and it's worked fine in the past. My handling language for Plivo is PHP. Right now, the inbound SMS doesn't even get to my handling script, so that's where the error is - Plivo reports the messages as "undelivered", and the debug-level error log provides me with this nice warning:

Incoming Message 0287e6ce-0d30-11e6-a4b5-22000afd08f6: fetch_message_url POST (URL HERE) with {'To': 'Valid Number', 'From': 'Another Valid Number', 'TotalRate': '0', 'Units': '1', 'Text': 'Weather', 'TotalAmount': '0', 'Type': 'sms', 'MessageUUID': 'Valid UUID'} -- failure- 406 Not Acceptable!

Not Acceptable!

An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.

Note that any identifying info has been removed from that blockquote. I'm currently downloading the modsec error_log, and at the very top is this:

[Wed Apr 27 23:11:39 2016] [notice] Digest: generating secret for digest authentication ...

The timestamp is precisely 1 minute after the last successfully-delivered SMS, and about 30 minutes before the first failed one. I don't know if that error log is when modsec started up, or what's going on, but I figure this may have something to do with it. I'm trying to find a solution, and here's what I'm coming up with so far:

Find the Plivo inbound SMS IP (the one it POSTS from) and whitelist it in modsec

OR

Find a way to modify what the PHP script expects so it can allow the post to go through?

OR

Anything else you can recommend. I'm searching through (what's downloaded of) the modsec error log, and it's showing a lot of things that I don't believe apply to my specific subaccount. I haven't found reference to my user folder or "plivo" in it thus far. Recommendations?

Helpful
  • 702
  • 4
  • 16

1 Answers1

1

Contact HostGator support and ask them to allow incoming POSTS from non-HostGator servers to your script file or your whole site.

Or you can change the method Plivo uses to make the request to a GET method as opposed to the default POST method.

In the Plivo Manage Dashboard - Number section (looks like this image below) Plivo Number click on the Application associated with your number (Conference Bridge in my example). In the next page look for the message url and method. Edit Plivo Application

Change method to GET and click update at the bottom. Now you shouldn't get this error.

CharlieC
  • 502
  • 3
  • 8