Skip to content

Latest commit

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

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.

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.

frompyVoIP.VoIPimportVoIPPhone, InvalidStateErrordefanswer(call): #This will be your callback function for when you receive a phone call.try:
call.answer()
call.hangup()
exceptInvalidStateError:
passif__name__=='__main__':
phone=VoIPPhone(<SIPServerIP>, <SIPServerPort>, <SIPServerUsername>, <SIPServerPassword>, callCallback=answer, myIP=<Yourcomputer'slocalIP>, sipPort=<PorttouseforSIP (int, default5060)>, rtpPortLow=<lowendoftheRTPPortRange>, rtpPortHigh=<highendoftheRTPPortRange>)
phone.start()
input('Press enter to disable the phone')
phone.stop()

About

Pure python VoIP/SIP/RTP library. Currently supports PCMA, PCMU, and telephone-event

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages