Changeset 4185
- Timestamp:
- Jun 28, 2012 2:16:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r4181 r4185 1342 1342 tp = param->rdata->tp_info.transport; 1343 1343 1344 /* If allow_via_rewrite is enabled, we save the Via "sent-by" address 1344 /* Get the received and rport info */ 1345 via = param->rdata->msg_info.via; 1346 if (via->rport_param < 1) { 1347 /* Remote doesn't support rport */ 1348 rport = via->sent_by.port; 1349 if (rport==0) { 1350 pjsip_transport_type_e tp_type; 1351 tp_type = (pjsip_transport_type_e) tp->key.type; 1352 rport = pjsip_transport_get_default_port_for_type(tp_type); 1353 } 1354 } else 1355 rport = via->rport_param; 1356 1357 if (via->recvd_param.slen != 0) 1358 via_addr = &via->recvd_param; 1359 else 1360 via_addr = &via->sent_by.host; 1361 1362 /* If allow_via_rewrite is enabled, we save the Via "received" address 1345 1363 * from the response. 1346 1364 */ … … 1348 1366 (acc->via_addr.host.slen == 0 || acc->via_tp != tp)) 1349 1367 { 1350 via = param->rdata->msg_info.via; 1351 if (pj_strcmp(&acc->via_addr.host, &via->sent_by.host)) 1352 pj_strdup(acc->pool, &acc->via_addr.host, &via->sent_by.host); 1353 acc->via_addr.port = via->sent_by.port; 1368 if (pj_strcmp(&acc->via_addr.host, via_addr)) 1369 pj_strdup(acc->pool, &acc->via_addr.host, via_addr); 1370 acc->via_addr.port = rport; 1354 1371 acc->via_tp = tp; 1355 1372 pjsip_regc_set_via_sent_by(acc->regc, &acc->via_addr, acc->via_tp); … … 1389 1406 } 1390 1407 #endif 1391 1392 /* Get the received and rport info */1393 via = param->rdata->msg_info.via;1394 if (via->rport_param < 1) {1395 /* Remote doesn't support rport */1396 rport = via->sent_by.port;1397 if (rport==0) {1398 pjsip_transport_type_e tp_type;1399 tp_type = (pjsip_transport_type_e) tp->key.type;1400 rport = pjsip_transport_get_default_port_for_type(tp_type);1401 }1402 } else1403 rport = via->rport_param;1404 1405 if (via->recvd_param.slen != 0)1406 via_addr = &via->recvd_param;1407 else1408 via_addr = &via->sent_by.host;1409 1408 1410 1409 /* Compare received and rport with the URI in our registration */ … … 1554 1553 1555 1554 /* Always update, by http://trac.pjsip.org/repos/ticket/864. */ 1555 /* Since the Via address will now be overwritten to the correct 1556 * address by https://trac.pjsip.org/repos/ticket/1537, we do 1557 * not need to update the transport address. 1558 */ 1559 /* 1556 1560 pj_strdup_with_null(tp->pool, &tp->local_name.host, via_addr); 1557 1561 tp->local_name.port = rport; 1562 */ 1558 1563 1559 1564 }
Note: See TracChangeset
for help on using the changeset viewer.