Changeset 4963 for pjproject/trunk
- Timestamp:
- Nov 25, 2014 9:53:14 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r4956 r4963 773 773 pjsip_dlg_inc_lock(dlg); 774 774 775 if (acc->cfg.allow_via_rewrite && acc->via_addr.host.slen > 0) 775 if (acc->cfg.allow_via_rewrite && acc->via_addr.host.slen > 0) { 776 776 pjsip_dlg_set_via_sent_by(dlg, &acc->via_addr, acc->via_tp); 777 } else if (!pjsua_sip_acc_is_using_stun(acc_id)) { 778 /* Choose local interface to use in Via if acc is not using 779 * STUN. See https://trac.pjsip.org/repos/ticket/1804 780 */ 781 pjsip_host_port via_addr; 782 const void *via_tp; 783 784 if (pjsua_acc_get_uac_addr(acc_id, dlg->pool, &acc->cfg.id, 785 &via_addr, NULL, NULL, 786 &via_tp) == PJ_SUCCESS) 787 { 788 pjsip_dlg_set_via_sent_by(dlg, &via_addr, 789 (pjsip_transport*)via_tp); 790 } 791 } 777 792 778 793 /* Calculate call's secure level */ … … 1350 1365 pjsip_dlg_set_via_sent_by(dlg, &pjsua_var.acc[acc_id].via_addr, 1351 1366 pjsua_var.acc[acc_id].via_tp); 1367 } else if (!pjsua_sip_acc_is_using_stun(acc_id)) { 1368 /* Choose local interface to use in Via if acc is not using 1369 * STUN. See https://trac.pjsip.org/repos/ticket/1804 1370 */ 1371 char target_buf[PJSIP_MAX_URL_SIZE]; 1372 pj_str_t target; 1373 pjsip_host_port via_addr; 1374 const void *via_tp; 1375 1376 target.ptr = target_buf; 1377 target.slen = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, 1378 dlg->target, 1379 target_buf, sizeof(target_buf)); 1380 if (target.slen < 0) target.slen = 0; 1381 1382 if (pjsua_acc_get_uac_addr(acc_id, dlg->pool, &target, 1383 &via_addr, NULL, NULL, 1384 &via_tp) == PJ_SUCCESS) 1385 { 1386 pjsip_dlg_set_via_sent_by(dlg, &via_addr, 1387 (pjsip_transport*)via_tp); 1388 } 1352 1389 } 1353 1390
Note: See TracChangeset
for help on using the changeset viewer.