Changeset 2643 for pjproject


Ignore:
Timestamp:
Apr 23, 2009 11:50:25 AM (16 years ago)
Author:
bennylp
Message:

Fixed ticket #794: Bug with generating SDP version in origin line (thanks Joel Dodson for the report)

  • the INVITE session now correctly uses the SDP offer "fixed" by the negotiator, hence it will have the correct origin fields.
  • removed update_sdp_version() from PJSUA-LIB
  • the negotiator now also fixes the session ID of subsequent answer so that it's identical to the previous SDP
Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c

    r2394 r2643  
    423423    neg->state = PJMEDIA_SDP_NEG_STATE_WAIT_NEGO; 
    424424    if (local) { 
    425         if (!neg->initial_sdp) { 
     425        neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); 
     426        if (neg->initial_sdp) { 
     427            /* I don't think there is anything in RFC 3264 that mandates 
     428             * answerer to place the same origin (and increment version) 
     429             * in the answer, but probably it won't hurt either. 
     430             * Note that the version will be incremented in  
     431             * pjmedia_sdp_neg_negotiate() 
     432             */ 
     433            neg->neg_local_sdp->origin.id = neg->initial_sdp->origin.id; 
     434        } else { 
    426435            neg->initial_sdp = pjmedia_sdp_session_clone(pool, local); 
    427436        } 
    428         neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); 
    429437    } else { 
    430438        PJ_ASSERT_RETURN(neg->initial_sdp, PJMEDIA_SDPNEG_ENOINITIAL); 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r2594 r2643  
    22492249    } 
    22502250 
     2251    /* Notify negotiator about the new offer. This will fix the offer 
     2252     * with correct SDP origin. 
     2253     */ 
    22512254    status = pjmedia_sdp_neg_modify_local_offer(inv->pool,inv->neg, 
    22522255                                                offer); 
     
    22542257        goto on_error; 
    22552258 
     2259    /* Retrieve the "fixed" offer from negotiator */ 
     2260    pjmedia_sdp_neg_get_neg_local(inv->neg, &offer); 
    22562261 
    22572262    /* Update Contact if required */ 
     
    36203625                    (*mod_inv.cb.on_create_offer)(inv, &sdp); 
    36213626                    if (sdp) { 
     3627                        /* Notify negotiator about the new offer. This will 
     3628                         * fix the offer with correct SDP origin. 
     3629                         */ 
    36223630                        status = pjmedia_sdp_neg_modify_local_offer(dlg->pool, 
    36233631                                                                    inv->neg, 
    36243632                                                                    sdp); 
     3633 
     3634                        /* Retrieve the "fixed" offer from negotiator */ 
     3635                        if (status==PJ_SUCCESS) 
     3636                            pjmedia_sdp_neg_get_neg_local(inv->neg, &sdp); 
    36253637                    } 
    36263638                }  
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r2593 r2643  
    7878static pj_status_t create_sdp_of_call_hold(pjsua_call *call, 
    7979                                           pjmedia_sdp_session **p_answer); 
    80  
    81 /* Update SDP version in the offer */ 
    82 static void update_sdp_version(pjsua_call *call, 
    83                                pjmedia_sdp_session *sdp) 
    84 { 
    85     const pjmedia_sdp_session *old_sdp = NULL; 
    86     pj_status_t status; 
    87  
    88     status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &old_sdp); 
    89     if (status != PJ_SUCCESS || old_sdp == NULL) 
    90         return; 
    91  
    92     sdp->origin.version = old_sdp->origin.version + 1; 
    93 } 
    94  
    9580 
    9681/* 
     
    15201505    } 
    15211506 
    1522     update_sdp_version(call, sdp); 
    1523  
    15241507    /* Create re-INVITE with new offer */ 
    15251508    status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); 
     
    15921575    } 
    15931576 
    1594     update_sdp_version(call, sdp); 
    1595  
    15961577    /* Create re-INVITE with new offer */ 
    15971578    status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); 
     
    16501631        return status; 
    16511632    } 
    1652  
    1653     update_sdp_version(call, sdp); 
    16541633 
    16551634    /* Create UPDATE with new offer */ 
     
    33223301    } 
    33233302 
    3324     update_sdp_version(call, *offer); 
    3325  
    33263303    PJSUA_UNLOCK(); 
    33273304} 
Note: See TracChangeset for help on using the changeset viewer.