From 7b2c90066692566044ac80ec421e15a1aee7ab25 Mon Sep 17 00:00:00 2001 From: triatmoko Date: Mon, 18 Jul 2011 16:15:35 +0200 Subject: fixed bugs for calling part on sip. --- For Weekly Test/20-07-2011/classController.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'For Weekly Test/20-07-2011/classController.py') diff --git a/For Weekly Test/20-07-2011/classController.py b/For Weekly Test/20-07-2011/classController.py index a3e98ff..e26250d 100644 --- a/For Weekly Test/20-07-2011/classController.py +++ b/For Weekly Test/20-07-2011/classController.py @@ -34,7 +34,7 @@ class test: def timeout_handler(signum, frame): raise TimeoutException() - + print "" print "====================== Preparing Test ======================" try: @@ -102,7 +102,7 @@ class test: print "" try: - global portDest + print self.dest if self.dest =="gsmBox1" or self.dest =="gsmBox2": @@ -112,7 +112,7 @@ class test: if self.dest =="gsmBox2": self.portDest = 50103 - y = classClient.Connection(destAdd,portDest) + y = classClient.Connection(self.destAdd, self.portDest) print "Connecting to Receiver handler" print "Receiver handler status: ", y.connect() y.sendData('hello server please wakeup the handler and be receiver') @@ -126,7 +126,7 @@ class test: if self.dest=="SIPReceiver.py": self.portDest = 50104 - if self.dest=="rz1Receiver.py": + if self.dest=="gsmincom_.py": self.portDest = 50105 if self.dest == "landlineReceiver.py": @@ -139,10 +139,9 @@ class test: #print "not define yet" #portDest = 50108 - y = classClient.Connection(self.destAdd,portDest) - print "Connecting to Receiver handler" + y = classClient.Connection(self.destAdd, self.portDest) + print "Connecting to Receiver handler xx", self.destAdd, self.portDest, self.dest print "Receiver handler status:", y.connect() - y.sendData('hello Receiver') signal.signal(signal.SIGALRM, timeout_handler) @@ -173,7 +172,7 @@ class test: y.connect() signal.signal(signal.SIGALRM, timeout_handler) - signal.alarm(120) + signal.alarm(1200) print "------------ Test Result ------------" print "" @@ -184,7 +183,7 @@ class test: resultOrig = x.receiveData() resultDest = y.receiveData() - if resultOrig <> "" or resultDest <> "": + if resultOrig <> "" and resultDest <> "": break except TimeoutException: @@ -214,7 +213,7 @@ class test: resultOrig = x.receiveData() resultDest = y.receiveData() - if resultOrig <> "" or resultDest <> "": + if resultOrig <> "" and resultDest <> "": break except TimeoutException: -- cgit v1.2.3-55-g7522