def __init__(self, address, port): connection.__init__(self, 'udp') # Bind to free random port for incoming RTP traffic self.bind(('',0)) self.__localport = self.getsockname()[1] # The address and port of the remote host self.__address = address self.__port = port # Send byte buffer self.__sendBuffer = b'' # Create a stream dump file with date and time and random ID in case of # flooding attacks dumpDateTime = time.strftime("%Y%m%d_%H:%M:%S") dumpId = random.randint(1000, 9999) streamDumpFile = "stream_{0}_{1}.rtpdump".format(dumpDateTime, dumpId) # Catch IO errors try: self.__streamDump = open(streamDumpFile, "wb") except IOError as e: logger.error("Could not open stream dump file: {}".format(e)) self.__streamDump = None logger.debug("Created RTP channel :{} <-> :{}".format( self.__localport, self.__port))
def __init__(self, address, port): connection.__init__(self, 'udp') # Bind to free random port for incoming RTP traffic self.bind(('', 0)) self.__localport = self.getsockname()[1] # The address and port of the remote host self.__address = address self.__port = port # Send byte buffer self.__sendBuffer = b'' # Create a stream dump file with date and time and random ID in case of # flooding attacks dumpDateTime = time.strftime("%Y%m%d_%H:%M:%S") dumpId = random.randint(1000, 9999) streamDumpFile = "stream_{0}_{1}.rtpdump".format(dumpDateTime, dumpId) # Catch IO errors try: self.__streamDump = open(streamDumpFile, "wb") except IOError as e: logger.error("Could not open stream dump file: {}".format(e)) self.__streamDump = None logger.debug("Created RTP channel :{} <-> :{}".format( self.__localport, self.__port))
def __init__(self): connection.__init__(self, 'udp') # Set SIP connection in session class variable SipSession.sipConnection = self # Dictionary with SIP sessions (key is call-id) self.__sessions = {}
def __init__(self): connection.__init__(self) self.loginfo = connection() self.masterhandle = '' self.home = ''