feat: Improved file download endpoint, removed query optimizer, fixed…#183
Merged
feat: Improved file download endpoint, removed query optimizer, fixed…#183
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… session caching