forked from tayler6000/pyVoIP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1265f9d
commit 777109f
Showing
4 changed files
with
59 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
pyVoIP.egg-info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) |