Twilio Proxy needs a phone number to function. When configuring a phone number through the Twilio Console there is some logic that happens behind the scenes you should be aware of.
The Issue
By Default when using the Twilio Console to configure proxy, Proxy will attempt to update both the Voice and SMS incoming webhook URLs. If you would prefer to use proxy for only Voice or only SMS the following instructions will help show you how to change the default behavior. A friendly reminder, If you are updating a phone number to make use of both Voice and Messaging this guide does not apply and you can follow the standard instructions we outline in the proxy quickstart guide.
The Solution
Some customers may find their Phone Number webhook is overwritten with the proxy configuration and when they go to add the webhook it overwrites the proxy integration. In order to get around this situation:
- Go to the Proxy -> Services -> ServiceName -> Numbers Page
- Click the "+" Icon
- Select the phone number from the list and click the assign button.
- This will automatically reset the webhook in the Phone Numbers -> Manage -> Active Numbers -> Configure Page to use a Proxy Service
- Run the following API command to overwrite the incoming webhook URL and remember to replace with your Phone Number Sid(PNXXX):
- For Voice/Fax Calls
twilio api:core:incoming-phone-numbers:update \ --sid PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \ --voice-url https:/somewebhookurl.com
- For SMS/Messaging Texts
twilio api:core:incoming-phone-numbers:update \ --sid PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \ --sms-url https:/somewebhookurl.com
- For Voice/Fax Calls
- Verify your proxy and webhook are working by calling and texting the number you configured earlier. Is everything working as expected? Great! If not please see the still having trouble section.
The Solution for Studio Flows
- To update the webhook to a studio service go to the Studio -> Flows page
- Select the studio name you would like to forward calls or text messages to.
- Click the trigger box.
- Copy the webhook URL.
- Run the webhook api command from the solution section only this time replace the webhook url with the Studio Flow webhook we copied earlier.
- For example to update the voice webhook to redirect to studio:
twilio api:core:incoming-phone-numbers:update \ --sid PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \ --voice-url https://webhooks.twilio.com/v1/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Flows/FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- For example to update the voice webhook to redirect to studio:
- Verify your proxy and studio webhook are working by calling and texting the number you configured earlier. Is everything working as expected? Great! If not please see the still having trouble section.
Still Having Trouble?
If you can rule out all the above issues, Twilio's Support team can help investigate what went wrong with configuring your proxy service. Please open a support request with the following:
- Phone Number SIDs (PNxxxx) from Active Number logs that occurred with the last 24 hours.
- A screenshot of your Proxy -> Service -> ServiceName -> Numbers page configuration.