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.0.tar.gz (48.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.0-py3-none-any.whl (47.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rfcvoip-1.7.0.tar.gz
  • Upload date:
  • Size: 48.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.0.tar.gz
Algorithm Hash digest
SHA256 462cf8c810b67a81a2d4efd7afba078713f434ec5dc180ad014bf0b004ac2348
MD5 b17542e232ef5bc73bc9db48888051b7
BLAKE2b-256 24ee64100222a1b01421547d9bb0eaa3edb5cedc9c24fae6b68aaba2b63eb6f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rfcvoip-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 47.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6af1efa4237a88e70ebbbfe09842453fc6d84519eec3f89d51f8db7a209ff270
MD5 94c37816e5b9127be51ca6191de60e89
BLAKE2b-256 fed61d0a478077f2948423908eeab970ec43e99f6b27c9be990162cd0ed90cd4

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