Skip to content

Commit

Permalink
Updated package for upload to PyPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
tayler6000 committed Feb 7, 2022
1 parent 1265f9d commit 777109f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/
pyVoIP.egg-info
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
# pyVoIP
PyVoIP is a pure python VoIP/SIP/RTP library. Currently, it supports PCMA, PCMU, and telephone-event.

Please note this is still in development.

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.
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 put pyVoIP into your site-packages folder.
Simply run `pip install pyVoIP`, or if installing from source:

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

Don't forget to check out [the documentation](https://pyvoip.readthedocs.io/)!

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

```python
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
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()
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()
```

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
37 changes: 30 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
from setuptools import find_packages
from setuptools import setup


with open("README.md", "r", encoding='utf-8') as f:
long_description = f.read()

setup(
name = 'pyVoIP',
version = '1.5.2',
description = 'PyVoIP is a pure python VoIP/SIP/RTP library.',
author = 'Tayler Porter',
author_email = '[email protected]',
url = 'https://github.com/tayler6000/pyVoIP',
packages = find_packages()
name='pyVoIP',
version='1.5.2',
description='PyVoIP is a pure python VoIP/SIP/RTP library.',
long_description=long_description,
long_description_content_type="text/markdown",
author='Tayler Porter',
author_email='[email protected]',
url='https://github.com/tayler6000/pyVoIP',
project_urls={
"Bug Tracker": "https://github.com/tayler6000/pyVoIP/issues",
"Documentaiton": "https://pyvoip.readthedocs.io/"
},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Telecommunications Industry",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Topic :: Communications :: Internet Phone",
"Topic :: Communications :: Telephony"
],
packages=find_packages(),
python_requires=">=3.6"
)

0 comments on commit 777109f

Please sign in to comment.