Skip to main content

PyVoIP is a pure python VoIP/SIP/RTP library.

Project description

pyVoIP

PyVoIP is a pure python VoIP/SIP/RTP library. Currently, it supports PCMA, PCMU, and telephone-event.

This library does not depend on a sound library, i.e. you can use any sound library that can handle linear sound data i.e. pyaudio or even wave. Keep in mind PCMU/PCMA only supports 8000Hz, 1 channel, 8 bit audio.

Getting Started

Simply run pip install pyVoIP, or if installing from source:

git clone https://github.com/tayler6000/pyVoIP.git
cd pyVoIP
pip install .

Don't forget to check out the documentation!

Basic Example

This basic code will simple make a phone that will automatically answer then hang up.

from pyVoIP.VoIP import VoIPPhone, InvalidStateError

def answer(call): # This will be your callback function for when you receive a phone call.
    try:
      call.answer()
      call.hangup()
    except InvalidStateError:
      pass
  
if __name__ == "__main__":
    phone=VoIPPhone(<SIP Server IP>, <SIP Server Port>, <SIP Server Username>, <SIP Server Password>, callCallback=answer, myIP=<Your computer's local IP>, sipPort=<Port to use for SIP (int, default 5060)>, rtpPortLow=<low end of the RTP Port Range>, rtpPortHigh=<high end of the RTP Port Range>)
    phone.start()
    input('Press enter to disable the phone')
    phone.stop()

Sponsors

Project details


Download files

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

Source Distribution

pyVoIP-1.6.6.tar.gz (40.5 kB view details)

Uploaded Source

Built Distribution

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

pyVoIP-1.6.6-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file pyVoIP-1.6.6.tar.gz.

File metadata

  • Download URL: pyVoIP-1.6.6.tar.gz
  • Upload date:
  • Size: 40.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyVoIP-1.6.6.tar.gz
Algorithm Hash digest
SHA256 8bccada55a395132f511df3431656cf28efdbf672c4df95815b3ac7a894e584e
MD5 a79d185d4c2b4923f1d775b65451c741
BLAKE2b-256 1052c06cdcb8a825f1d2f073a0a136ae319f7be0506b2386ba854588c277d76e

See more details on using hashes here.

File details

Details for the file pyVoIP-1.6.6-py3-none-any.whl.

File metadata

  • Download URL: pyVoIP-1.6.6-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pyVoIP-1.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 63732b43d671b215ba1511687d1b286335a3db53165782c6f732ed601c4ac725
MD5 235836876489706a2700340671fac566
BLAKE2b-256 ff5e0771ead5a58480dcb9451f4cb90d30b14d6e32b734a78c3655e1d4648c86

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 Pingdom Monitoring Sentry Error logging StatusPage Status page