Esempio n. 1
0
 def unmapRTP(self):
     from nat import getMapper
     if self.needSTUN is False:
         return defer.succeed(None)
     # Currently removing an already-fired trigger doesn't hurt,
     # but this seems likely to change.
     try:
         reactor.removeSystemEventTrigger(self._shutdownHook)
     except:
         pass
     d = getMapper()
     d.addCallback(self._cb_unmap_gotMapper)
     return d
Esempio n. 2
0
 def unmapRTP(self):
     from nat import getMapper
     if self.needSTUN is False:
         return defer.succeed(None)
     # Currently removing an already-fired trigger doesn't hurt,
     # but this seems likely to change.
     try:
         reactor.removeSystemEventTrigger(self._shutdownHook)
     except:
         pass
     d = getMapper()
     d.addCallback(self._cb_unmap_gotMapper)
     return d
Esempio n. 3
0
 def natMapping(self):
     ''' Uses STUN to discover the external address for the RTP/RTCP
         ports. deferred is a Deferred to be triggered when STUN is
         complete.
     '''
     if VERBOSE:
         print "Nat mapping ..."
     # See above comment about port translation.
     # We have to do STUN for both RTP and RTCP, and hope we get a sane
     # answer.
     from nat import getMapper
     d = getMapper()
     d.addCallback(self._cb_gotMapper)
     return d
Esempio n. 4
0
 def natMapping(self):
     ''' Uses STUN to discover the external address for the RTP/RTCP
         ports. deferred is a Deferred to be triggered when STUN is
         complete.
     '''
     if VERBOSE:
         print "Nat mapping ..."
     # See above comment about port translation.
     # We have to do STUN for both RTP and RTCP, and hope we get a sane
     # answer.
     from nat import getMapper
     d = getMapper()
     d.addCallback(self._cb_gotMapper)
     return d