summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/30-07-2011/CallClass.py
blob: ced8e3e03f72b513c3c8f869f3d29c29122cc7d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pjsua as pj
import AccClass

class Calling(pj.CallCallback):

    	def __init__(self, call=None):
        	pj.CallCallback.__init__(self, call)
		#self.server = server

	def on_state(self):
		global current_call

		if self.call.info().state <> pj.CallState.DISCONNECTED:
			if self.call.info().state_text == "CONNECTING":
				#logger.logEvent("Call Connecting")
				#logger.logEvent('200')
				#self.server.sendData('CALL OK')
				print "Connect"

		if self.call.info().last_reason == "Busy Here":
			#logger.logEvent('Number busy or Offline')
			#server.sendData('CALL NOT OK')
			#logger.logEvent('CALL NOT OK')
			print "busy"
        
        	if self.call.info().state == pj.CallState.DISCONNECTED:
			#logger.logEvent('Call Disconnected')
			current_call = None
			print "discon"