summaryrefslogtreecommitdiffstats
path: root/Handler
diff options
context:
space:
mode:
authoraa1112011-07-15 18:16:21 +0200
committeraa1112011-07-15 18:16:21 +0200
commiteac4331edfe02c5147b0dcd1f80775ee591eb83b (patch)
tree12823ff946cda11910b650f3b7b349ca718b9de8 /Handler
parentmoving files. (diff)
downloadgsm-selftest-eac4331edfe02c5147b0dcd1f80775ee591eb83b.tar.gz
gsm-selftest-eac4331edfe02c5147b0dcd1f80775ee591eb83b.tar.xz
gsm-selftest-eac4331edfe02c5147b0dcd1f80775ee591eb83b.zip
final code for landlineCall.py. adjusted to be compatible with communication between Controller.
Diffstat (limited to 'Handler')
-rw-r--r--Handler/landlineCall.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Handler/landlineCall.py b/Handler/landlineCall.py
index 332f226..9cec7e3 100644
--- a/Handler/landlineCall.py
+++ b/Handler/landlineCall.py
@@ -18,7 +18,6 @@ isStopped = False
firstTime502 = True
firstTime100 = True
TIMEOUT_LIMIT = 30
-userInput = ""
# Logging callback
def log_cb(level, str, len):
@@ -95,12 +94,7 @@ while not isStopped:
acc_cfg = pj.AccountConfig(server,username,password)
acc = lib.create_account(acc_cfg, cb=MyAccountCallback())
- while acc.info().reg_status == 100:
- if firstTime100:
- print "Trying to register."
- firstTime100 = False
-
-
+
if acc.info().reg_status == 502:
if firstTime502:
print "CONNECTION ERROR!!"
@@ -115,11 +109,19 @@ while not isStopped:
sleep(2)
continue
+
+ while acc.info().reg_status == 100:
+ if firstTime100:
+ print "Trying to register."
+ firstTime100 = False
+
+
while acc.info().reg_status == 408:
print "408: REGISTRATION FAILED DUE TO TIMEOUT!!"
print "Check your internet connection and SIP settings!"
# server.sendData('NOT ready')
+
if acc.info().reg_status == 200:
print ("REGISTRATION IS SUCCESSFUL") #server.sendData('ready')