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 such as 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.credentials import CredentialsManager
from pyVoIP.VoIP.call import VoIPCall
from pyVoIP.VoIP.error import InvalidStateError
from pyVoIP.VoIP.phone import VoIPPhone, VoIPPhoneParamter

class Call(VoIPCall):

  def ringing(self, invite_request):
      try:
          self.answer()
          self.hangup()
      except InvalidStateError:
          pass

if __name__ == "__main__":
  cm = CredentialsManager()
  cm.add(<SIP server username>, <SIP server password>)
  params = VoIPPhoneParamter(<SIP server IP>, <SIP server port>, <SIP server user>, cm, bind_ip=<Your computers local IP>, call_class=Call)
  phone = VoIPPhone(params)
  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-2.0.0a4.tar.gz (58.0 kB view details)

Uploaded Source

Built Distribution

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

pyVoIP-2.0.0a4-py3-none-any.whl (56.0 kB view details)

Uploaded Python 3

File details

Details for the file pyVoIP-2.0.0a4.tar.gz.

File metadata

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

File hashes

Hashes for pyVoIP-2.0.0a4.tar.gz
Algorithm Hash digest
SHA256 2d606c85755410e13d9e0fc84678bee924dbde14cbcc6cad3e2a8556ffeef9ee
MD5 9e70d41531ffd7e2e7262c344e8abb99
BLAKE2b-256 49cda55f036d7167c4e771ede5e2adb80775a1b0753726ac82a259ce87144680

See more details on using hashes here.

File details

Details for the file pyVoIP-2.0.0a4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pyVoIP-2.0.0a4-py3-none-any.whl
Algorithm Hash digest
SHA256 e208e4bb4c743ccc3389a05cf64e26481c749b6bd64eb1439f9d64d235466060
MD5 3561664c801ee45c17cc792e6da6e1ca
BLAKE2b-256 75708991a599d5a66cf52bb11df14088cab6cb0b179fd8e8883bc42ffe9d054f

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