Пример #1
0
 def getSDP(self, dialog, othersdp):
     s = SDP()
     m = MediaDescription()
     m.port = 54321
     s.addMediaDescription(m)
     m.addRtpMap(PT_PCMU)
     if othersdp:
         s.intersect(othersdp)
     return s
Пример #2
0
 def getSDP(self, rtp, extrartp=None):
     from xshtoom.sdp import SDP, MediaDescription
     if extrartp:
         raise ValueError("can't handle multiple RTP streams in a call yet")
     s = SDP()
     addr = rtp.getVisibleAddress()
     s.setServerIP(addr[0])
     md = MediaDescription()  # defaults to type 'audio'
     s.addMediaDescription(md)
     md.setServerIP(addr[0])
     md.setLocalPort(addr[1])
     for pt, test in TryCodecs.items():
         if test is not None:
             md.addRtpMap(pt)
     md.addRtpMap(PT_PCMU)
     md.addRtpMap(PT_CN)
     md.addRtpMap(PT_NTE)
     return s
Пример #3
0
 def getSDP(self, rtp, extrartp=None):
     from xshtoom.sdp import SDP, MediaDescription
     if extrartp:
         raise ValueError("can't handle multiple RTP streams in a call yet")
     s = SDP()
     addr = rtp.getVisibleAddress()
     s.setServerIP(addr[0])
     md = MediaDescription() # defaults to type 'audio'
     s.addMediaDescription(md)
     md.setServerIP(addr[0])
     md.setLocalPort(addr[1])
     for pt, test in TryCodecs.items():
         if test is not None:
             md.addRtpMap(pt)
     md.addRtpMap(PT_PCMU)
     md.addRtpMap(PT_CN)
     md.addRtpMap(PT_NTE)
     return s