Changeset 4920
- Timestamp:
- Sep 9, 2014 8:31:37 AM (10 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r4889 r4920 871 871 /** 872 872 * Notify application when call has received new offer from remote 873 * (i.e. re-INVITE/UPDATE with SDP is received). Application can 873 * (i.e. re-INVITE/UPDATE with SDP is received, or from the 874 * INVITE response in the case that the initial outgoing INVITE 875 * has no SDP). Application can 874 876 * decide to accept/reject the offer by setting the code (default 875 877 * is 200). If the offer is accepted, application can update the … … 4106 4108 * for #pjsua_call_make_call(). 4107 4109 */ 4108 PJSUA_CALL_INCLUDE_DISABLED_MEDIA = 4 4110 PJSUA_CALL_INCLUDE_DISABLED_MEDIA = 4, 4111 4112 /** 4113 * Do not send SDP when sending INVITE or UPDATE. This flag is only valid 4114 * for #pjsua_call_make_call(), #pjsua_call_reinvite()/reinvite2(), or 4115 * #pjsua_call_update()/update2(). For re-invite/update, specifying 4116 * PJSUA_CALL_UNHOLD will take precedence over this flag. 4117 */ 4118 PJSUA_CALL_NO_SDP_OFFER = 8 4109 4119 4110 4120 } pjsua_call_flag; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r4856 r4920 364 364 const pjsua_med_tp_state_info *info) 365 365 { 366 pjmedia_sdp_session *offer ;366 pjmedia_sdp_session *offer = NULL; 367 367 pjsip_inv_session *inv = NULL; 368 368 pjsua_call *call = &pjsua_var.calls[call_id]; … … 412 412 413 413 /* Create offer */ 414 status = pjsua_media_channel_create_sdp(call->index, dlg->pool, NULL, 415 &offer, NULL); 416 if (status != PJ_SUCCESS) { 417 pjsua_perror(THIS_FILE, "Error initializing media channel", status); 418 goto on_error; 414 if ((call->opt.flag & PJSUA_CALL_NO_SDP_OFFER) == 0) { 415 status = pjsua_media_channel_create_sdp(call->index, dlg->pool, NULL, 416 &offer, NULL); 417 if (status != PJ_SUCCESS) { 418 pjsua_perror(THIS_FILE, "Error initializing media channel", status); 419 goto on_error; 420 } 419 421 } 420 422 … … 582 584 call->opt = *opt; 583 585 584 /* If call is established, reinit media channel */ 585 if (call->inv && call->inv->state == PJSIP_INV_STATE_CONFIRMED) { 586 /* If call is established or media channel hasn't been initialized, 587 * reinit media channel. 588 */ 589 if ((call->inv && call->inv->state == PJSIP_INV_STATE_CONNECTING && 590 call->med_cnt == 0) || 591 (call->inv && call->inv->state == PJSIP_INV_STATE_CONFIRMED)) 592 { 586 593 pjsip_role_e role = rem_sdp? PJSIP_ROLE_UAS : PJSIP_ROLE_UAC; 587 594 pj_status_t status; … … 619 626 pj_str_t contact; 620 627 pj_status_t status; 621 622 628 623 629 /* Check that account is valid */ … … 680 686 goto on_error; 681 687 } 682 688 683 689 /* Create temporary pool */ 684 690 tmp_pool = pjsua_pool_create("tmpcall10", 512, 256); … … 766 772 pjsip_dlg_inc_session(dlg, &pjsua_var.mod); 767 773 768 /* Init media channel */ 769 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC, 770 call->secure_level, dlg->pool, 771 NULL, NULL, PJ_TRUE, 772 &on_make_call_med_tp_complete); 774 if ((call->opt.flag & PJSUA_CALL_NO_SDP_OFFER) == 0) { 775 /* Init media channel */ 776 status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC, 777 call->secure_level, dlg->pool, 778 NULL, NULL, PJ_TRUE, 779 &on_make_call_med_tp_complete); 780 } 773 781 if (status == PJ_SUCCESS) { 774 782 status = on_make_call_med_tp_complete(call->index, NULL); … … 2384 2392 const pjsua_msg_data *msg_data) 2385 2393 { 2386 pjmedia_sdp_session *sdp ;2394 pjmedia_sdp_session *sdp = NULL; 2387 2395 pj_str_t *new_contact = NULL; 2388 2396 pjsip_tx_data *tdata; … … 2423 2431 if (call->local_hold && (call->opt.flag & PJSUA_CALL_UNHOLD)==0) { 2424 2432 status = create_sdp_of_call_hold(call, &sdp); 2425 } else {2433 } else if ((call->opt.flag & PJSUA_CALL_NO_SDP_OFFER) == 0) { 2426 2434 status = pjsua_media_channel_create_sdp(call->index, 2427 2435 call->inv->pool_prov, … … 2498 2506 const pjsua_msg_data *msg_data) 2499 2507 { 2500 pjmedia_sdp_session *sdp ;2508 pjmedia_sdp_session *sdp = NULL; 2501 2509 pj_str_t *new_contact = NULL; 2502 2510 pjsip_tx_data *tdata; … … 2530 2538 if (call->local_hold && (call->opt.flag & PJSUA_CALL_UNHOLD)==0) { 2531 2539 status = create_sdp_of_call_hold(call, &sdp); 2532 } else {2540 } else if ((call->opt.flag & PJSUA_CALL_NO_SDP_OFFER) == 0) { 2533 2541 status = pjsua_media_channel_create_sdp(call->index, 2534 2542 call->inv->pool_prov,
Note: See TracChangeset
for help on using the changeset viewer.