Jingle: wrongly decoded connection parameters from transport-info
This commit is contained in:
parent
6a6527e1f3
commit
7f57a9d2e8
|
@ -431,21 +431,24 @@ class JingleVoiP(JingleContent):
|
||||||
candidates = []
|
candidates = []
|
||||||
for candidate in content.getTag('transport').iterTags('candidate'):
|
for candidate in content.getTag('transport').iterTags('candidate'):
|
||||||
cand={
|
cand={
|
||||||
# 'candidate_id': str(self.session.connection.connection.getAnID()),
|
|
||||||
'candidate_id': candidate['cid'],
|
'candidate_id': candidate['cid'],
|
||||||
'component': int(candidate['component']),
|
'component': int(candidate['component']),
|
||||||
'ip': candidate['ip'],
|
'ip': candidate['ip'],
|
||||||
'port': int(candidate['port']),
|
'port': int(candidate['port']),
|
||||||
'proto': candidate['protocol']=='udp' and farsight.NETWORK_PROTOCOL_UDP \
|
|
||||||
or farsight.NETWORK_PROTOCOL_TCP,
|
|
||||||
'proto_subtype':'RTP',
|
'proto_subtype':'RTP',
|
||||||
'proto_profile':'AVP',
|
'proto_profile':'AVP',
|
||||||
'preference': float(candidate['priority'])/100000,
|
'preference': float(candidate['priority'])/100000,
|
||||||
# 'type': farsight.CANDIDATE_TYPE_LOCAL,
|
'type': farsight.CANDIDATE_TYPE_LOCAL,
|
||||||
'type': int(candidate['type']),
|
|
||||||
}
|
}
|
||||||
if 'ufrag' in candidate: cand['username']=candidate['ufrag']
|
if candidate['protocol']=='udp':
|
||||||
if 'pwd' in candidate: cand['password']=candidate['pwd']
|
cand['proto']=farsight.NETWORK_PROTOCOL_UDP
|
||||||
|
else:
|
||||||
|
# we actually don't handle properly different tcp options in jingle
|
||||||
|
cand['proto']=farsight.NETWORK_PROTOCOL_TCP
|
||||||
|
if 'ufrag' in candidate:
|
||||||
|
cand['username']=candidate['ufrag']
|
||||||
|
if 'pwd' in candidate:
|
||||||
|
cand['password']=candidate['pwd']
|
||||||
|
|
||||||
candidates.append(cand)
|
candidates.append(cand)
|
||||||
print self.session.weinitiate, "#add_remote_candidate"
|
print self.session.weinitiate, "#add_remote_candidate"
|
||||||
|
@ -540,8 +543,12 @@ class JingleVoiP(JingleContent):
|
||||||
'network': '0',
|
'network': '0',
|
||||||
'port': candidate['port'],
|
'port': candidate['port'],
|
||||||
'priority': int(100000*candidate['preference']), # hack
|
'priority': int(100000*candidate['preference']), # hack
|
||||||
'protocol': candidate['proto']==farsight.NETWORK_PROTOCOL_UDP and 'udp' or 'tcp',
|
|
||||||
}
|
}
|
||||||
|
if candidate['proto']==farsight.NETWORK_PROTOCOL_UDP:
|
||||||
|
attrs['protocol']='udp'
|
||||||
|
else:
|
||||||
|
# we actually don't handle properly different tcp options in jingle
|
||||||
|
attrs['protocol']='tcp'
|
||||||
if 'username' in candidate: attrs['ufrag']=candidate['username']
|
if 'username' in candidate: attrs['ufrag']=candidate['username']
|
||||||
if 'password' in candidate: attrs['pwd']=candidate['password']
|
if 'password' in candidate: attrs['pwd']=candidate['password']
|
||||||
c=self.__content()
|
c=self.__content()
|
||||||
|
|
|
@ -255,7 +255,7 @@ class Node(object):
|
||||||
return self.delAttr(item)
|
return self.delAttr(item)
|
||||||
def __contains__(self,item):
|
def __contains__(self,item):
|
||||||
""" Checks if node has attribute "item" """
|
""" Checks if node has attribute "item" """
|
||||||
self.has_attr(item)
|
return self.has_attr(item)
|
||||||
def __getattr__(self,attr):
|
def __getattr__(self,attr):
|
||||||
""" Reduce memory usage caused by T/NT classes - use memory only when needed. """
|
""" Reduce memory usage caused by T/NT classes - use memory only when needed. """
|
||||||
if attr=='T':
|
if attr=='T':
|
||||||
|
|
Loading…
Reference in New Issue