PIONEERS Facebook Messenger Webhooks

DO YOU HAVE FACEBOOK MESSENGER INSTALLED ON YOUR MOBILE DEVICE?

  • YES

  • NO


Results are only viewable after voting.

ABSGINC

You can call me Scott.
Joined
Oct 1, 2014
Messages
59
Reaction score
31
My how a year has gone by.

Thank you @wardmundy for all your work bringing this Facebook Webhooks to life for the IncrediblePBX.

I also recall last year proudly watching @Sylvain Boily at AstriCon 2017 release a quick example of the concepts I shared in this form -
- (08:40 into this video ) - He demonstrate using the Facebook Messenger Webhooks in Wazo with the API structure offered to developers in Wazo through their control panel and REST API. Pretty neat stuff as well.

At home Security enthusiasts may be interested in re-wakening the Facebook Webhooks example in the already compiled and running on IncrediblePBX13 alarmreceiver.so

Currently I have my contact ID alarm panel set to call a local extension that executes the alarm receiver program. My Alarm panel is behind an ATA and DTMF is delivered inband to a local extension behind the ATA. My alarm receiver events are delivered via facebook messenger instantly as where I can then tune into my remote video surveillance and activate two-way audio or listen oneway by dialing into the intercom functions of an individual room, or conferencing all rooms to listen over the entire house. I

n the Webhooks of facebook and my own logic I can setup functions to arm, disarm, open garage, porch lights, etc, and of course I can use my PBX to dial into these functions my Facebook BOT performs, via IVR options.. The possibilities are endless to the coder at heart.

I'll be attending AstriCon 2018 the week after next. I hope to show you guys some new stuff I have been working on since last years adventure.. Here's to finding 5 minutes! :beta1::lurk5:
 

trupsalms

Member
Joined
May 13, 2011
Messages
337
Reaction score
6
From Facebook Dev Webhook setup, verify and save.
  • The URL couldn't be validated. Callback verification failed with the following errors: HTTP Status Code = 500; HTTP Message = Internal Server Error
Also:
[error] [client 173.252.87.10] PHP Parse error: syntax error, unexpected '[' in /var/www/html/fb/index.php on line 32
 

trupsalms

Member
Joined
May 13, 2011
Messages
337
Reaction score
6
@ABSGINC, thx you gave me something to research, it was an issue with the php version since it wasn't specified, i was at 5.3 and now i'm 5.6, connection to the facebook webhook works, but now i'm near another issue, when i type howdy i get no reply back from the server.
 

trupsalms

Member
Joined
May 13, 2011
Messages
337
Reaction score
6
@wardmundy @ABSGINC I've gotten the webhooks connected on the fbdev, I've been searching through logs trying to figure out why I'm unable to get a reply back from howdy, any assistant would be great.
 

ABSGINC

You can call me Scott.
Joined
Oct 1, 2014
Messages
59
Reaction score
31
@wardmundy @ABSGINC I've gotten the webhooks connected on the fbdev, I've been searching through logs trying to figure out why I'm unable to get a reply back from howdy, any assistant would be great.

The simplest of steps missed could throw you for loops for days, or forever.. how about your IPtables? Did you successfully whitelist Facebook, did you do it correctly so it survived a reboot and the rules remain consistent?

Verify your firewall rules with ( iptables -L )

Can Facebook access the URL through your firewall?
(If so you should see requests in your error and access log for https)

You could TRY turning IPtables off and see if you then get activity in the logs from Facebook.. if you see activity already this isn't aven an issue (firewall/IPtables)

To turn off ip tables type (service iptables stop) .. DO NOT LEAVE THIS OFF.. reboot it execute "service iptables start" after your test. If you find your firewall or iptables is a factor then research the steps required in the documentation Ward provided..

Overall you need to see if you see then anything in your log.. Facebook should be blowing up your port 443 trying to satisfy the messages waiting to go to your bot.. (so long as your Facebook app page is setup properly to deliver to this webhook, and your app is subscribed correctly to the messages hooks oitlined in the tutorials, .....and if you don't see errors coming from Facebook ips trying to access /fb then you have a networking issue maybe.. ... Try finding a snip from your access and error log for HTTPS around the time of your tests that point to the FB URL.... if it says SOMETHING there I can guide you through the error.. also with repeated failures from Facebook to your webhooks URL, Facebook will attempt with LESS frequency as it reaches continual errors, so you might need to be patient while you work out the issue with clues in your Apache log.

Keep in mind if your bot was unable to answer Facebook's request it would continually retry every so often... Theoretically you should see stacks of Facebook requests in your log continually since your first attempt at saying howdy...
 
Last edited:

Members online

No members online now.

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top