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

rfcvoip-1.7.3.tar.gz (53.1 kB view details)

Uploaded Source

Built Distribution

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

rfcvoip-1.7.3-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

Details for the file rfcvoip-1.7.3.tar.gz.

File metadata

  • Download URL: rfcvoip-1.7.3.tar.gz
  • Upload date:
  • Size: 53.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rfcvoip-1.7.3.tar.gz
Algorithm Hash digest
SHA256 9ef4693dee96f835dd50b8c628993d5ebd68c109530959920fecc14c2657bb52
MD5 5299bf392d4ba8a4f4b6264f68b41625
BLAKE2b-256 031ae3f8594785af69fbc77cffac0ba04c107fb1f3cf6ab234f53b989a47fe10

See more details on using hashes here.

File details

Details for the file rfcvoip-1.7.3-py3-none-any.whl.

File metadata

  • Download URL: rfcvoip-1.7.3-py3-none-any.whl
  • Upload date:
  • Size: 52.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for rfcvoip-1.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9204601001f655d7ed7d2403548036950786e80a4a9eee8001186fc83daca39b
MD5 8b6c904382eaf31a930ecef38c823ecb
BLAKE2b-256 a4bbe12d2a90f67baf3cbaf1db86c377499b831ff36438c89db285bc931fe280

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