Changeset 1379 for pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
- Timestamp:
- Jun 20, 2007 10:03:46 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c
r1377 r1379 1226 1226 */ 1227 1227 1228 if (tsx_inv_data->sdp_done) 1228 if (tsx_inv_data->sdp_done) { 1229 if (rdata->msg_info.msg->body) { 1230 PJ_LOG(4,(inv->obj_name, "SDP negotiation done, message " 1231 "body is ignored")); 1232 } 1229 1233 return PJ_SUCCESS; 1234 } 1230 1235 1231 1236 /* Check if SDP is present in the message. */ … … 1384 1389 pjmedia_sdp_neg_has_local_answer(inv->neg) ) 1385 1390 { 1391 struct tsx_inv_data *tsx_inv_data; 1392 1393 /* Get invite session's transaction data */ 1394 tsx_inv_data = (struct tsx_inv_data*) 1395 inv->invite_tsx->mod_data[mod_inv.mod.id]; 1386 1396 1387 1397 status = inv_negotiate_sdp(inv); … … 1389 1399 return status; 1390 1400 1401 /* Mark this transaction has having SDP offer/answer done. */ 1402 tsx_inv_data->sdp_done = 1; 1403 1391 1404 status = pjmedia_sdp_neg_get_active_local(inv->neg, &sdp); 1392 1405 } … … 2504 2517 status = process_answer(inv, 200, tdata, NULL); 2505 2518 } else { 2506 const pjmedia_sdp_session *active_sdp; 2507 status = pjmedia_sdp_neg_send_local_offer(dlg->pool, 2508 inv->neg, 2509 &active_sdp); 2510 if (status == PJ_SUCCESS) { 2511 tdata->msg->body = create_sdp_body(tdata->pool, active_sdp); 2519 /* INVITE does not have SDP. 2520 * If on_create_offer() callback is implemented, ask app. 2521 * to generate an offer, otherwise just send active local 2522 * SDP to signal that nothing gets modified. 2523 */ 2524 pjmedia_sdp_session *sdp = NULL; 2525 2526 if (mod_inv.cb.on_create_offer) { 2527 (*mod_inv.cb.on_create_offer)(inv, &sdp); 2528 if (sdp) { 2529 status = pjmedia_sdp_neg_modify_local_offer(dlg->pool, 2530 inv->neg, 2531 sdp); 2532 } 2533 } 2534 2535 if (sdp == NULL) { 2536 const pjmedia_sdp_session *active_sdp = NULL; 2537 status = pjmedia_sdp_neg_send_local_offer(dlg->pool, 2538 inv->neg, 2539 &active_sdp); 2540 if (status == PJ_SUCCESS) 2541 sdp = (pjmedia_sdp_session*) active_sdp; 2542 } 2543 2544 if (sdp) { 2545 tdata->msg->body = create_sdp_body(tdata->pool, sdp); 2512 2546 } 2513 2547 } … … 2605 2639 inv_set_cause(inv, tsx->status_code, &tsx->status_text); 2606 2640 inv_set_state(inv, PJSIP_INV_STATE_DISCONNECTED, e); 2641 2642 } else if (tsx->status_code >= 300 && tsx->status_code < 700) { 2643 2644 pjmedia_sdp_neg_state neg_state; 2645 2646 /* Outgoing INVITE transaction has failed, cancel SDP nego */ 2647 neg_state = pjmedia_sdp_neg_get_state(inv->neg); 2648 if (neg_state == PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER) { 2649 pjmedia_sdp_neg_cancel_offer(inv->neg); 2650 } 2607 2651 } 2608 2652 }
Note: See TracChangeset
for help on using the changeset viewer.