def _create_rtp_socket(self, cookie, session): #Init RTPProtocol rtp = RTPProtocol(self, cookie, session.payload, session.jitter_buffer_size, verbose=session.verbose) #Creating socket rtp.createRTPSocket(session.host, session.rport, session.sport, False) #Register the session self.currentRecordings[cookie] = (rtp, session) #Registering host and port in used(if default port is in used by another #application it will choose another if rtp.rport > 0: session.host = (session.host, rtp.rport) else: session.host = (session.host, rtp.sport)
class TestRTPProtocol(unittest.TestCase): def setUp(self): self.rtp = RTPProtocol(self, "ahahahahaha", 96) def tearDown(self): pass def test_checksum(self): #Test a good packet packet = RTPPacket(424242, 2, 10, "", pt=96) bytes = packet.netbytes() res = self.rtp.checksum(bytes) assert (res == 1), self.fail("Wrong checksum for RTP packet")
class TestRTPProtocol(unittest.TestCase): def setUp(self): self.rtp = RTPProtocol(self, "ahahahahaha", 96) def tearDown(self): pass def test_checksum(self): #Test a good packet packet = RTPPacket(424242, 2, 10, "", pt=96) bytes = packet.netbytes() res = self.rtp.checksum(bytes) assert(res==1), self.fail("Wrong checksum for RTP packet")
def setUp(self): self.rtp = RTPProtocol(self, "ahahahahaha", 96)