Technology and Innovation

Building a programmable voice client with Python, PJSIP and VoIPstudio (Part 2)

Tim Meredith
An illustration with a Python, PJSIP and VoIPstudio logos and an AI voice assistant illustration

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

  1. Sign up for a free trial.
  2. Create a SIP extension.
  3. 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:

1git clone https://github.com/luismiguelbp/voip-client-python.git
2cd 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:

1call = MyCall(account, pj.CallOpParam(True))
2call.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.

Read this post in: Deutsch, Español, Polski, Português

Tim Meredith

Tim Meredith is a telecoms and technology business leader with extensive experience across VoIP, SaaS, and UCaaS. As founder and director of multiple marketing and technology businesses, he writes about business communications, cloud telephony, customer experience, and telecom industry trends.

More from the blog

See all posts

Want to improve your business communication?

Unlock enterprise-class call center power at affordable prices – no hardware, no delays, no surprises!