move MyCall class to correct location
This commit is contained in:
parent
3e79759cf0
commit
7a6d1dbbb6
1 changed files with 9 additions and 9 deletions
18
main.py
18
main.py
|
|
@ -45,15 +45,6 @@ def call():
|
||||||
def onRegState(self, prm):
|
def onRegState(self, prm):
|
||||||
print("Registration state:", prm.code)
|
print("Registration state:", prm.code)
|
||||||
|
|
||||||
class MyCall(pj.Call):
|
|
||||||
def __init__(self, acc, dest_uri):
|
|
||||||
pj.Call.__init__(self, acc)
|
|
||||||
self.makeCall(dest_uri, pj.CallOpParam(True))
|
|
||||||
|
|
||||||
def onCallState(self, prm):
|
|
||||||
ci = self.getInfo()
|
|
||||||
print("Call state:", ci.stateText)
|
|
||||||
|
|
||||||
# Account config
|
# Account config
|
||||||
acc_cfg = pj.AccountConfig()
|
acc_cfg = pj.AccountConfig()
|
||||||
acc_cfg.idUri = f"sip:{sip_username}@{sip_server}"
|
acc_cfg.idUri = f"sip:{sip_username}@{sip_server}"
|
||||||
|
|
@ -79,6 +70,15 @@ def call():
|
||||||
|
|
||||||
def call_phone(hostname, acc):
|
def call_phone(hostname, acc):
|
||||||
# Make call
|
# Make call
|
||||||
|
class MyCall(pj.Call):
|
||||||
|
def __init__(self, acc, dest_uri):
|
||||||
|
pj.Call.__init__(self, acc)
|
||||||
|
self.makeCall(dest_uri, pj.CallOpParam(True))
|
||||||
|
|
||||||
|
def onCallState(self, prm):
|
||||||
|
ci = self.getInfo()
|
||||||
|
print("Call state:", ci.stateText)
|
||||||
|
|
||||||
call = MyCall(acc, f"sip:3002@{hostname}")
|
call = MyCall(acc, f"sip:3002@{hostname}")
|
||||||
|
|
||||||
# Keep the program running for the duration of the ringtone
|
# Keep the program running for the duration of the ringtone
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue