Esempio n. 1
0
 def originate_call(self, src, dest):
     '''
     Origiante a call from src, I add the technologie to the src 
     cause F1Com protocol don't carry aboit it
     TODO : Must look for the solution for indicate the technologie
     '''
     tech = "SIP"
     peer = tech + "/" + src
     to_json = {"id": "originate", "servername": self._asteriskServer, "type": "dial", 
     "user": "******", "source": peer, "destination": dest}
     message = json.dumps(to_json)
     self._redisPublisher.publish("odin_ami_request_channel", message)
     #originateCall = OriginateCall({'src': src, 'dest': dest})
     originateCall = BasicObject("OriginateCall")
     originateCall.src = src
     originateCall.dest = dest
     #Set the key as the source number, the key will be migrate to uniqueid into create channel handler
     self.originateCalls[src] = originateCall #OriginateCall({'src': src, 'dest': dest})
     logger.debug("AMIBridge : Originate call from %s to %s " % (src,dest))