Changeset 1291


Ignore:
Timestamp:
May 23, 2007 7:12:23 AM (12 years ago)
Author:
bennylp
Message:

Fixed ticket #288: ICE role error on re-INVITE and ICE auth error when sending 487 (Role Conflict) response

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_session.c

    r1275 r1291  
    445445    realm->slen = nonce->slen = 0; 
    446446 
    447     if (PJ_STUN_IS_SUCCESS_RESPONSE(msg->hdr.type) || 
    448         PJ_STUN_IS_ERROR_RESPONSE(msg->hdr.type)) 
    449     { 
     447    if (PJ_STUN_IS_RESPONSE(msg->hdr.type)) { 
    450448        /* Outgoing responses need to have the same credential as 
    451449         * incoming requests. 
     
    19161914    } 
    19171915 
     1916    /* Handle the case when request comes before answer is received. 
     1917     * We need to put credential in the response, and since we haven't 
     1918     * got the response, copy the username from the request. 
     1919     */ 
     1920    if (ice->rcand_cnt == 0) { 
     1921        pj_stun_string_attr *uname_attr; 
     1922 
     1923        uname_attr = (pj_stun_string_attr*) 
     1924                     pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_USERNAME, 0); 
     1925        pj_assert(uname_attr != NULL); 
     1926        pj_strdup(ice->pool, &ice->rx_uname, &uname_attr->value); 
     1927    } 
     1928 
    19181929    /* 7.2.1.1.  Detecting and Repairing Role Conflicts 
    19191930     */ 
     
    19611972    } 
    19621973 
    1963     /* Handle the case when request comes before answer is received. 
    1964      * We need to put credential in the response, and since we haven't 
    1965      * got the response, copy the username from the request. 
    1966      */ 
    1967     if (ice->rcand_cnt == 0) { 
    1968         pj_stun_string_attr *uname_attr; 
    1969  
    1970         uname_attr = (pj_stun_string_attr*) 
    1971                      pj_stun_msg_find_attr(msg, PJ_STUN_ATTR_USERNAME, 0); 
    1972         pj_assert(uname_attr != NULL); 
    1973         pj_strdup(ice->pool, &ice->rx_uname, &uname_attr->value); 
    1974     } 
    1975  
    19761974    /*  
    19771975     * First send response to this request  
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r1266 r1291  
    22682268 
    22692269        /* Init media channel */ 
    2270         status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC); 
     2270        status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS); 
    22712271        if (status != PJ_SUCCESS) { 
    22722272            pjsua_perror(THIS_FILE, "Error initializing media channel", status); 
Note: See TracChangeset for help on using the changeset viewer.