move MyCall class to correct location

This commit is contained in:
Thijs Raymakers 2025-05-28 23:54:56 +02:00
parent 3e79759cf0
commit 7a6d1dbbb6
No known key found for this signature in database

18
main.py
View file

@ -45,15 +45,6 @@ def call():
def onRegState(self, prm):
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
acc_cfg = pj.AccountConfig()
acc_cfg.idUri = f"sip:{sip_username}@{sip_server}"
@ -79,6 +70,15 @@ def call():
def call_phone(hostname, acc):
# 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}")
# Keep the program running for the duration of the ringtone