I'm architecting an IVR app that will be built using a Python framework (e.g. Flask, etc.). The app receives an audio stream from Twilio via Websockets when a user calls a designated number that is defined within the Twilio user dashboard. Concurrently, Twilio also makes POST requests to a webhook provided by me. How do I add a load balancer to work with Twilio so in the event that a started call overwhelms resources on 1 containerized instance of the app, the load balancer transfers that call with all its state to another containerized app instance without the user noticing anything? (seamless to the user) Has anyone done this before? If so, could you please share your experience. Much appreciated. Thanks.
Using a Load Balancer with Twilio for IVR App
49 Views Asked by Foobar At
1
There are 1 best solutions below
Related Questions in PYTHON
- How to store a date/time in sqlite (or something similar to a date)
- Instagrapi recently showing HTTPError and UnknownError
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to create a regular expression to partition a string that terminates in either ": 45" or ",", without the ": "
- Python Geopandas unable to convert latitude longitude to points
- Influence of Unused FFN on Model Accuracy in PyTorch
- Seeking Python Libraries for Removing Extraneous Characters and Spaces in Text
- Writes to child subprocess.Popen.stdin don't work from within process group?
- Conda has two different python binarys (python and python3) with the same version for a single environment. Why?
- Problem with add new attribute in table with BOTO3 on python
- Can't install packages in python conda environment
- Setting diagonal of a matrix to zero
- List of numbers converted to list of strings to iterate over it. But receiving TypeError messages
- Basic Python Question: Shortening If Statements
- Python and regex, can't understand why some words are left out of the match
Related Questions in WEBSOCKET
- Resolving ElephantIO ServerConnectionFailureException: Error establishing connection to server
- Django socketio process
- How to decode audio stream using tornado websocket?
- Java and React WebSocket - Error Connection
- Socket.io nodejs server .NET connection
- Troubleshooting WebSocket 502 Error in Python Code
- Getting an error in Socket.io wordle project
- Best practices with realtime data / websockets. Send vs. revalidate data
- My socket.io web socket application is not sending data to some users
- Android 13 & 14 seem to close WebSocket connection, if i put app in background, after ~20s
- Audio bytes chunks getting corrupted during streaming using Django and Websockets
- Odoo live chat not working when using apache reverse proxy
- websocket Fatal error message stating "Failed to listen on tcp://0.0.0.0:8080: Address already in use
- Stomp connection using JWT token in Python
- Symphony Fintech (XTS) market-data socket data integration in PyQt6 using python3
Related Questions in TWILIO
- Twilio Salesforce integration (Chat Transcripts)
- How to set up "No Input Prompts" for whatsapp bot which is developed on Google Dialogflow CX and deployed through Twilio
- How to add context to chat-gpt twilio customer service bot?
- Stop Audio Stream on Twilio WS - Python
- Why does Twilio Studio insert line breaks around variables in my text and json?
- I want to auto update the Primary handler fails webhook Url using twilio functions, can someone guide me?
- Endpoint URL to connect the Dialogflow CX agent to WhatsApp using Twilio
- How to stream audio of <Dial> to websocket?
- Can Twilio save a voicemail in MP3 format when using the AWS S3 external storage option
- Cann't send back data using websocket for Twilio call
- Trying to send Twilio webhook to Kommo crm
- Twilio ASP.NET Web Api Request Validation - 'Specified method is not supported' When Attempting To Read From Content Stream
- Looking to trigger webhook on all api created sms sent messages w/o passing messaging channel or webhook parameter
- Migrating from whatsApp Template to Content Builder
- Twilio: is it possible to finish the <Dial> verb before timeout?
Related Questions in LOAD-BALANCING
- In rke kube-proxy pod is not present
- Load balancing using NGINX between sites that are in different docker-containers in the Portainer environment
- Issues with load balancer with siteminder login issue
- How to set weight of enpoints durin laod balancing in wso2 manager
- Docker nginx ELB(load balancer) 499 error
- Least Connection Load balancing using Grpc
- Network load balancer security group doesn't seem to work to restrict access to only another security group
- Spring Cloud Gateway Circuit Breaker Blocks Load Balanced Route
- nginx ingress TCP port Enable Sticky based routing
- Setting up LoadBlancer for direct access to SQL Server with Minikube
- nginx load balancer on top of two selenium grids
- Strange behaviour of Laravel application behind HAPROXY load balancer
- IOREDIS: How to load balance read queries when there are multiple slaves to a single master
- Google cloud load balancer: Redirect host and add base path while keeping the remaining path intact
- Nginx Load Balancing session sticky for internal upstream server requests
Related Questions in IVR
- Forward call from Twilio Studio to SIP End point
- IVR - Is it possible to gather multiple inputs from 1 question and then do a nested split based off those inputs?
- FreeSWTICH Language Bundle Customization
- AWS Connect - Connect Existing SIP infra as inbound to AWS Connect IVR
- Fetch Audio for IVR
- How to use conference transfer in avaya aaod to ensure that ivr does not exit during transfer
- Twilio Studio - how to play back gathered digits individually with a pause?
- Using a Load Balancer with Twilio for IVR App
- How to fetch contact_id using customer phone number in nodejs?
- Authorization problem when transferring a call to an external number in an IVR module using VXML
- Twiml-Autopress digit and Input it in a gather function
- Freeswitch Hangup issue
- What technology should we use to build a realtime voice call analysis?
- Twilio IVR Setup
- Twilio - Transcribe voice answer from IVR
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I don't think you can easily achieve what you described of "moving" an in-progress call that caused an overload to a new container. But, here are some ideas for how to handle/prevent an overload.
Option 1 - Load balancing proactively. Send x% of the incoming requests to one container and x% to another container. This "round-robin" is implemented by you prior to the call starting. This means each container gets x% of the traffic and you always have more capacity than is needed. Add more containers based on your monitoring of the used capacity.
Option 2 - Use a backend service that scales automatically. For example, I use Azure Functions which will scale automatically (pretty quickly too).
Option 3 - Wait for an overload to occur, sacrifice that call, and then move subsequent calls to an unused container using the Twilio fallback url.
Twilio's voice urls have a primary and fallback url. The fallback url will be used when the primary url fails. The fail could be due to overload or unavailability. Your application will need to return the HTTP response that indicates failure. The documentation from Twilio on Availability and Reliability may give you some ideas.
You could also detect an overload, try to Stop the Stream and then re-start the Stream to a healthy container. Figuring out how to recover from a failure while experiencing the failure sounds tricky to implement and test.