- Timestamp:
- Dec 6, 2016 11:23:39 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/swig/symbols.i
r5491 r5493 164 164 typedef enum pjsua_vid_req_keyframe_method {PJSUA_VID_REQ_KEYFRAME_SIP_INFO = 1, PJSUA_VID_REQ_KEYFRAME_RTCP_PLI = 2} pjsua_vid_req_keyframe_method; 165 165 166 typedef enum pjsua_call_flag {PJSUA_CALL_UNHOLD = 1, PJSUA_CALL_UPDATE_CONTACT = 2, PJSUA_CALL_INCLUDE_DISABLED_MEDIA = 4, PJSUA_CALL_NO_SDP_OFFER = 8, PJSUA_CALL_REINIT_MEDIA = 16 } pjsua_call_flag;166 typedef enum pjsua_call_flag {PJSUA_CALL_UNHOLD = 1, PJSUA_CALL_UPDATE_CONTACT = 2, PJSUA_CALL_INCLUDE_DISABLED_MEDIA = 4, PJSUA_CALL_NO_SDP_OFFER = 8, PJSUA_CALL_REINIT_MEDIA = 16, PJSUA_CALL_UPDATE_VIA = 32} pjsua_call_flag; 167 167 168 168 typedef enum pjsua_create_media_transport_flag {PJSUA_MED_TP_CLOSE_MEMBER = 1} pjsua_create_media_transport_flag; -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r5490 r5493 4298 4298 * reverted. 4299 4299 */ 4300 PJSUA_CALL_REINIT_MEDIA = 16 4300 PJSUA_CALL_REINIT_MEDIA = 16, 4301 4302 /** 4303 * Update the local invite session's Via with the via address from 4304 * the account. This flag is only valid for #pjsua_call_set_hold2(), 4305 * #pjsua_call_reinvite() and #pjsua_call_update(). Similar to 4306 * the flag PJSUA_CALL_UPDATE_CONTACT above, this flag is useful 4307 * in IP address change situation, after the local account's Via has 4308 * been updated (typically with re-registration). 4309 */ 4310 PJSUA_CALL_UPDATE_VIA = 32 4301 4311 4302 4312 } pjsua_call_flag; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r5492 r5493 570 570 { 571 571 opt->flag &= ~(PJSUA_CALL_UNHOLD | PJSUA_CALL_UPDATE_CONTACT | 572 PJSUA_CALL_NO_SDP_OFFER | PJSUA_CALL_REINIT_MEDIA); 572 PJSUA_CALL_NO_SDP_OFFER | PJSUA_CALL_REINIT_MEDIA | 573 PJSUA_CALL_UPDATE_VIA); 573 574 } 574 575 … … 637 638 638 639 return PJ_SUCCESS; 640 } 641 642 static void dlg_set_via(pjsip_dialog *dlg, pjsua_acc *acc) 643 { 644 if (acc->cfg.allow_via_rewrite && acc->via_addr.host.slen > 0) { 645 pjsip_dlg_set_via_sent_by(dlg, &acc->via_addr, acc->via_tp); 646 } else if (!pjsua_sip_acc_is_using_stun(acc->index)) { 647 /* Choose local interface to use in Via if acc is not using 648 * STUN. See https://trac.pjsip.org/repos/ticket/1804 649 */ 650 pjsip_host_port via_addr; 651 const void *via_tp; 652 653 if (pjsua_acc_get_uac_addr(acc->index, dlg->pool, &acc->cfg.id, 654 &via_addr, NULL, NULL, 655 &via_tp) == PJ_SUCCESS) 656 { 657 pjsip_dlg_set_via_sent_by(dlg, &via_addr, 658 (pjsip_transport*)via_tp); 659 } 660 } 639 661 } 640 662 … … 778 800 pjsip_dlg_inc_lock(dlg); 779 801 780 if (acc->cfg.allow_via_rewrite && acc->via_addr.host.slen > 0) { 781 pjsip_dlg_set_via_sent_by(dlg, &acc->via_addr, acc->via_tp); 782 } else if (!pjsua_sip_acc_is_using_stun(acc_id)) { 783 /* Choose local interface to use in Via if acc is not using 784 * STUN. See https://trac.pjsip.org/repos/ticket/1804 785 */ 786 pjsip_host_port via_addr; 787 const void *via_tp; 788 789 if (pjsua_acc_get_uac_addr(acc_id, dlg->pool, &acc->cfg.id, 790 &via_addr, NULL, NULL, 791 &via_tp) == PJ_SUCCESS) 792 { 793 pjsip_dlg_set_via_sent_by(dlg, &via_addr, 794 (pjsip_transport*)via_tp); 795 } 796 } 802 dlg_set_via(dlg, acc); 797 803 798 804 /* Calculate call's secure level */ … … 2500 2506 } 2501 2507 2508 if ((options & PJSUA_CALL_UPDATE_VIA) && 2509 pjsua_acc_is_valid(call->acc_id)) 2510 { 2511 dlg_set_via(call->inv->dlg, &pjsua_var.acc[call->acc_id]); 2512 } 2513 2502 2514 /* Create re-INVITE with new offer */ 2503 2515 status = pjsip_inv_reinvite( call->inv, new_contact, sdp, &tdata); … … 2621 2633 } 2622 2634 2635 if ((call->opt.flag & PJSUA_CALL_UPDATE_VIA) && 2636 pjsua_acc_is_valid(call->acc_id)) 2637 { 2638 dlg_set_via(call->inv->dlg, &pjsua_var.acc[call->acc_id]); 2639 } 2640 2623 2641 /* Create re-INVITE with new offer */ 2624 2642 status = pjsip_inv_reinvite( call->inv, new_contact, sdp, &tdata); … … 2728 2746 { 2729 2747 new_contact = &pjsua_var.acc[call->acc_id].contact; 2748 } 2749 2750 if ((call->opt.flag & PJSUA_CALL_UPDATE_VIA) && 2751 pjsua_acc_is_valid(call->acc_id)) 2752 { 2753 dlg_set_via(call->inv->dlg, &pjsua_var.acc[call->acc_id]); 2730 2754 } 2731 2755
Note: See TracChangeset
for help on using the changeset viewer.