From b242587871366d057ed8aa65356be7116dbb71e2 Mon Sep 17 00:00:00 2001 From: Triatmoko Date: Tue, 1 Nov 2011 14:58:20 +0100 Subject: all ping added --- For Weekly Test/ControllerClass.py | 267 ---------- For Weekly Test/kill.py | 21 - For Weekly Test/testingfile.py | 6 - For Weekly Test/tricode/DbClass.py | 48 ++ For Weekly Test/tricode/css/tableCSS.css | 2 +- For Weekly Test/tricode/gsmselftest-website3.py | 13 +- For Weekly Test/tricode/mutexSmartTest.php | 6 +- For Weekly Test/tricode/mutexTry.php | 619 ++++++++++++++++++++++-- 8 files changed, 649 insertions(+), 333 deletions(-) delete mode 100755 For Weekly Test/ControllerClass.py delete mode 100644 For Weekly Test/kill.py delete mode 100644 For Weekly Test/testingfile.py diff --git a/For Weekly Test/ControllerClass.py b/For Weekly Test/ControllerClass.py deleted file mode 100755 index 85f29ad..0000000 --- a/For Weekly Test/ControllerClass.py +++ /dev/null @@ -1,267 +0,0 @@ -import sys -import os -import subprocess -import SSHTunnelBoxClass -import ClientClass -import random - -import LogFileClass -logger = LogFileClass.Logging('TestProcessLog.log') - -from time import sleep - - -class doTheTest: - - def __init__(self, callFrom, callPortName, accCaller, callTo, destPortName, destNo, accDest): - - self.callFrom = callFrom - self.dest = callTo - self.destNo = destNo - self.accDest = accDest - self.accCaller = accCaller - self.callPortName = callPortName - self.destPortName = destPortName - self.portCaller = None - self.portDest = None - self.resultCaller = None - self.resultDest = None - self.testResult = None - - def FuncTest(self): - - logger.logEvent('') - - self.initCaller() - - if self.callFrom =="GSMRZ3" or self.callFrom =="GSMRZ2": # wait until ssh connection establish - sleep(6) - else: - sleep(2) - self.callerGreeting() - - if self.connected == 'OK': - - self.caller.sendData('CALLER|'+self.destNo) - callerHandler = self.caller.receiveData(20) - - if callerHandler == "CALLER READY": - logger.logEvent('Caller handler : Ready') - self.initReceiver() - if self.dest =="GSMRZ3" or self.dest =="GSMRZ2": # wait until ssh connection establish - sleep(6) - else: - sleep(2) - self.receiverGreeting() - - if self.connected == 'OK': - - self.receiver.sendData('RECEIVER') - destHandler = self.receiver.receiveData(20) - - if destHandler == 'RECEIVER READY': - logger.logEvent('Receiver handler : Ready') - self.startCall() - self.waitingFeedback() - - elif destHandler == 'DEVICE NOT WORK': - self.testResult == 802 - logger.logEvent('802 General Device Error: Destination device no respond timeout') - self.initTerminate() - else: - self.testResult = 604 - logger.logEvent('604 General Handler Error: Destination handler no respond timeout') - self.initTerminate() - - elif self.connected == 'DEVICE NOT WORK': - self.testResult == 802 - logger.logEvent('802 General Device Error: Destination device no respond timeout') - self.initTerminate() - else: - logger.logEvent('998 General Handler Error: Could not connect Destination handler') - self.testResult = 998 - self.caller.sendData('TERMINATE CONNECTION') - self.caller.closeConnection() - self.initCancelTest() - else: - self.testResult = 605 - logger.logEvent('605 General Handler Error: caller handler no respond timeout') - - self.caller.sendData('TERMINATE CONNECTION') - self.caller.closeConnection() - self.initCancelTest() - - elif self.connected == 'DEVICE NOT WORK': - self.testResult = 801 - self.caller.sendData('TERMINATE CONNECTION') - self.caller.closeConnection() - logger.logEvent('802 General Device Error: Caller device no respond timeout') - self.initCancelTest() - else: - self.testResult = 999 - logger.logEvent('999 General Handler Error: Could not connect to Caller handler') - - - def initCancelTest(self): - #close SSH connection when using gsmBox and destination doesnt respond. to make sure SSH connection are terminate - if self.callFrom[0:5] == 'GSMRZ': - if self.callFrom != 'GSMRZ1': - # close SSH tunneling - self.boxCaller.killTunneling() - - # waiting results state - def waitingFeedback(self): - logger.logEvent('Waiting Feedback') - self.resultDest = self.receiver.receiveData(20) - self.resultCaller = self.caller.receiveData(20) - #print 'result '+self.resultCaller+'--'+self.resultDest - if self.resultCaller == 'DEVICE NOT WORK': - logger.logEvent('Caller device not work') - self.testResult = 801 - self.initTerminate() - - elif self.resultCaller == 'CALL OK' and self.resultDest =='CALL OK': - logger.logEvent('Test Succeed') - self.testResult = 200 - self.initTerminate() - else: - if self.dest == 'GSMExt.Eplus': - if self.resultCaller == 'CALL OK' and self.resultDest == 'TIME OUT': - logger.logEvent('Test Failed - Eplus No credit on Eplus') - self.testResult = 402 - self.initTerminate() - else: - logger.logEvent('Test Failed') - self.testResult = 486 - self.initTerminate() - - else: - if self.resultCaller <> 'CALL OK' or self.resultDest <> 'CALL OK': - logger.logEvent('Test Failed') - self.testResult = 486 - self.initTerminate() - - #send start call message to caller - def startCall(self): - logger.logEvent('Start Call') - self.receiver.sendData('RECEIVE START') - self.caller.sendData('CALL START') - - def initAccount(self, account): - - accConf = account - self.username = accConf[0:accConf.find(':')] - - line = accConf[accConf.find(':')+1:] - self.password = line[0:line.find(':')] - - newLine = line[line.find(':')+1:] - self.server = newLine[0:newLine.find(':')] - - # define the caller configuration such as port name and port caller. - def initCaller(self): - logger.logEvent('init Caller') - logger.logEvent(self.callFrom) - self.portCaller = random.randint(30000,60000) - - if self.callFrom[0:4] == 'GSMR': - if self.callFrom =="GSMRZ1": - self.initGSM(self.portCaller, self.callPortName, self.callFrom) - else: - self.initAccount(self.accCaller) - #open SSH tunneling - self.boxCaller = SSHTunnelBoxClass.SSHTunneling(self.portCaller, 50008, self.server, self.username, self.password) - self.boxCaller.startTunneling() - - - elif self.callFrom[0:4] == 'GSME': - self.initGSM(self.portCaller, self.callPortName, self.callFrom) - - else: - subprocess.Popen(args=["gnome-terminal", '--command=python SIPHandler.py '+self.accCaller+ ' ' +str(self.portCaller)]) - - # define the destination configuration such as port name and port caller. - def initReceiver(self): - logger.logEvent('init Receiver') - logger.logEvent(self.dest) - self.portDest = random.randint(30000,60000) - - if self.dest[0:4] == 'GSMR': - if self.dest =="GSMRZ1": - self.initGSM(self.portDest, self.destPortName, self.dest) - else: - self.initAccount(self.accDest) - #open SSH tunneling - self.boxDest = SSHTunnelBoxClass.SSHTunneling(self.portDest, 50008, self.server, self.username, self.password) - self.boxDest.startTunneling() - - elif self.dest[0:4] == 'GSME': - self.initGSM(self.portDest, self.destPortName, self.dest) - - else: - self.portDest = 50100 - subprocess.Popen(args=['gnome-terminal', '--command=python SIPHandler.py '+self.accDest+ ' ' +str(self.portDest)]) - - # send terminate message to Handlers - def initTerminate(self): - self.caller.sendData('TERMINATE CONNECTION') - self.receiver.sendData('TERMINATE CONNECTION') - if self.callFrom[0:5] == 'GSMRZ': - if self.callFrom != 'GSMRZ1': - # close SSH tunneling - self.boxCaller.killTunneling() - if self.dest[0:5] == 'GSMRZ': - if self.dest != 'GSMRZ1': - # close SSH tunneling - self.boxDest.killTunneling() - self.receiver.closeConnection() - self.caller.closeConnection() - - def callerGreeting(self): # send greeting message to the caller handler - self.connected = None - #open connection to the Handler - self.caller = ClientClass.Connection('localhost',self.portCaller) - self.caller.connect() - - if self.caller.connected == 1: - logger.logEvent('Connected to Caller Handler') - self.caller.sendData('HELLO HANDLER') - message = self.caller.receiveData(20) - if message == 'HELLO CONTROLLER': - logger.logEvent('Caller Handler respond') - self.connected = 'OK' - else: - logger.logEvent('Connect to Caller but device doesnt work') - self.connected = 'DEVICE NOT WORK' - else: - logger.logEvent('Cannt connect to Caller') - self.connected = 'NOT OK' - - def receiverGreeting(self): # send greeting message to the destination handler - self.connected = None - #open connection to the Handler - self.receiver = ClientClass.Connection('localhost', self.portDest) - self.receiver.connect() - - if self.receiver.connected == 1: - logger.logEvent('Connected to Receiver Handler') - self.receiver.sendData('HELLO HANDLER') - message = self.receiver.receiveData(20) - if message == 'HELLO CONTROLLER': - logger.logEvent('Receiver Handler respond') - self.connected = 'OK' - - else: - logger.logEvent('connect to Receiver but device doesnt work') - self.connected = 'DEVICE NOT WORK' - else: - logger.logEvent('Cannt connect to Receiver') - self.connected = 'NOT OK' - - def initGSM(self, portCommunication, portDevice, handler): - #open GSM Handler - subprocess.Popen(args=["gnome-terminal", '--command=python GSMHandler.py '+str(portCommunication)+ ' ' +str(portDevice)+' '+str(handler)]) - - - - diff --git a/For Weekly Test/kill.py b/For Weekly Test/kill.py deleted file mode 100644 index e41f802..0000000 --- a/For Weekly Test/kill.py +++ /dev/null @@ -1,21 +0,0 @@ -import subprocess, signal -import os - -#kill process to make sure, that the handler is Terminate incase handler having problem receiving -# terminate message from controller - -def killProc(): - # define process name of the Handler - procName1 = 'foo' - #procName = 'SIP Handler' - p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE) - out, err = p.communicate() - - #search process name and kill it. - for line in out.splitlines(): - if procName1 in line: - pid = int(line.split(None, 1)[0]) - os.kill(pid, signal.SIGKILL) - - -killProc() diff --git a/For Weekly Test/testingfile.py b/For Weekly Test/testingfile.py deleted file mode 100644 index 3975ac9..0000000 --- a/For Weekly Test/testingfile.py +++ /dev/null @@ -1,6 +0,0 @@ -import setproctitle -setproctitle.setproctitle("foo") -print setproctitle.getproctitle() - -while True: - i = 1+1 diff --git a/For Weekly Test/tricode/DbClass.py b/For Weekly Test/tricode/DbClass.py index 027bc95..99c1e7c 100755 --- a/For Weekly Test/tricode/DbClass.py +++ b/For Weekly Test/tricode/DbClass.py @@ -298,6 +298,54 @@ class DBMySQLConnection: return 3 else: return 0 + def maxTaskNo(self): + if self.connectionCreated == 1: + try: + self.cur.execute("SELECT MAX(taskNo) FROM TaskTable") + self.taskNo = self.cur.fetchone() + if self.taskNo == None or self.taskNo == '0' or self.taskNo == '' or self.taskNo == 0: + self.taskNo = 1 + else: + self.taskNo = self.taskNo +1 + return self.taskNo + + except MySQLdb.Error, e: + error = str(e) + message = 'error' + if debugMode == 1: + print str(e) + if error[1:5] == '1062': + return message #duplicate entry for the key + + return message + else: + return 0 + + def insertTask(self, fromDevice, toDevice): + if self.connectionCreated == 1: + try: + + self.maxTaskNo() + #I used here a transaction since I want the mysql to execute a few commands and tell me was it successful rather than to execute some and there happens a mistake and one part is updated and the other isn't + newQuery = "START TRANSACTION; INSERT INTO `TaskTable` (`taskNo`, `from`, `to`) VALUES ('" + str(self.taskNo) + "', '" + str(fromDevice) + "', '" + str(toDevice) +"'); SELECT @taskID := LAST_INSERT_ID(); INSERT INTO `TempTaskTable` (`taskID`, `taskNo`, `from`, `to`) VALUES (@taskID, '" + str(taskNo) + "', '" + str(fromDevice) + "', '"+ str(toDevice) + "'); COMMIT;" + + successful = self.cur.execute(newQuery) + output = self.cur.fetchone() + + return 1 + + if debugMode == 1: + print output + + except MySQLdb.Error, e: + error = str(e) + if debugMode == 1: + print str(e) + if error[1:5] == '1062': + return 2 #duplicate entry for the key + return 3 + else: + return 0 def releaseMutex(self): if self.connectionCreated == 1: diff --git a/For Weekly Test/tricode/css/tableCSS.css b/For Weekly Test/tricode/css/tableCSS.css index 2a7f54d..58e7716 100644 --- a/For Weekly Test/tricode/css/tableCSS.css +++ b/For Weekly Test/tricode/css/tableCSS.css @@ -20,7 +20,7 @@ URL: http://www.alvit.de/vf #footer { position: absolute; - bottom: 1px; + bottom: 0; padding-top: 0px; padding-right: 220px; padding-left: 350px; diff --git a/For Weekly Test/tricode/gsmselftest-website3.py b/For Weekly Test/tricode/gsmselftest-website3.py index 1ba7767..a80cb6d 100644 --- a/For Weekly Test/tricode/gsmselftest-website3.py +++ b/For Weekly Test/tricode/gsmselftest-website3.py @@ -46,23 +46,23 @@ def allPing(): #ping all existing devices serverAdd = db.deviceAddress(str('landline')) server = PingClass.Ping(str(serverAdd[4])) - sipGate = server.ping(2) + sipGate = server.ping(1) serverAdd = db.deviceAddress(str('sip')) server = PingClass.Ping(str(serverAdd[4])) - sipServer = server.ping(2) + sipServer = server.ping(1) serverAdd = db.deviceAddress(str('unisip')) server = PingClass.Ping(str(serverAdd[4])) - unisip = server.ping(2) + unisip = server.ping(1) serverAdd = db.deviceAddress(str('GSMRZ2')) server = PingClass.Ping(str(serverAdd[4])) - gsmBox1 = server.ping(2) + gsmBox1 = server.ping(1) serverAdd = db.deviceAddress(str('GSMRZ3')) server = PingClass.Ping(str(serverAdd[4])) - gsmBox2 = server.ping(2) + gsmBox2 = server.ping(1) def initDB(): # function for connection database global dbStatus @@ -683,6 +683,9 @@ else: withDB(True) if test == 'SMART TEST': + allPing() + taskNo = db.maxTaskNo() + db.updatePingResult(taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2) server.sendData('CONFIRM\n') print 'SMART TEST STARTED' resultsList = list() diff --git a/For Weekly Test/tricode/mutexSmartTest.php b/For Weekly Test/tricode/mutexSmartTest.php index db018ae..5df26e6 100644 --- a/For Weekly Test/tricode/mutexSmartTest.php +++ b/For Weekly Test/tricode/mutexSmartTest.php @@ -1,3 +1,5 @@ + + @@ -136,7 +138,7 @@ if ($locking == '1') //1 means nobody is on the website echo ''; echo '"; - echo ''; + echo ''; echo str_repeat("\n",7024); flush(); usleep(100); @@ -299,8 +301,6 @@ if ($locking == '1') //1 means nobody is on the website } } } - echo $callFrom; - echo $testStatus; if($callFrom == 'GSMRZ3' || $callTo == 'GSMRZ3') { if($testStatus == '200' || $testStatus == '402') diff --git a/For Weekly Test/tricode/mutexTry.php b/For Weekly Test/tricode/mutexTry.php index c206c8d..be3a123 100755 --- a/For Weekly Test/tricode/mutexTry.php +++ b/For Weekly Test/tricode/mutexTry.php @@ -37,13 +37,15 @@ if ($locking == '1') //1 means nobody is on the website $lockMe = Lock($nameOfLock,$timeToKeepTheMutex); //Set a mutex for the webpage if ($lockMe == '1') //1 means a successful lock { + include 'post.php'; // read posted data and add them to the database // echo 'WE had errors: '. $errorAdding; //stuff to do here //check if the software is running! $softwareLock = 'SoftwareStarted'; - $taskAmount= 1 - if($taskAmount!=0) + + //$taskAmount= 1 + if($taskAmount != 0) { $softwareRunning = isLocked($softwareLock); if($softwareRunning == '1') //1 means software is not started yet, start it @@ -79,8 +81,10 @@ if ($locking == '1') //1 means nobody is on the website else { socket_set_timeout($fp,50); //one should set the number of the longest test, so we can define the timeout function (it is the number after "$fp,") - - fwrite($fp, "SMART TEST"); //send command to start the tests + + fwrite($fp, "START TEST"); + + //fwrite($fp, "SMART TEST"); //send command to start the tests if(!feof($fp)) { while(!feof($fp)) @@ -89,7 +93,8 @@ if ($locking == '1') //1 means nobody is on the website if ($received == "CONFIRM\n") //we got the confirmation from the testing software { - //test finished successfully + //test finished successfully + $GSMRZ1 = 0; $GSMRZ2 = 0; $GSMRZ3 = 0; @@ -104,11 +109,11 @@ if ($locking == '1') //1 means nobody is on the website $GSMET = 0; $GSMEO = 0; - $SIPP = 0; - $LANDLINEP = 0; - $UNISIPP = 0; - $NANOBTS1P = 0; - $NANOBTS2P = 0; + $SIPP = 2; + $LANDLINEP = 2; + $UNISIPP = 2; + $NANOBTS1P = 2; + $NANOBTS2P = 2; /////////// end of test! echo '
@@ -127,12 +132,13 @@ if ($locking == '1') //1 means nobody is on the website } elseif ($received == "TEST DONE\n") { + echo '
'; echo '
'; echo '"; - echo ''; + echo "Picture 3"; + echo ''; echo str_repeat("\n",7024); flush(); usleep(100); @@ -149,48 +155,601 @@ if ($locking == '1') //1 means nobody is on the website $testStatus = strtoupper($dataForTable[3]); //ADD HERE THE TEST CASES BUT MAKE IT INSIDE OF A FILE (e.q. include 'testing.php'); HERE I PUT IT ONLY FOR EXAMPLE PURPOSES! - if($callFrom == 'SIP' || $callTo == 'SIP') + if($callFrom == 'SIP' || $callTo == 'SIP') { - if($testStatus == '200') - { + if($testStatus == '200' || $testStatus == '402') + { $SIP = 1; + $SIPP = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + //Check that SIP already working or not, if working, leave as it is, otherwise update that sip broken. same with LSFKS + if ($SIP != 1) + { + $SIP = 1; + } + $SIPP = 1; + if ($LSFKS != 1) + { + $LSFKS = -1; + } } + if ($callFrom == 'SIP') + { + if ($testStatus == '998' || $testStatus == '802') + { + $SIP = 1; + $SIPP = 1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + + } + elseif($testStatus == '999') + { + if ($SIP != 1) + { + $SIP = -1; + } + $SIPP = -1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'SIP') + { + if ($testStatus == '999') + { + if ($SIP != 1) + { + $SIP = 0; + } + if ($SIPP != 1) + { + $SIPP = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998') + { + if ($SIP != 1) + { + $SIP = -1; + } + $SIPP = -1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } } + if($callFrom == 'GSMRZ1' || $callTo == 'GSMRZ1') { - if($testStatus == '200') + if($testStatus == '200' || $testStatus == '402') { $GSMRZ1 = 1; } + elseif($testStatus == '486') + { + if ($GSMRZ1 != 1) + { + $GSMRZ1 = -1; + } + } + if ($callFrom == 'GSMRZ1') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMRZ1 != 1) + { + $GSMRZ1 = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + $GSMRZ1 = 1; //where is nanoBTS1 + } + } + elseif ($callTo == 'GSMRZ1') + { + if ($testStatus == '998' || $testStatus == '802') + { + if ($GSMRZ1 != 1) + { + $GSMRZ1 = 0; + } + } + elseif($testStatus == '999' || $testStatus == '801') + { + $GSMRZ1 = 1; //where is nanoBTS1 + } + } } - if($callFrom == 'NANOBTS2') - { - if($testStatus == 'TRUE') + + if($callFrom == 'GSMRZ2' || $callTo == 'GSMRZ2') + { + if($testStatus == '200' || $testStatus == '402') { $GSMRZ2 = 1; $NANOBTS1P = 1; } + elseif($testStatus == '486') + { + $GSMRZ2 = -1; + $NANOBTS1P = 1; + } + else + { + if ($GSMRZ2 != 1) + { + $GSMRZ2 = 0; + } + if ($NANOBTS1P != 1) + { + $NANOBTS1P = 0; + } + } } - if($callFrom == 'NANOBTS3') - { - if($testStatus == 'TRUE') + if($callFrom == 'GSMRZ3' || $callTo == 'GSMRZ3') + { + if($testStatus == '200' || $testStatus == '402') { $GSMRZ3 = 1; $NANOBTS2P = 1; } + elseif($testStatus == '486') + { + $GSMRZ3 = -1; + $NANOBTS2P = 1; + } + else + { + if ($GSMRZ3 != 1) + { + $GSMRZ3 = 0; + } + if ($NANOBTS2P != 1) + { + $NANOBTS2P = 0; + } + } + } - if($callFrom == 'OPENBSC') - { - if($testStatus == 'TRUE') + if($callFrom == 'GSMEXT.O2' || $callTo == 'GSMEXT.O2') + { + if($testStatus == '200' || $testStatus == '402') { - echo 'open BSC working' + $GSMEO = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMEO != 1) + { + $GSMEO = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.O2') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMEO != 1) + { + $GSMEO = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMEO != 1) + { + $GSMEO =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.O2') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMEO != 1) + { + $GSMEO = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMEO != 1) + { + $GSMEO =0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } } } - if($callFrom == 'ASTERISKSERVER') - { - if($testStatus == 'TRUE') + if($callFrom == 'GSMEXT.VODA' || $callTo == 'GSMEXT.VODA') + { + if($testStatus == '200' || $testStatus == '402') { - $SIPP = 1; + $GSMEV = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMEV != 1) + { + $GSMEV = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.VODA') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMEV != 1) + { + $GSMEV = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMEV != 1) + { + $GSMEV =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.VODA') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMEV != 1) + { + $GSMEV = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMEV != 1) + { + $GSMEV =0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + } + + if($callFrom == 'GSMEXT.EPLUS' || $callTo == 'GSMEXT.EPLUS') + { + if($testStatus == '200') + { + $GSMEE = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMEE != 1) + { + $GSMEE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.EPLUS') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMEE != 1) + { + $GSMEE = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMEE != 1) + { + $GSMEE =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.EPLUS') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMEE != 1) + { + $GSMEE = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMEE != 1) + { + $GSMEE=0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '402') + { + if ($GSMEE != 1) + { + $GSMEE=0; + } + $LSFKS = 1; + } + } + } + + if($callFrom == 'GSMEXT.TM' || $callTo == 'GSMEXT.TM') + { + if($testStatus == '200' || $testStatus == '402') + { + $GSMET = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($GSMET != 1) + { + $GSMET = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + } + if ($callFrom == 'GSMEXT.TM') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMET != 1) + { + $GSMET = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMET != 1) + { + $GSMET =1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + elseif ($callTo == 'GSMEXT.TM') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($GSMET != 1) + { + $GSMET = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + if ($GSMET != 1) + { + $GSMET =0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + } + } + + } + + if($callFrom == 'LANDLINE' || $callTo == 'LANDLINE') + { + + if($testStatus == '200' || $testStatus == '402') + { + + $LANDLINEP = 1; + $LANDLINE = 1; + $LSFKS = 1; + } + elseif($testStatus == '486') + { + if ($LANDLINE != 1) + { + $LANDLINE = -1; + } + } + if ($callFrom == 'LANDLINE') + { + if ($testStatus == '999') + { + if ($LANDLINE != 1) + { + $LANDLINE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = -1; + } + if ($LANDLINEP != 1) + { + $LANDLINEP = -1; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + $LANDLINE = 1; + if ($LSFKS != 1) + { + $LSFKS = 0; + } + $LANDLINEP = 1; + } + } + elseif ($callTo == 'LANDLINE') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($LANDLINE != 1) + { + $LANDLINE = 0; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + if ($LANDLINEP != 1) + { + $LANDLINEP = 0; + } + } + elseif($testStatus == '998') + { + if ($LANDLINE != 1) + { + $LANDLINE = -1; + } + if ($LSFKS != 1) + { + $LSFKS = 0; + } + if ($LANDLINEP != 1) + { + $LANDLINEP = -1; + } + } + } + } + if($callFrom == 'UNISIP' || $callTo == 'UNISIP') + { + + if($testStatus == '200' || $testStatus == '402') + { + $UNISIPP = 1; + $UNISIP = 1; + } + elseif($testStatus == '486') + { + if ($UNISIP != 1) + { + $UNISIP = -1; + } + } + if ($callFrom == 'UNISIP') + { + if ($testStatus == '999' || $testStatus == '801') + { + if ($UNISIP != 1) + { + $UNISIP = -1; + } + if ($UNISIPP != 1) + { + $UNISIPP = -1; + } + } + elseif($testStatus == '998' || $testStatus == '802') + { + $UNISIP = 1; + $UNISIPP = 1; + } + } + if ($callTo == 'UNISIP') + { + if ($testStatus == '998' || $testStatus == '802') + { + if ($UNISIP != 1) + { + $UNISIP = -1; + } + if ($UNISIPP != 1) + { + $UNISIPP = 0; + } + + } + elseif($testStatus == '999' || $testStatus == '801') + { + if ($UNISIP != 1) + { + $UNISIP = 0; + } + if ($UNISIPP != 1) + { + $UNISIPP = 0; + } + } } } //END OF TEST CASE EXAMPLE -- cgit v1.2.3-55-g7522