summaryrefslogtreecommitdiffstats
path: root/Controller/Controller.py
diff options
context:
space:
mode:
authorBebek2011-06-26 23:17:46 +0200
committerBebek2011-06-26 23:17:46 +0200
commitfcd6fa76830c5a6bdc9cb313a5b56822d9d17918 (patch)
treeb6b0f03e60c6aa226fcc52644843a918080fd8b1 /Controller/Controller.py
parentjust export to your mysql database. its will be store new database include al... (diff)
downloadgsm-selftest-fcd6fa76830c5a6bdc9cb313a5b56822d9d17918.tar.gz
gsm-selftest-fcd6fa76830c5a6bdc9cb313a5b56822d9d17918.tar.xz
gsm-selftest-fcd6fa76830c5a6bdc9cb313a5b56822d9d17918.zip
make function for SIP to GSM RZ, but still missing some script.
Diffstat (limited to 'Controller/Controller.py')
-rw-r--r--Controller/Controller.py77
1 files changed, 77 insertions, 0 deletions
diff --git a/Controller/Controller.py b/Controller/Controller.py
index d99a744..8e8f195 100644
--- a/Controller/Controller.py
+++ b/Controller/Controller.py
@@ -48,7 +48,82 @@ def FuncPing(ip):
# all Test case function
# Begin test case SIP to GSM RZ
+
+def FuncSip2GsmRz(idTask):
+ #first make test from sip to gsm1 rz
+ try:
+ # open SIP caller handler
+ command="--command=python SIPCall3.py"
+ subprocess.Popen(args=["gnome-terminal", command])
+
+ # wait respond from handler
+ if sipHandle == "ok":
+
+ try:
+ command="--command=python GSMCaller.py "+idTask +callerNumber # get test id and caller number
+ subprocess.Popen(args=["gnome-terminal", command])
+
+ #wait respond from gsm handler
+
+ if gsmHandler == "ok":
+ #send destination number to sip caller and signal to start the call
+ #wait respond from both of handler
+ #if failed, try one more time
+ #if still failed, save to db and update variable gsmRz2SIP == "1", so we make automatic test vice versa
+ # else: save to database, tell handler to terminated
+ else:
+ statusTest = "444, GSM Reciever handler no respond"
+ #tell handler to terminate
+ break
+
+ except ValueError:
+ print "444, Error to open Handler"
+ break
+
+ else:
+ statusTest = "444, SIP call handler no respond"
+ break
+
+ except ValueError:
+ print "444, Error to open Handler"
+
+ #seconde make test from sip to gsm2 rz
+ try:
+ # open SIP caller handler
+ command="--command=python SIPCall3.py"
+ subprocess.Popen(args=["gnome-terminal", command])
+
+ # wait respond from handler
+ if sipHandle == "ok":
+
+ try:
+ command="--command=python GSMCaller.py "+idTask +callerNumber # get test id and caller number
+ subprocess.Popen(args=["gnome-terminal", command])
+
+ #wait respond from gsm handler
+
+ if gsmHandler == "ok":
+ #send destination number to sip caller and signal to start the call
+ #wait respond from both of handler
+ #if failed, try one more time
+ #if still failed, save to db and update variable gsmRz2SIP == "1", so we make automatic test vice versa
+ # else: save to database, tell handler to terminated
+ else:
+ statusTest = "444, GSM Reciever handler no respond"
+ #tell handler to terminate
+ break
+
+ except ValueError:
+ print "444, Error to open Handler"
+ break
+
+ else:
+ statusTest = "444, SIP call handler no respond"
+ break
+
+ except ValueError:
+ print "444, Error to open Handler"
# Begin test case SIP to Local SIP
@@ -128,6 +203,8 @@ if dbStatus = "Database connection establish":
if sip2Gsmrz == "1" and sipServerStatus <> "No response":
#call Function for Sip to Gsm
+ FuncSip2GsmRz(idTask)
+
if sip2LocSip == "1" and sipServerStatus <> "No response" and sipLocalStatus <> "No response":
# call function for sip to local sip
if sip2LnLine == "1" and sipServerStatus <> "No response" and sipGateStatus <> "No response":