Show
Ignore:
Timestamp:
08/21/07 01:14:57 (17 months ago)
Author:
liori
Message:

Jingle: wrongly decoded connection parameters from transport-info

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/jingle/src/common/jingle.py

    r8507 r8524  
    432432                for candidate in content.getTag('transport').iterTags('candidate'): 
    433433                        cand={ 
    434                         #       'candidate_id': str(self.session.connection.connection.getAnID()), 
    435434                                'candidate_id': candidate['cid'], 
    436435                                'component':    int(candidate['component']), 
    437436                                'ip':           candidate['ip'], 
    438437                                'port':         int(candidate['port']), 
    439                                 'proto':        candidate['protocol']=='udp' and farsight.NETWORK_PROTOCOL_UDP \ 
    440                                                 or farsight.NETWORK_PROTOCOL_TCP, 
    441438                                'proto_subtype':'RTP', 
    442439                                'proto_profile':'AVP', 
    443440                                'preference':   float(candidate['priority'])/100000, 
    444                         #       'type':         farsight.CANDIDATE_TYPE_LOCAL, 
    445                                 'type':         int(candidate['type']), 
     441                                'type':         farsight.CANDIDATE_TYPE_LOCAL, 
    446442                        } 
    447                         if 'ufrag' in candidate: cand['username']=candidate['ufrag'] 
    448                         if 'pwd' in candidate: cand['password']=candidate['pwd'] 
     443                        if candidate['protocol']=='udp': 
     444                                cand['proto']=farsight.NETWORK_PROTOCOL_UDP 
     445                        else: 
     446                                # we actually don't handle properly different tcp options in jingle 
     447                                cand['proto']=farsight.NETWORK_PROTOCOL_TCP 
     448                        if 'ufrag' in candidate: 
     449                                cand['username']=candidate['ufrag'] 
     450                        if 'pwd' in candidate: 
     451                                cand['password']=candidate['pwd'] 
    449452 
    450453                        candidates.append(cand) 
     
    541544                        'port': candidate['port'], 
    542545                        'priority': int(100000*candidate['preference']), # hack 
    543                         'protocol': candidate['proto']==farsight.NETWORK_PROTOCOL_UDP and 'udp' or 'tcp', 
    544546                } 
     547                if candidate['proto']==farsight.NETWORK_PROTOCOL_UDP: 
     548                        attrs['protocol']='udp' 
     549                else: 
     550                        # we actually don't handle properly different tcp options in jingle 
     551                        attrs['protocol']='tcp' 
    545552                if 'username' in candidate: attrs['ufrag']=candidate['username'] 
    546553                if 'password' in candidate: attrs['pwd']=candidate['password']