From 61771983672c778e8b416eddfd1f79da1c2fd5d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Jul 2020 23:15:04 +0900 Subject: [PATCH] Documentation fix --- .readthedocs.yml | 15 +++++++++++++++ README.md | 30 +++++++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .readthedocs.yml diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..f39e9d9 --- /dev/null +++ b/.readthedocs.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index e82b423..8d2143b 100644 --- a/README.md +++ b/README.md @@ -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(, , , , callCallback=answer, myIP=, sipPort=, rtpPortLow=, rtpPortHigh=) + phone.start() + input('Press enter to disable the phone') + phone.stop() +``` +