Changeset 2795 for pjproject


Ignore:
Timestamp:
Jun 24, 2009 6:52:57 PM (15 years ago)
Author:
bennylp
Message:

Ticket #795: merged changes from ticket #794

Location:
pjproject/branches/1.0
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.0

  • pjproject/branches/1.0/pjmedia/src/pjmedia/sdp_neg.c

    r2394 r2795  
    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/branches/1.0/pjsip/src/pjsip-ua/sip_inv.c

    r2394 r2795  
    22472247    } 
    22482248 
     2249    /* Notify negotiator about the new offer. This will fix the offer 
     2250     * with correct SDP origin. 
     2251     */ 
    22492252    status = pjmedia_sdp_neg_modify_local_offer(inv->pool,inv->neg, 
    22502253                                                offer); 
     
    22522255        goto on_error; 
    22532256 
     2257    /* Retrieve the "fixed" offer from negotiator */ 
     2258    pjmedia_sdp_neg_get_neg_local(inv->neg, &offer); 
    22542259 
    22552260    /* Update Contact if required */ 
     
    36183623                    (*mod_inv.cb.on_create_offer)(inv, &sdp); 
    36193624                    if (sdp) { 
     3625                        /* Notify negotiator about the new offer. This will 
     3626                         * fix the offer with correct SDP origin. 
     3627                         */ 
    36203628                        status = pjmedia_sdp_neg_modify_local_offer(dlg->pool, 
    36213629                                                                    inv->neg, 
    36223630                                                                    sdp); 
     3631 
     3632                        /* Retrieve the "fixed" offer from negotiator */ 
     3633                        if (status==PJ_SUCCESS) { 
     3634                            const pjmedia_sdp_session *lsdp = NULL; 
     3635                            pjmedia_sdp_neg_get_neg_local(inv->neg, &lsdp); 
     3636                            sdp = (pjmedia_sdp_session*)lsdp; 
     3637                        } 
    36233638                    } 
    36243639                }  
  • pjproject/branches/1.0/pjsip/src/pjsua-lib/pjsua_call.c

    r2394 r2795  
    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/* 
     
    15081493    } 
    15091494 
    1510     update_sdp_version(call, sdp); 
    1511  
    15121495    /* Create re-INVITE with new offer */ 
    15131496    status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); 
     
    15801563    } 
    15811564 
    1582     update_sdp_version(call, sdp); 
    1583  
    15841565    /* Create re-INVITE with new offer */ 
    15851566    status = pjsip_inv_reinvite( call->inv, NULL, sdp, &tdata); 
     
    16381619        return status; 
    16391620    } 
    1640  
    1641     update_sdp_version(call, sdp); 
    16421621 
    16431622    /* Create UPDATE with new offer */ 
     
    33103289    } 
    33113290 
    3312     update_sdp_version(call, *offer); 
    3313  
    33143291    PJSUA_UNLOCK(); 
    33153292} 
Note: See TracChangeset for help on using the changeset viewer.