exten.bot is a Django-based web interface for creating VoIP voice bots that can be connected to any software or hardware PBX supporting SIP. The system is built on an OpenSIPS server and the opensips-ai-voice-connector module, using the OpenAI real-time API for artificial intelligence. The platform supports dify.ai workflows ( or other MCP servers), allowing the design of bot logic and integration with other systems via function calls.
Function Calling by the Bot
The functionality of the voice bot can be greatly expanded by connecting additional functions that it will call during a dialogue.
In the personal account, you can add a function and then link it to one or several voice bots.
Function fields:
Name: human-readable name of the function
URL: webhook address that processes requests for this function and returns a response
Bearer Token: authorization token (if required)
Function Description (Json schema): structured description of the function for the bot. Example.
Input Schema for Webhook: template for the webhook’s input data
After adding a function, you can link it to the bot in the bot editing form.
Examples and more details about working with functions are available here.
Creating a Voice Bot with exten.bot
To create a simple voice consultant bot based on a text instruction, go to Settings - Bots and create a new bot.
Types of exten.bot Voice Bots:
Since an exten.bot voice bot is a SIP account, depending on its role (server or client), you can create two types of records:
Server (registrar), default: SIP account credentials are provided by the exten.bot server. Use them on your server to connect to exten.bot.
Client (registrant): when creating a bot, specify the SIP account credentials (login, password, domain) issued by your server. exten.bot will connect to your server as a client.
Bot field descriptions:
Domain - exten.bot
Username and Password - automatically generated SIP account credentials for connecting to your PBX
Token - OpenAI token
Model - AI model on which the voice bot will operate
Voice - voice for the voice bot's speech synthesis
Functions: a set of pre-created functions that the voice bot will call during the dialogue.
Instruction - text instruction guiding the voice bot's behavior
Welcome Message - the message the bot will speak upon connection
Transfer URI - SIP address to which the voice bot will transfer calls upon subscriber request. Example: sip:100@10.8.0.1 (will work if the bot is connected to the same PBX)
SIP connection parameters
Server address: exten.bot
Port: 5060 UDP
RTP port range: 10000:20000 UDP
Supported codecs: G711 (μ-law and A-law)
Contact field: Username received when creating the bot
Maximum number of contacts: 5
SIP URI of voice bot: openai@exten.bot or 70000000000@exten.bot
Connecting the Voice Bot to the FreePBX
To connect the voice bot to the PBX, use the obtained username and password, and the domain exten.bot for registration.
The example shows the PJSIP trunk settings in FreePBX.
Add PJSIP Trunk - General - Trunk Name = <username>
-- pjsip Settings - General -
Username and Auth username = <username>
Secret = <password>
SIP Server = exten.bot
Context = from-internal
PJSIP Settings - Advanced
Contact User = <username>
From Domain = exten.bot
From User = <username>
Connecting a Voice Bot to FusionPBX
1. Accounts > Gateways > Add
Gateway: exten.bot
Username: <username>
Password: <password>
From Domain: exten.bot
Proxy: exten.bot:5060
Profile: external
2. Applications > Bridges > Add
Name: bot
Action: Gateway
Gateways: exten.bot
Destination Number: openai@exten.bot
3. Dialplan > Outbound Routes > Add
Gateway: Bridges > bot
Dialplan Expression: 500 (for example)
Then call 500 ext to connect to the OpenAI voice bot