Skip to content

Add DIDforsale SMS/MMS provider with API v4.0 support#89

Open
skybird-dev wants to merge 8 commits intosimontelephonics:release/16.0from
skybird-dev:release/16.0
Open

Add DIDforsale SMS/MMS provider with API v4.0 support#89
skybird-dev wants to merge 8 commits intosimontelephonics:release/16.0from
skybird-dev:release/16.0

Conversation

@skybird-dev
Copy link

Overview

This PR adds full SMS and MMS support for DIDforsale via their API v4.0 to the FreePBX SMS Connector module.

Changes

  • New File: providers/provider-Didforsale.php - Complete DIDforsale provider implementation (136 lines)
  • Updated: module.xml - Version bumped to 16.0.19 with changelog entry
  • Updated: README.md - Added DIDforsale documentation link

Features

SMS Messaging - Full outbound SMS support via DIDforsale API v4.0
MMS Support - Media URLs can be included in sendMedia() method
Inbound Webhooks - Fully functional webhook handler for receiving inbound SMS
Dual-Credential Authentication - Implements v4.0 requirement for both apikey and accesstoken
Error Handling - Comprehensive logging and validation

Implementation Details

  • Authentication: Requires apikey + accesstoken (both credentials send in JSON body)
  • API Endpoint: https://api.didforsale.com/didforsaleapi/index.php/api/V4/SMS/Send
  • Webhook URL: https://{hostname}/smsconn/provider.php?provider=didforsale
  • Inbound Handler: Routes SMS to FreePBX connector via getMessage() and emitSmsInboundUserEvt()

Testing

Inbound SMS: Verified working - webhooks receive SMS and store in FreePBX database
Database Integration: SMS visible in SMS Connector UI
HTTPS/TLS: Connectivity confirmed from external hosts
Outbound SMS: Code complete - awaiting DIDforsale campaign registry configuration (external requirement)

Commits

  • aff64be: Add DIDforsale provider with SMS and MMS support
  • 666ebb7: Bump version to 16.0.19, add DIDforsale API v4 documentation references
  • 79867af: Add API v4.0 access token authentication to DIDforsale provider
  • 60442dc: Fix DIDforsale inbound SMS webhook handler to use proper connector methods
  • 491cb84: Fix DIDforsale API v4.0 authentication - use HTTP headers instead of body

Configuration

Users will need to:

  1. Enter DIDforsale API credentials (apikey + accesstoken) in SMS Connector settings
  2. Configure webhook in DIDforsale portal to: https://{hostname}/smsconn/provider.php?provider=didforsale
  3. For outbound SMS: Ensure campaign registry is configured in DIDforsale account

Compatibility

Version Info

  • Module Version: 16.0.19

…thods

- Replace non-existent receiveMessage() call with connector->getMessage()
- Add connector->emitSmsInboundUserEvt() to properly notify FreePBX system
- Improve error handling and logging in callPublic() method
- SMS messages will now be properly stored and routed to users/dialplan
…body

- Move APIKEY and accesstoken to HTTP request headers
- Keep SMS parameters (from, to, text, media_urls) in JSON body
- Matches DIDforsale API v4.0 authentication requirements
- Fixes 'Invalid format of header' error on outbound SMS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant