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
087ba69
commit 6177198
Showing
2 changed files
with
44 additions
and
1 deletion.
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,15 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
python: | ||
version: 3.7 |
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,2 +1,30 @@ | ||
# pyVoIP | ||
Pure python VoIP/SIP/RTP library. Currently supports PCMA, PCMU, and telephone-event | ||
PyVoIP is a pure python VoIP/SIP/RTP library. Currently, it supports PCMA, PCMU, and telephone-event. | ||
|
||
Please note this is a beta version and is currently only able to recieve calls, and transmit PCMU. In future it will be able to initiate calls in PCMA as well. | ||
|
||
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 only supports 8000Hz, 1 channel, 8 bit, audio.o. | ||
|
||
## Getting Started | ||
Simply put pyVoIP into your site-packages folder. | ||
|
||
### 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() | ||
``` | ||
|