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
Location
Flint, MI
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.
 
  • Like
Reactions: ABSGINC

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
Location
Flint, MI
@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.

Latest Posts

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,272
Messages
136,516
Members
14,504
Latest member
jebin