summaryrefslogtreecommitdiffstats
path: root/Controller/Controller-SecondType.py
diff options
context:
space:
mode:
authortriatmoko2011-07-14 11:27:22 +0200
committertriatmoko2011-07-14 11:27:22 +0200
commit31d1f026a365d5d204519082369136ae54a7ac66 (patch)
tree1e931b3e62e80a2b11cedbfd4b14879aefeb4d31 /Controller/Controller-SecondType.py
parentlandlineCall is even better. Getting busy tone is challenging. Still working ... (diff)
downloadgsm-selftest-31d1f026a365d5d204519082369136ae54a7ac66.tar.gz
gsm-selftest-31d1f026a365d5d204519082369136ae54a7ac66.tar.xz
gsm-selftest-31d1f026a365d5d204519082369136ae54a7ac66.zip
University SIP handler
Diffstat (limited to 'Controller/Controller-SecondType.py')
-rw-r--r--Controller/Controller-SecondType.py44
1 files changed, 24 insertions, 20 deletions
diff --git a/Controller/Controller-SecondType.py b/Controller/Controller-SecondType.py
index a33ac30..b7d9881 100644
--- a/Controller/Controller-SecondType.py
+++ b/Controller/Controller-SecondType.py
@@ -18,9 +18,9 @@ passw = 'randompasswordSQL' #default password we agree with this password befo
host = 'localhost'
dbname = 'gsmselftesting'
-stop = "False"
-status = ""
-dbSStatus = ""
+stop = False
+status = None
+dbSStatus = None
sipNum = "4661929"
landlnNum = "076145875681"
@@ -30,7 +30,6 @@ sipCall = "sipCall.py"
sipRec = "sipReceiver.py"
landlnCall = "landlineCall.py"
landlnRec = "landlineReceiver.py"
-localSipCall = "localsipCall.py"
localSipRec = "localsipReceiver.py"
rz1Call = "rz1Call.py"
rz1Rec = "rz1Receiver.py
@@ -52,12 +51,9 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
global resultDest
global x
global y
- portOrig = None
- resultOrig= None
- resultDest = None
-
- repeatTest = ""
+
+ print "====================== Preparing Test ======================"
try:
@@ -68,8 +64,10 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
if dest =="gsmBox2":
portOrig = 50096
-
- print "GSM server handler", x.connect()
+
+ print ""
+ print "Connecting to Caller handler"
+ print "Caller handler status :", x.connect()
x.sendData('hello server please wakeup the handler and be caller')
else:
@@ -98,6 +96,7 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
x = classClient.Connection(origAdd,portOrig)
print ""
+ print "Connecting to Caller handler"
print "Caller handler status:", x.connect()
x.sendData('hello Handler')
@@ -110,12 +109,11 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
#think about time out
if origHandler == "ready":
- print "Caller handler ready"
+ print "Caller handler : Ready"
print ""
try:
y = None
global portDest
- portDest = None
if dest =="gsmBox1" or dest =="gsmBox2":
@@ -126,7 +124,8 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
portDest = 50103
y = classClient.Connection(destAdd,portDest)
- print "GSM handler", y.connect()
+ print "Connecting to Receiver handler"
+ print "Receiver handler status: ", y.connect()
y.sendData('hello server please wakeup the handler and be receiver')
else:
@@ -152,8 +151,9 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
#portDest = 50108
y = classClient.Connection(destAdd,portDest)
- print "Destination handler status:", y.connect()
- y.sendData('hello Receiver, caller number')
+ print "Connecting to Receiver handler"
+ print "Receiver handler status:", y.connect()
+ y.sendData('hello Receiver')
#wait respond from destination handler
while 1:
@@ -164,9 +164,9 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
if destHandler == "ready":
- print "Destination handler ready"
+ print "Receiver handler : Ready"
print ""
- x.sendData("start ")#send message to handler to start the call
+ x.sendData("start")#send message to handler to start the call
sleep(1)
x.sendData(destNo)
@@ -175,8 +175,10 @@ def FuncTest(orig, origAdd, dest, destAdd, destNo):
x.connect()
#wait respond from both of handler
+ print "------------ Test Result ------------"
+ print ""
while 1:
- sleep(5)
+ sleep(4)
x.connect()
sleep(0.5)
resultOrig = x.receiveData()
@@ -275,7 +277,9 @@ if dbStatus == 1:
callFrom = item[1]
callTo = item[2]
- print "call from to ", taskID , callFrom , callTo
+ print "Test ID : " , taskID
+ print "Caller : " , callFrom
+ print "Receiver : " , callTo
if callFrom == "sip":
if sipServerStatus == 0: