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. ''' # See above comment about port translation. # We have to do STUN for both RTP and RTCP, and hope we get a sane # answer. from xshtoom.nat import getMapper d = getMapper() d.addCallback(self._cb_gotMapper) return d
def unmapRTP(self): from xshtoom.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