Extend Bolna with new Telephony Providers
masterTo add support for a new telephony provider (e.g., Vonage, Telnyx), ensure the provider supports bi-directional streaming and follow these four steps:
- Verify Streaming Support: Confirm the provider supports bi-directional streaming.
- Implement Input Handler: Create a telephony-specific input handler file in
bolna/input_handlers/telephony_providers. This file must contain custom functions that extend thetelephony.pyclass and define how event packets from the provider are ingested. - Implement Output Handler: Create a telephony-specific output handler file in
bolna/output_handlers/telephony_providers. This file must extend thetelephony.pyclass and handle converting audio from the synthesizer class into a supported format for streaming over the provider's websocket. - Create a Dedicated Server: Write a dedicated server to initiate calls over websockets. You can use
local_setup/telephony_server/twilio_api_server.pyas a reference implementation.