summaryrefslogtreecommitdiffstats
path: root/For Weekly Test
diff options
context:
space:
mode:
authortt412011-08-02 19:32:37 +0200
committertt412011-08-02 19:32:37 +0200
commit64c0ea0d9f8b9898b0fac559418c83dd25b6b6db (patch)
tree7cea6c8a5736728298e50a43a255bbeda0d6e5ff /For Weekly Test
parentrename folder (diff)
parentMerge branch 'master' of lab.ks.uni-freiburg.de:lsfks/projekte/gsm-selftest (diff)
downloadgsm-selftest-64c0ea0d9f8b9898b0fac559418c83dd25b6b6db.tar.gz
gsm-selftest-64c0ea0d9f8b9898b0fac559418c83dd25b6b6db.tar.xz
gsm-selftest-64c0ea0d9f8b9898b0fac559418c83dd25b6b6db.zip
Merge branch 'master' of lab.ks.uni-freiburg.de:lsfks/projekte/gsm-selftest
Conflicts: For Weekly Test/19-08-2011/TrueTable2.py
Diffstat (limited to 'For Weekly Test')
-rw-r--r--For Weekly Test/19-08-2011/.DS_Storebin0 -> 6148 bytes
-rw-r--r--For Weekly Test/19-08-2011/ControllerClass.py28
-rw-r--r--For Weekly Test/19-08-2011/TrueTable.py3
-rw-r--r--For Weekly Test/19-08-2011/TrueTable2.py74
-rw-r--r--For Weekly Test/19-08-2011/gsmselftest1.py642
5 files changed, 707 insertions, 40 deletions
diff --git a/For Weekly Test/19-08-2011/.DS_Store b/For Weekly Test/19-08-2011/.DS_Store
new file mode 100644
index 0000000..5008ddf
--- /dev/null
+++ b/For Weekly Test/19-08-2011/.DS_Store
Binary files differ
diff --git a/For Weekly Test/19-08-2011/ControllerClass.py b/For Weekly Test/19-08-2011/ControllerClass.py
index 9c6b74e..015312b 100644
--- a/For Weekly Test/19-08-2011/ControllerClass.py
+++ b/For Weekly Test/19-08-2011/ControllerClass.py
@@ -116,33 +116,33 @@ class test:
logger.logEvent('init Caller')
logger.logEvent(self.callFrom)
- if self.callFrom =="gsmr1":
+ if self.callFrom =="GSMRZ1":
self.portCaller = 50007
self.portAdd = ''
self.initGSM(self.portCaller, self.portAdd)
- elif self.callFrom =="gsmr2":
+ elif self.callFrom =="GSMRZ2":
self.portCaller = 50008
- elif self.callFrom =="gsmr3":
+ elif self.callFrom =="GSMRZ3":
self.portCaller = 50009
- elif self.callFrom =="gsmeO":
+ elif self.callFrom =="GSMExt.O2":
self.portCaller = 50010
self.portAdd = '/dev/ttyUSB0'
self.initGSM(self.portCaller, self.portAdd)
- elif self.callFrom =="gsmeV":
+ elif self.callFrom =="GSMExt.Voda":
self.portCaller = 50011
self.portAdd = '/dev/ttyUSB1'
self.initGSM(self.portCaller, self.portAdd)
- elif self.callFrom =="gsmeT":
+ elif self.callFrom =="GSMExt.Tm":
self.portCaller = 50012
self.portAdd = ''
self.initGSM(self.portCaller, self.portAdd)
- elif self.callFrom =="gsmeE":
+ elif self.callFrom =="GSMExt.Eplus":
self.portCaller = 50013
self.portAdd = '/dev/ttyUSB2'
self.initGSM(self.portCaller, self.portAdd)
@@ -155,33 +155,33 @@ class test:
logger.logEvent('init Receiver')
logger.logEvent(self.dest)
- if self.dest =="gsmr1":
+ if self.dest =="GSMRZ1":
self.portDest = 50007
self.portAdd = ''
self.initGSM(self.portDest, self.portAdd)
- elif self.dest =="gsmr2":
+ elif self.dest =="GSMRZ2":
self.portDest = 50008
- elif self.dest =="gsmr3":
+ elif self.dest =="GSMRZ3":
self.portDest = 50009
- elif self.dest =="gsmeO":
+ elif self.dest =="GSMExt.O2":
self.portDest = 50010
self.portAdd = '/dev/ttyUSB0'
self.initGSM(self.portDest, self.portAdd)
- elif self.dest =="gsmeV":
+ elif self.dest =="GSMExt.Voda":
self.portDest = 50011
self.portAdd = '/dev/ttyUSB1'
self.initGSM(self.portDest, self.portAdd)
- elif self.dest =="gsmeT":
+ elif self.dest =="GSMExt.Tm":
self.portDest = 50012
self.portAdd = ''
self.initGSM(self.portDest, self.portAdd)
- elif self.dest =="gsmeE":
+ elif self.dest =="GSMExt.Eplus":
self.portDest = 50013
self.portAdd = '/dev/ttyUSB2'
self.initGSM(self.portDest, self.portAdd)
diff --git a/For Weekly Test/19-08-2011/TrueTable.py b/For Weekly Test/19-08-2011/TrueTable.py
index d47da64..6c32b78 100644
--- a/For Weekly Test/19-08-2011/TrueTable.py
+++ b/For Weekly Test/19-08-2011/TrueTable.py
@@ -8,7 +8,8 @@ resultsList = [['sip', 'GSMExt.O2', '486'],['sip', 'GSMExt.Voda', '486'],['sip',
callerList = ['sip']
def initTrueTable(caller):
-
+
+ callerList = ['sip']
for x in resultsList:
caller = x[0]
destination = x[1]
diff --git a/For Weekly Test/19-08-2011/TrueTable2.py b/For Weekly Test/19-08-2011/TrueTable2.py
index 48555c5..c5edf3d 100644
--- a/For Weekly Test/19-08-2011/TrueTable2.py
+++ b/For Weekly Test/19-08-2011/TrueTable2.py
@@ -1,6 +1,6 @@
# check signal on rz 1, 2, and 3 to indicated test
# only have option destination to GSM RZ, such as SIP to GSM RZ not SIP to GSM RZ 1, 2 or 3!
-
+# if the result is not 200 or 486, do one more test. because its means we have problem with handler. waiting 5 second and do the test.
#resultsList = list()
#resultsList = [['sip', 'GSMRZ1', '200'],['sip', 'GSMRZ2', '200'],['sip', 'GSMRZ3', '200']]
@@ -29,7 +29,7 @@ def initTest(callFrom,callTo):
initDB()
if dbStatus != 0:
-
+
dest = db.deviceAddress(str(callTo))
caller = db.deviceAddress(str(callFrom))
@@ -40,14 +40,18 @@ def initTest(callFrom,callTo):
recAdd = destination[0]
destNo = destination[1]
accDest = destination[2]+':'+destination[3]+':'+destination[4]+':'
-
+
makeTest = ControllerClass.test(caller, callAdd, accCaller, callTo, recAdd, destNo, accDest)
makeTest.FuncTest()
-
+
result = makeTest.testResult
+ else:
+ print "No connection to Database"
+
+ return result
def smartTest():
-
+
for callFrom in callerList:
for destination in destinationList:
@@ -65,25 +69,36 @@ def smartTest():
if result == '200':
print "all netwrok on GSMRZ are fine"
- else:
+ elif result == '486':
print "BTS 3 Down"
-
- else:
+ else:
+ print "have problem with handler"
+
+ elif result == '486':
print "make a call to GSMRZ3"
-
+ initTest('sip','GSMRZ3')
+
if result == '200':
print "BTS 2 Down"
- else:
+ elif result == '486':
print "BTS 2 and 3 indicate having problem"
+<<<<<<< HEAD
+=======
+ else:
+ print "have problem with handler"
+ else:
+ print "have problem with handler"
+
+>>>>>>> 24414ec73f840f3f9050b4724bdeae6fd9731870
elif result == '486':
print "make a call to GSMRZ2"
initTest('sip','GSMRZ2')
-
+
if result == '200':
print "make a call to GSMRZ3"
initTest('sip','GSMRZ3')
-
+
if result == '200':
print "BTS 1 Down"
else:
@@ -91,62 +106,71 @@ def smartTest():
else:
print "make a call to GSMRZ3"
-
+
if result == '200':
print "BTS 1 & 2 indicate having problem"
else:
print "OpenBSc Down"
+<<<<<<< HEAD
else:
print "Handler having problem, STOP the test. Please wait 10 Second and call the test again"
+=======
+ else:
+ print "have problem with handler"
+
+
+
+
+>>>>>>> 24414ec73f840f3f9050b4724bdeae6fd9731870
elif destination == 'GSMExt':
print "make a call to O2"
initTest('sip','GSMExt.O2')
-
+
if result == '200':
print "make a call to Voda"
initTest('sip','GSMExt.Voda')
-
+
if result == '200':
print "make a call to T-Mobile"
initTest('sip','GSMExt.Tm')
-
+
if result == '200':
print "All netwrok on GSM external are fine"
else:
print "T-Mobile card indicate having problem"
-
+
else:
print "make a call to T-Mobile"
initTest('sip','GSMExt.Tm')
-
+
if result == '200':
print "Vodaphone card indicate having problem"
else:
print "Vodaphone and T-Mobile card indicate having problem"
-
+
if result != '200':
print "make a call to Vodaphone"
initTest('sip','GSMExt.Voda')
-
+
if result == '200':
print "make a call to T-Mobile"
initTest('sip','GSMExt.Tm')
-
+
if result == '200':
print "O2 card indicate having problem"
else:
print "O2 and T-Mobile card indicate having problem"
-
+
else:
print "make a call to T-Mobile"
initTest('sip','GSMExt.Tm')
-
+
if result == '200':
print "O2 and Vodaphone card indicate having problem"
else:
print "GSM External Modem Down"
-
+
elif destination == 'SIP':
print "make a call to Landline"
initTest('sip','Landline')
@@ -159,7 +183,7 @@ def smartTest():
print "All SIP network is fine"
else:
print "UNISIP indicate having problem"
-
+
else:
print "making a call to UNISIP"
initTest('sip','unisip')
diff --git a/For Weekly Test/19-08-2011/gsmselftest1.py b/For Weekly Test/19-08-2011/gsmselftest1.py
new file mode 100644
index 0000000..d2b974b
--- /dev/null
+++ b/For Weekly Test/19-08-2011/gsmselftest1.py
@@ -0,0 +1,642 @@
+#! /usr/bin/env python
+import sys
+import ControllerClass
+import DbClass
+import PingClass
+from time import sleep
+
+def ping(handler):
+
+ global serverStatus
+
+ if handler == 'landline':
+ server = PingClass.Ping('sipgate.de')
+ serverStatus = server.ping(1)
+
+ elif handler == 'sip':
+ server = PingClass.Ping('132.230.4.8')
+ serverStatus = server.ping(1)
+
+ elif handler == 'unisip':
+ server = PingClass.Ping('132.230.252.228')
+ serverStatus = server.ping(1)
+
+ elif handler == 'GSMRZ1':
+ server = PingClass.Ping('localhost')
+ serverStatus = server.ping(1)
+
+ elif handler == 'GSMRZ2':
+ server = PingClass.Ping('132.230.4.64')
+ serverStatus = server.ping(1)
+ else:
+ serverStatus = 1
+
+def allPing():
+
+ global sipGate
+ global sipServer
+ global sipLoc
+ global gsmBox1
+ global gsmBox2
+
+ server = PingClass.Ping('sipgate.de')
+ sipGate = server.ping(3)
+
+ server = PingClass.Ping('132.230.4.8')
+ sipServer = server.ping(3)
+
+ server = PingClass.Ping('132.230.252.228')
+ sipLoc = server.ping(3)
+
+ server = PingClass.Ping('localhost')
+ gsmBox1 = server.ping(3)
+
+ server = PingClass.Ping('132.230.4.64')
+ gsmBox2 = server.ping(3)
+
+def initDB():
+ global dbStatus
+ global db
+
+ db = DbClass.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
+ db.connectDB()
+ dbStatus = db.connectDB()
+
+def initTest(callFrom,callTo):
+ global dest
+ global caller
+ global callAdd
+ global accCaller
+ global recAdd
+ global destNo
+ global accDest
+ global result
+ global repeatTest
+
+ initDB()
+
+ if dbStatus != 0:
+
+ dest = db.deviceAddress(str(callTo))
+
+ caller = db.deviceAddress(str(callFrom))
+
+ callAdd = caller[0]
+ accCaller = caller[2]+':'+caller[3]+':'+caller[4]+':'
+
+ recAdd = destination[0]
+ destNo = destination[1]
+ accDest = destination[2]+':'+destination[3]+':'+destination[4]+':'
+
+ makeTest = ControllerClass.test(caller, callAdd, accCaller, callTo, recAdd, destNo, accDest)
+ makeTest.FuncTest()
+
+ result = makeTest.testResult
+ repeatTest = makeTest.repeatTest
+
+ else:
+ print "No connection to Database"
+
+ return result
+
+def initTrueTable(caller):
+
+ for x in resultsList:
+ caller = x[0]
+ destination = x[1]
+ result = x[2]
+
+ if caller == x[0]:
+
+ if destination == 'GSMRZ1' and
+ if result =='486':
+
+ for y in resultsList:
+ destination = y[1]
+ result = y[2]
+
+ if caller == y[0]:
+ if destination == 'GSMRZ2':
+ if result == '200':
+
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMRZ3':
+
+ if result == '200':
+ print "BTS RZ 1 Broken"
+ elif == '486':
+ print "BTS RZ 1 & 3 indicate having Problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif destination == '486':
+
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMRZ3':
+
+ if result == '200':
+ print "BTS RZ 1 & 2 indicate having Problem"
+ elif result ='486':
+ print "OpenBSc Down"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif result =='200':
+
+ for y in resultsList:
+
+ destination = y[1]
+ result = y[2]
+
+ if caller == y[0]:
+ if destination == 'GSMRZ2':
+ if result == '200':
+
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMRZ3':
+
+ if result != '200':
+ print "BTS RZ 3 Broken"
+ else:
+ print "All is Fine"
+ elif result == '486':
+
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMRZ3':
+
+ if result == '200':
+ print "BTS RZ 2 Broken"
+ elif result == '486':
+ print "BTS RZ 2 & 3 indicate having Problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif destination == 'GSMExt.O2':
+ if result == '486':
+ for y in resultsList:
+
+ destination = y[1]
+ result = y[2]
+
+ if caller == y[0]:
+ if destination == 'GSMExt.Voda':
+ if result == '200':
+
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMExt.Tm':
+
+ if result != '200':
+ print "O2 & T-Mobile indicate having Problem"
+ else:
+ print "O2 indicate broken"
+
+ else:
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMExt.Tm':
+
+ if result == '200':
+ print "O2 and Vodaphone indicate having problem"
+ else:
+ print "GSM External Modem broken"
+ elif result == '200':
+ for y in resultsList:
+
+ destination = y[1]
+ result = y[2]
+
+ if caller == y[0]:
+ if destination == 'GSMExt.Voda':
+ if result == '200':
+
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMExt.Tm':
+
+ if result == '200':
+ print "GSM external modem is Fine"
+ elif result == '486':
+ print "T-Mobile indicate broken"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ elif result == '486':
+ for z in resultsList:
+
+ destination = z[1]
+ result = z[2]
+
+ if caller == z[0]:
+ if destination == 'GSMExt.Tm':
+
+ if result == '200':
+ print "Vodaphone indicate broken"
+ elif result == '486':
+ print "Vodaphone and T-Mobile indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+
+def doTest(callFrom,callTo):
+
+ global resultList
+ print '\n'
+ resultsList = list()
+
+ testRepeat = None
+ ping(callFrom)
+
+ if serverStatus <> 0 and dbStatus == 1:
+
+ ping(callTo)
+ if serverStatus <> 0:
+ initTest(callFrom,callTo)
+ resultList.append([callTo, callFrom, result])
+ db.errorCode(result)
+ print 'Result : ' +str(result)+ ' ' +db.errCode
+ sleep(5)
+ else:
+ print '[failed] 500 '+callTo+ ' Server Internal Error'
+ else:
+ print '[failed] 500 '+callFrom+ ' Server Internal Error'
+
+def doSipTest():
+
+ print '--SIP Part Test--'
+ #destList = ['sip', 'gsmr1','gsmr2', 'gsmr3', 'landline', 'unisip', 'gsmeO', 'gsmeV', 'gsmeT', 'gsmeE']
+ destList = ['landline']
+ for callTo in destList:
+
+ callFrom = 'sip'
+ if callFrom <> callTo:
+ doTest(callFrom, callTo)
+ if repeatTest == True:
+ doTest(callTo,callFrom)
+
+def doLandlineTest():
+
+ print '--Landline Part Test--'
+ destList = ['GSMRZ1','GSMRZ2', 'GSMRZ3', 'sip']
+
+ for callTo in destList:
+
+ callFrom = 'landline'
+ doTest(callFrom, callTo)
+ if repeatTest == True:
+ doTest(callTo,callFrom)
+
+def doGsmrzTest():
+
+ print '--GSM Part Test--'
+ destList = ['sip', 'GSMRZ1','GSMRZ2', 'GSMRZ3', 'landline', 'unisip', 'GSMExt.O2', 'GSMExt.Voda', 'GSMExt.Tm', 'GSMExt.Eplus']
+ callList = ['GSMRZ1','GSMRZ2', 'GSMRZ3']
+
+ for callFrom in callList:
+
+ for callTo in destList:
+ if callTo <> callFrom:
+ doTest(callFrom, callTo)
+ if repeatTest == True:
+ doTest(callTo,callFrom)
+
+ doGsmExtTest()
+
+def doGsmExtTest():
+
+ destList = ['sip', 'GSMRZ1','GSMRZ2', 'GSMRZ3']
+ callList = ['GSMExt.O2', 'GSMExt.Voda', 'GSMExt.Tm', 'GSMExt.Eplus']
+
+ for callFrom in callList:
+ for callTo in destList:
+
+ doTest(callFrom, callTo)
+ if repeatTest == True:
+ doTest(callTo,callFrom)
+
+def doAllTest():
+
+ doSipTest()
+ doLandlineTest()
+ doGsmTest()
+
+def smartTest():
+ callerList = ['sip']
+ for callFrom in callerList:
+ for destination in destinationList:
+
+ if destination == 'GSMRZ':
+ print "make a call to GSMRZ1"
+ initTest('sip','GSMRZ1')
+
+ if result == '200':
+ print "make a call to GSMRZ2"
+ initTest('sip','GSMRZ2')
+
+ if result == '200':
+ print "make a call to GSMRZ3"
+ initTest('sip','GSMRZ3')
+
+ if result == '200':
+ print "all netwrok on GSMRZ are fine"
+ elif result == '486':
+ print "BTS 3 Down"
+ else:
+ print "have problem with handler"
+
+ elif result == '486':
+ print "make a call to GSMRZ3"
+ initTest('sip','GSMRZ3')
+
+ if result == '200':
+ print "BTS 2 Down"
+ elif result == '486':
+ print "BTS 2 and 3 indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif result == '486':
+ print "make a call to GSMRZ2"
+ initTest('sip','GSMRZ2')
+
+ if result == '200':
+ print "make a call to GSMRZ3"
+ initTest('sip','GSMRZ3')
+
+ if result == '200':
+ print "BTS 1 Down"
+ elif result == '486':
+ print "BTS 1 & 3 indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif result == '486':
+ print "make a call to GSMRZ3"
+
+ if result == '200':
+ print "BTS 1 & 2 indicate having problem"
+ elif result == '486':
+ print "OpenBSc Down"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+
+
+
+ elif destination == 'GSMExt':
+ print "make a call to O2"
+ initTest('sip','GSMExt.O2')
+
+ if result == '200':
+ print "make a call to Voda"
+ initTest('sip','GSMExt.Voda')
+
+ if result == '200':
+ print "make a call to T-Mobile"
+ initTest('sip','GSMExt.Tm')
+
+ if result == '200':
+ print "All netwrok on GSM external are fine"
+ elif result == '486':
+ print "T-Mobile card indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif result == '486':
+ print "make a call to T-Mobile"
+ initTest('sip','GSMExt.Tm')
+
+ if result == '200':
+ print "Vodaphone card indicate having problem"
+ elif result == '486':
+ print "Vodaphone and T-Mobile card indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ if result == '486':
+ print "make a call to Vodaphone"
+ initTest('sip','GSMExt.Voda')
+
+ if result == '200':
+ print "make a call to T-Mobile"
+ initTest('sip','GSMExt.Tm')
+
+ if result == '200':
+ print "O2 card indicate having problem"
+ elif result == '486':
+ print "O2 and T-Mobile card indicate having problem"
+
+ elif result == '486':
+ print "make a call to T-Mobile"
+ initTest('sip','GSMExt.Tm')
+
+ if result == '200':
+ print "O2 and Vodaphone card indicate having problem"
+ elif result == '486':
+ print "GSM External Modem Down"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif destination == 'SIP':
+ print "make a call to Landline"
+ initTest('sip','landline')
+
+ if result == '200':
+ print "make a call to UNISIP"
+ initTest('sip','unisip')
+
+ if result =='200':
+ print "All SIP network is fine"
+ elif result == '486':
+ print "UNISIP indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif result == '486':
+ print "making a call to UNISIP"
+ initTest('sip','unisip')
+
+ if result == '200':
+ print "Landline indicate having problem"
+ elif result == '486':
+ print "SIP Network Down"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+if len(sys.argv) > 1:
+
+ command = sys.argv[1]
+ print '\n'
+
+ if command == '--all':
+ doAllTest()
+
+ elif command == '--sip':
+ doSipTest()
+
+ elif command == '--gsm':
+ doGsmTest()
+
+ elif command == '--landline':
+ doLandlineTest()
+
+ elif command == '-- smart':
+ smartTest()
+
+ elif command == '--help':
+ file = open('help.txt', 'r')
+ print file.read()
+
+ else:
+ print "command not found, Type '--help', '--credits' for more information."
+ print '\n'
+else:
+ global resultList
+ print '\n'
+ resultsList = list()
+
+ if dbStatus == 1:
+
+ if db.anyTasksToDo() == 1:
+
+ #allPing()
+ i=0
+ for item in db.tasksList:
+ print item
+ taskID = item[0]
+ taskNo = item[1]
+ callFrom = item[2]
+ callTo = item[3]
+ tried = item[4]
+
+
+ #if i == 0:
+ # db.updatePingResult(taskNo, sipServer, sipGate, sipLoc, gsmBox1, gsmBox2)
+ print '\n'
+ print 'Task ID :', taskID
+ print 'Calling From :', callFrom
+ print 'To :', callTo
+ print 'number :', destNo
+ print 'status :', tried
+
+ ping(callFrom)
+
+ if serverStatus <> 0:
+
+ ping(callTo)
+ if serverStatus <> 0:
+
+ initTest(callFrom,callTo)
+
+ db.addResult(taskID, result)
+ resultList.append([callTo, callFrom, result])
+
+ if repeatTest == True and tried <> '1':
+ db.insertTaskIn2(callTo,callFrom,taskNo, '1')
+
+ db.errorCode(result)
+ print 'Result : ' +str(result)+ ' ' +db.errCode
+
+ db.deleteTempTask(taskID)
+ db.tasksList.remove(item)
+ db.tasksList.insert(i,'')
+
+ i = i+1
+
+ sleep(5)
+
+ else:
+ db.addResult(taskID, '500')
+ print '[failed] 500 '+callTo+ ' Server Internal Error'
+ else:
+ db.addResult(taskID, '500')
+ print '[failed] 500 '+callFrom+' Server Internal Error'
+ db.cleanTasksList()
+
+ # fetch result list and make adjustment about the result
+ callerList = ['sip']
+ for caller in callerList:
+ initTrueTable(caller)
+ else:
+ print "No job at all"
+ else:
+ sys.exit(1)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+