Changeset 3215 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- Jun 21, 2010 1:28:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r3208 r3215 2394 2394 2395 2395 /* Verify arguments. */ 2396 PJ_ASSERT_RETURN(inv && p_tdata && offer, PJ_EINVAL);2396 PJ_ASSERT_RETURN(inv && p_tdata, PJ_EINVAL); 2397 2397 2398 2398 /* Dialog must have been established */ … … 2407 2407 pjsip_dlg_inc_lock(inv->dlg); 2408 2408 2409 /* Process offer */ 2410 if (pjmedia_sdp_neg_get_state(inv->neg)!=PJMEDIA_SDP_NEG_STATE_DONE) { 2411 PJ_LOG(4,(inv->dlg->obj_name, 2412 "Invalid SDP offer/answer state for UPDATE")); 2413 status = PJ_EINVALIDOP; 2414 goto on_error; 2415 } 2416 2417 /* Notify negotiator about the new offer. This will fix the offer 2418 * with correct SDP origin. 2419 */ 2420 status = pjmedia_sdp_neg_modify_local_offer(inv->pool_prov, inv->neg, 2421 offer); 2422 if (status != PJ_SUCCESS) 2423 goto on_error; 2424 2425 /* Retrieve the "fixed" offer from negotiator */ 2426 pjmedia_sdp_neg_get_neg_local(inv->neg, &offer); 2409 /* Process offer, if any */ 2410 if (offer) { 2411 if (pjmedia_sdp_neg_get_state(inv->neg)!=PJMEDIA_SDP_NEG_STATE_DONE) { 2412 PJ_LOG(4,(inv->dlg->obj_name, 2413 "Invalid SDP offer/answer state for UPDATE")); 2414 status = PJ_EINVALIDOP; 2415 goto on_error; 2416 } 2417 2418 /* Notify negotiator about the new offer. This will fix the offer 2419 * with correct SDP origin. 2420 */ 2421 status = pjmedia_sdp_neg_modify_local_offer(inv->pool_prov, inv->neg, 2422 offer); 2423 if (status != PJ_SUCCESS) 2424 goto on_error; 2425 2426 /* Retrieve the "fixed" offer from negotiator */ 2427 pjmedia_sdp_neg_get_neg_local(inv->neg, &offer); 2428 } 2427 2429 2428 2430 /* Update Contact if required */ … … 2450 2452 2451 2453 /* Attach SDP body */ 2452 sdp_copy = pjmedia_sdp_session_clone(tdata->pool, offer); 2453 pjsip_create_sdp_body(tdata->pool, sdp_copy, &tdata->msg->body); 2454 if (offer) { 2455 sdp_copy = pjmedia_sdp_session_clone(tdata->pool, offer); 2456 pjsip_create_sdp_body(tdata->pool, sdp_copy, &tdata->msg->body); 2457 } 2454 2458 2455 2459 /* Unlock dialog. */ … … 2880 2884 else 2881 2885 { 2886 /* Session-Timer needs to see any error responses, to determine 2887 * whether peer supports UPDATE with empty body. 2888 */ 2889 if (tsx->state == PJSIP_TSX_STATE_COMPLETED && 2890 tsx->role == PJSIP_ROLE_UAC) 2891 { 2892 status = handle_timer_response(inv, e->body.tsx_state.src.rdata, 2893 PJ_FALSE); 2894 } 2895 2882 2896 tsx_inv_data = (struct tsx_inv_data*)tsx->mod_data[mod_inv.mod.id]; 2883 2897 if (tsx_inv_data == NULL) {
Note: See TracChangeset
for help on using the changeset viewer.