# 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:
```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
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
- [Nabu Casa](https://www.nabucasa.com/)
- [Home Assistant](https://www.home-assistant.io/)
Raw data
{
"_id": null,
"home_page": "https://github.com/tayler6000/pyVoIP",
"name": "pyVoIP",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Tayler Porter",
"author_email": "taylerporter@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/18/91/6ac36b216260466dec88b93a6f0d617750b4626a223992337c5b53c5f093/pyVoIP-1.6.8.tar.gz",
"platform": null,
"description": "# pyVoIP\r\nPyVoIP is a pure python VoIP/SIP/RTP library. Currently, it supports PCMA, PCMU, and telephone-event.\r\n\r\nThis 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.\r\n\r\n## Getting Started\r\nSimply run `pip install pyVoIP`, or if installing from source:\r\n\r\n```bash\r\ngit clone https://github.com/tayler6000/pyVoIP.git\r\ncd pyVoIP\r\npip install .\r\n```\r\n\r\nDon't forget to check out [the documentation](https://pyvoip.readthedocs.io/)!\r\n\r\n### Basic Example\r\nThis basic code will simple make a phone that will automatically answer then hang up.\r\n\r\n```python\r\nfrom pyVoIP.VoIP import VoIPPhone, InvalidStateError\r\n\r\ndef answer(call): # This will be your callback function for when you receive a phone call.\r\n try:\r\n call.answer()\r\n call.hangup()\r\n except InvalidStateError:\r\n pass\r\n \r\nif __name__ == \"__main__\":\r\n 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>)\r\n phone.start()\r\n input('Press enter to disable the phone')\r\n phone.stop()\r\n```\r\n\r\n### Sponsors\r\n\r\n- [Nabu Casa](https://www.nabucasa.com/)\r\n- [Home Assistant](https://www.home-assistant.io/)\r\n",
"bugtrack_url": null,
"license": "",
"summary": "PyVoIP is a pure python VoIP/SIP/RTP library.",
"version": "1.6.8",
"project_urls": {
"Bug Tracker": "https://github.com/tayler6000/pyVoIP/issues",
"Documentaiton": "https://pyvoip.readthedocs.io/",
"Homepage": "https://github.com/tayler6000/pyVoIP"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6b0cc4ab3c8d5c9e392d5342f7268bc35c3b28ae28a8c4a4c2fdadb64d4fe561",
"md5": "1c006d75ff4ccc0a9d97d4075274120b",
"sha256": "ef9aa4518a888dc4523e76e36ac8cb2222b2131672eec8fe6f8d225caeed1faf"
},
"downloads": -1,
"filename": "pyVoIP-1.6.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1c006d75ff4ccc0a9d97d4075274120b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 40531,
"upload_time": "2024-01-17T07:21:45",
"upload_time_iso_8601": "2024-01-17T07:21:45.410836Z",
"url": "https://files.pythonhosted.org/packages/6b/0c/c4ab3c8d5c9e392d5342f7268bc35c3b28ae28a8c4a4c2fdadb64d4fe561/pyVoIP-1.6.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "18916ac36b216260466dec88b93a6f0d617750b4626a223992337c5b53c5f093",
"md5": "8ea900fbaaaf2eb7ec69cc869211913e",
"sha256": "faf878a369526205ce6a37357801fbb0247befadd4bc1b4fc63a677651c00588"
},
"downloads": -1,
"filename": "pyVoIP-1.6.8.tar.gz",
"has_sig": false,
"md5_digest": "8ea900fbaaaf2eb7ec69cc869211913e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 41122,
"upload_time": "2024-01-17T07:21:47",
"upload_time_iso_8601": "2024-01-17T07:21:47.299457Z",
"url": "https://files.pythonhosted.org/packages/18/91/6ac36b216260466dec88b93a6f0d617750b4626a223992337c5b53c5f093/pyVoIP-1.6.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-17 07:21:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tayler6000",
"github_project": "pyVoIP",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pyvoip"
}