Ignore:
Timestamp:
Oct 14, 2009 1:13:18 PM (15 years ago)
Author:
bennylp
Message:

Ticket #881: send UPDATE or re-INVITE after ICE negotiation, if the default candidate has changed

  • done
  • added pj_ice_strans_state (to be used for informational purposes for now)
  • added pjmedia ICE transport specific info, and display it in call dump output
  • misc fixes (changed pjmedia_transport_info.spec_info_cnt from int to unsigned)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r2943 r2945  
    822822                pjsua_var.ua_cfg.cb.on_call_media_state(id); 
    823823            } 
     824        } else { 
     825            /* Send UPDATE if default transport address is different than 
     826             * what was advertised (ticket #881) 
     827             */ 
     828            pjmedia_transport_info tpinfo; 
     829            pjmedia_ice_transport_info *ii = NULL; 
     830            unsigned i; 
     831 
     832            pjmedia_transport_info_init(&tpinfo); 
     833            pjmedia_transport_get_info(tp, &tpinfo); 
     834            for (i=0; i<tpinfo.specific_info_cnt; ++i) { 
     835                if (tpinfo.spc_info[i].type==PJMEDIA_TRANSPORT_TYPE_ICE) { 
     836                    ii = (pjmedia_ice_transport_info*) 
     837                         tpinfo.spc_info[i].buffer; 
     838                    break; 
     839                } 
     840            } 
     841 
     842            if (ii && ii->role==PJ_ICE_SESS_ROLE_CONTROLLING && 
     843                pj_sockaddr_cmp(&tpinfo.sock_info.rtp_addr_name, 
     844                                &pjsua_var.calls[id].med_rtp_addr)) 
     845            { 
     846                PJ_LOG(4,(THIS_FILE,  
     847                          "ICE default transport address has changed for " 
     848                          "call %d, sending UPDATE", id)); 
     849                pjsua_call_update(id, 0, NULL); 
     850            } 
    824851        } 
    825852        break; 
     
    13211348    } 
    13221349 
     1350    /* Update currently advertised RTP source address */ 
     1351    pj_memcpy(&call->med_rtp_addr, &tpinfo.sock_info.rtp_addr_name,  
     1352              sizeof(pj_sockaddr)); 
     1353 
    13231354    *p_sdp = sdp; 
    13241355    return PJ_SUCCESS; 
     
    14831514        pjmedia_transport_get_info(call->med_tp, &tp_info); 
    14841515        if (tp_info.specific_info_cnt > 0) { 
    1485             int i; 
     1516            unsigned i; 
    14861517            for (i = 0; i < tp_info.specific_info_cnt; ++i) { 
    14871518                if (tp_info.spc_info[i].type == PJMEDIA_TRANSPORT_TYPE_SRTP)  
Note: See TracChangeset for help on using the changeset viewer.