Esempio n. 1
0
 def handler_ami_createparkedcall(self, data):
     logger.debug("AMIBridge handler_ami_createparkedcall")
     channel = data['parkedcall']['channel']
     parked  = self.parkedCalls.get(channel)
     if not parked :
         parked = BasicObject("ParkedCall")
         #populate the parked 
         parked.channel = channel
         parked.exten =  data['parkedcall']['exten']
         parked.channelFrom = data['parkedcall']['parkedFrom']
         parked.calleridnum = data['parkedcall']['calleridnum']
         parked.calleridnumFrom = data['parkedcall']['calleridnumFrom']
         parked.timeout = data['parkedcall']['timeout']
         parked.calleridname = data['parkedcall']['calleridname']
         parked.calleridnameFrom = data['parkedcall']['calleridnameFrom']
         self.parkedCalls[channel] = parked
Esempio n. 2
0
 def _createChannel(self, data):
     #
     createChannel = data['channel']
     uniqueid = createChannel['uniqueid']
     channel = createChannel['channel']
     if not self.channels.has_key(uniqueid):
         #
         newChannel = BasicObject("Channel")
         newChannel.uniqueid     = uniqueid
         newChannel.channel      = channel
         newChannel.state        = createChannel['state']
         newChannel.calleridnum  = createChannel['calleridnum']
         newChannel.calleridname = createChannel['calleridname']
         newChannel.monitor      = createChannel['monitor']
         newChannel.spy          = createChannel['spy']
         newChannel.starttime    = time.time()
         self.channels[uniqueid] = newChannel
     else:
         logger.warning("AMIBridge : Channel %s with unique id %s already exists." %(channel, uniqueid))