Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Baresipy

A python wrapper around baresip

Make voip calls/bots from python!

install

sudo apt-get install baresip
sudo apt-get install ffmpeg
pip install baresipy

usage

scripted calls

from baresipy import BareSIP
from time import sleep

to = "jarbas_laptop@sipx.mattkeys.net"

gateway = "sipx.xxxxx.net"
user = "xxxxx"
pswd = "xxxxxx"

b = BareSIP(user, pswd, gateway)

b.call(to)

while b.running:
    sleep(0.5)
    if b.call_established:
        b.send_dtmf("123")
        b.speak("this is jarbas personal assistant speaking. this was a test")
        b.speak("Goodbye")
        b.hang()
        b.quit()

handling events

from baresipy import BareSIP
from time import sleep
from pyjokes import get_joke


class JokeBOT(BareSIP):
    def handle_incoming_call(self, number):
        self.accept_call()

    def handle_call_established(self):
        self.speak("Welcome to the jokes bot")
        self.speak(get_joke())
        self.speak("Goodbye")
        self.hang()


gateway = "sipx.xxxxx.net"
user = "xxxxxx"
pswd = "xxxx"

b = JokeBOT(user, pswd, gateway)

while b.running:
    sleep(1)

Credits

This work as been sponsored by Matt Keys, eZuce Inc

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

baresipy-1.0.0a4.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baresipy-1.0.0a4-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file baresipy-1.0.0a4.tar.gz.

File metadata

  • Download URL: baresipy-1.0.0a4.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for baresipy-1.0.0a4.tar.gz
Algorithm Hash digest
SHA256 94d7673aa98f4bf9a39d8444ce9c5d8700d486c0195729efde58488e5fbbe4c2
MD5 d779d275b5a069eee187effc747dcefd
BLAKE2b-256 e345a1af240580d8188620071f99f5a9854ae105710f95f58b67b8fb74dc54ca

See more details on using hashes here.

File details

Details for the file baresipy-1.0.0a4-py3-none-any.whl.

File metadata

  • Download URL: baresipy-1.0.0a4-py3-none-any.whl
  • Upload date:
  • Size: 32.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for baresipy-1.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 c08f31d64bb3d5b6d3f0d6bbe733e7f9ff450305fcf986e81dac887e54a960b5
MD5 d587d023d44646238aa5719683c6fef7
BLAKE2b-256 5e6edfd208497581f102dbc70b7b9433b9941dcfd92fe567f4a06921408c9c10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page