freescout-help-desk / freescout

FreeScout — Free self-hosted help desk & shared mailbox (Zendesk / Help Scout alternative)
https://freescout.net
GNU Affero General Public License v3.0
2.92k stars 484 forks source link

Whatsapp integration - fails to find webhook #2821

Closed iReserveApps closed 1 year ago

iReserveApps commented 1 year ago

Hi,

We are trying to setup Whatsapp via Twillio We followed the onboarding process. Number is active, Twillio account is fully onboarded. Activated the Whatsapp module in Freescout and entered the credentials for one of the mailboxes. However, Twillio ends in error, as the copied webhook is not reachable.

image

When we try to access that webhook via testing (postman, restclient) it indeed gives a 404 status request. Perhaps something went wrong during installing the module.

In log we see two statements

Mar 13, 12:27:27 [WhatsApp Webhook - 1msg.io] (Info) Empty user.
Mar 13, 12:22:41 [WhatsApp Webhook - Twilio] (Info) Incorrect Account SID received in webhook:

1msg.io is NOT selected. We double checked the Account SID, but that is the same as being send from Twillio.

Where can we see the details of this log, as it might be we are missing information?

iReserveApps commented 1 year ago

Additional analysis. We checked the whatsapp controller for Twillio and see // Check SID. if (($settings['twilio_sid'] ?? '') != $request->input('AccountSid')) { \WhatsApp::log('Incorrect Account SID received in webhook: '.$request->input('AccountSid'), $mailbox, true, $system); abort(404); }

As the message "[WhatsApp Webhook - Twilio] (Info) Incorrect Account SID received in webhook:" is not showing the Sid, it seems the webhook does not receive the Sid.

The second line "abort(404)" is actually confirming that Twillio is reporting the same url. 404 is also reported by twillio So why is the AccountSid undetected?

iReserveApps commented 1 year ago

We have found the cause of the issue. Two items were not updated. The customer class (cannot find the function byPhone) and the rpt_ready column in the module Reports. This was giving errors and hence throwing a fatal error.

We have posted other issues about local and dev environments in combination with an update which fails. Really struggling with the upkeep, which is unfortunate as we are so happy about the app itself. So basically: updates in production environment via the GUI fails. Which causes us to enforce a local environment + FTP changes. But that itself is not enough. DB changes need to happen as well.

We need a guideline how to

freescout-helpdesk commented 1 year ago

https://github.com/freescout-helpdesk/freescout/issues/2803#issuecomment-1464839190