Skip to content

Conversation

@roncodes
Copy link
Member

… session caching

roncodes and others added 9 commits December 29, 2025 14:25
- Add static sendSms() convenience method to CallProSmsService
- Create SmsService with automatic provider routing based on phone prefix
- Support explicit provider selection (twilio/callpro)
- Automatic fallback from CallPro to Twilio if not configured
- Smart routing: +976 numbers route to CallPro, others to Twilio
- Update VerificationCode model to use SmsService instead of direct Twilio
- Maintain backward compatibility with existing Twilio parameters
- Add comprehensive logging and error handling
- Remove flawed length-based logic that failed for many countries
- Properly handle + prefix (keep as is)
- Convert 00 international prefix to + format
- Support phone numbers of any length (Mongolia 8 digits, USA 10, China 11, etc.)
- Let providers handle validation for their specific requirements
- Tested with 15+ international number formats
- Create config/sms.php with default provider, routing rules, and options
- Merge SMS config in CoreServiceProvider
- Remove unnecessary 00 prefix conversion (Fleetbase already normalizes to E.164)
- Simplify normalizePhoneNumber() to just strip formatting characters
- Add environment variable support for SMS configuration
- Add isValidSenderId() method to check if sender ID is 8 digits
- Automatically fallback to default sender ID if provided ID is invalid
- Prevents errors when company uses alphanumeric sender IDs (Twilio-specific)
- Log warning when fallback occurs for debugging
- Fixes issue where VerificationCode with company sender ID fails for Mongolia numbers
- SmsService now filters out alphanumeric sender IDs before calling CallPro
- Only numeric 8-digit sender IDs are passed to CallPro
- Twilio-specific alphanumeric sender IDs (e.g., 'MYCOMPANY') are ignored for CallPro
- CallPro uses its configured default sender ID when invalid ID provided
- Revert CallProSmsService fallback logic (not needed with proper filtering)
- Fixes VerificationCode sending to Mongolia numbers with company sender IDs
- Alphanumeric sender IDs are Twilio-specific and should only be in twilioParams
- Remove $smsOptions['from'] = $senderId to prevent passing to all providers
- Keep only $smsOptions['twilioParams']['from'] = $senderId
- Ensures CallPro and other providers use their own configured sender IDs
- Prevents provider-specific options from leaking across providers
@roncodes roncodes merged commit 8e09d15 into main Dec 29, 2025
1 check passed
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.

2 participants