simontelephonics / smsconnector

SMS Connector module for FreePBX 16 and 17
https://simon.tel/open-source/
GNU General Public License v3.0
43 stars 16 forks source link

Add BRCK #54

Open matalaweb opened 2 months ago

matalaweb commented 2 months ago

Adding BRCK (brck.com) as a provider.

billsimon commented 2 months ago

Hi @matalaweb , are you planning to implement inbound messaging also or only outbound?

matalaweb commented 2 months ago

My apologies, I do intend to implement inbound. I will create a new PR when implemented.

billsimon commented 2 months ago

No worries; let's keep using this same branch & PR. Comment when you've got the inbound messaging done and ready for review.

matalaweb commented 2 months ago

I'm struggling to find the inbound message handling method. Could you provide some guidance as to where I should be looking? I apologize, this is my first time touching a fbpx module.

billsimon commented 2 months ago

@matalaweb Sorry I missed your question last week. Take a look at any of the other provider-*.php files. You implement the callPublic($connector) function such that it receives the webhook sent by the provider (in whatever format they send, usually JSON), use the $connector->getMessage function to ingest it into the SMS system, and if it's a MMS, use the $connector->addMedia function to ingest the media attachments. When done, call $connector->emitSmsInboundUserEvt(...) to signal that a new SMS has been received and respond to the provider with the appropriate code (usually 200 or 202).