From 7a6d1dbbb6b130ddae2de42dadd26a2d648f8b1c Mon Sep 17 00:00:00 2001 From: Thijs Raymakers Date: Wed, 28 May 2025 23:54:56 +0200 Subject: [PATCH] move MyCall class to correct location --- main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 1ba850d..5c5ff6f 100644 --- a/main.py +++ b/main.py @@ -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