GithubHelp home page GithubHelp logo

baresipy's Introduction

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 = "[email protected]"

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

baresipy's People

Contributors

jarbasal avatar danielkucera avatar neondaniel avatar nick-traeger avatar onurgule avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.