Building a programmable voice client with Python, PJSIP and VoIPstudio (Part 2)
- Tim Meredith
Table of contents
Connecting Python (PJSIP) to VoIPstudio in 30 minutes
This guide follows on from AI-powered voice assistant with Python, PJSIP and VoIPstudio (Part 1) and walks through the basic steps required to build a programmable SIP client using Python and connect it to VoIPstudio. Examples based on an open-source project developed by Luis Miguel.
Step 1: Create a VoIPstudio account
- Sign up for a free trial.
- Create a SIP extension.
- Note the following credentials:
- SIP Username
- SIP Password
- SIP Domain (e.g. sip.voipstudio.com)
These credentials will be used for registration.
Step 2: Clone the open-source client
Repository:
https://github.com/luismiguelbp/voip-client-python
Project: voip-client-python
Clone locally:
git clone https://github.com/luismiguelbp/voip-client-python.git
cd voip-client-python
This project already includes:
- SIP account registration logic
- Call initiation handling
- Media stream management
- Event callbacks
Step 4: Place an outbound call
Minimal example:
call = MyCall(account, pj.CallOpParam(True))
call.makeCall("sip:+441234567890@sip.voipstudio.com", pj.CallOpParam(True))
From here you can:
- Inject pre-recorded audio
- Generate speech dynamically
- Attach real-time AI logic
- Process inbound audio streams
Step 5: Extend with AI
You now have a programmable voice channel.
From this point you can integrate:
- Speech-to-text engines
- LLM-driven conversational models
- Custom escalation workflows
- Dynamic IVR trees
VoIPstudio handles:
- SIP transport
- Call routing
- PSTN connectivity
- Global number provisioning
You control the intelligence layer.
Deployment options
Because the client is standards-based SIP, it can run:
- On-premise (industrial environments)
- On a Linux server
- In a Docker container
- In a cloud VM
- Inside a larger automation platform
No proprietary telephony SDK is required.
Why this approach scales
Many AI voice platforms tightly couple intelligence and telephony.
This architecture separates them:
- AI can evolve independently.
- Telephony infrastructure remains stable.
- Developers maintain full protocol-level control.
For system integrators and infrastructure engineers, this reduces long-term lock-in risk.
Next steps
- Fork the repository.
- Connect it to your VoIPstudio trial.
- Build your first programmable voice workflow.
If you need SIP trunking at scale or global number provisioning, VoIPstudio provides the transport layer.
More from the blog
Want to improve your business communication?
Unlock enterprise-class call center power at affordable prices – no hardware, no delays, no surprises!