tayler6000 / pyVoIP

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

Home Page:https://pypi.org/project/pyVoIP/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Working code for pyvoip development branch

addyuchiha opened this issue · comments

can someone provide me a working code for development branch, I am using deveopment branch because when making a call with pyvoip via my voip provider I get OPTION error

code I am trying with pyvoip development branch

from pyVoIP.VoIP.phone import PhoneStatus, VoIPPhone
from pyVoIP.credentials import CredentialsManager

user = 'fo34xxxxx'
port = 5060
pas = 'f04xxxxxx'
servera = 'sip.pluxxx.de'

Credentials_manager = CredentialsManager
Credentials_manager.add(username=user,password=pas,server=servera)

if __name__ == "__main__":
    phone=VoIPPhone(server='sip.plusnet.de', port=5060, user='fo34xxxxxxx', credentials_manager=Credentials_manager)
    phone.start()
    while 1==1:
        i = input(">")
        if i=='a':
            print(phone.get_status())
        if i=='s':
            phone.stop
            break
        elif i=='d':
            x=input(">>")
            phone.call(x)

i am getting this error:

Traceback (most recent call last):
  File "/home/addy/Desktop/x/pyVoIP/x.py", line 10, in <module>
    Credentials_manager.add(username=user,password=pas,server=servera)
TypeError: CredentialsManager.add() missing 1 required positional argument: 'self'

This is answered in #199