Changeset 1098 for pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
- Timestamp:
- Mar 23, 2007 4:34:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r974 r1098 903 903 pj_str_t outbound_proxy[4]; 904 904 905 /** 906 * Specify STUN server. This server will be first resolved with DNS SRV 907 * to get the actual server address. If DNS SRV resolution failed, or 908 * when nameserver is not configured, the server will be resolved using 909 * DNS A resolution (i.e. gethostbyname()). 910 */ 911 pj_str_t stun_srv; 912 905 913 /** 906 914 * Number of credentials in the credential array. … … 1002 1010 1003 1011 pj_strdup_with_null(pool, &dst->user_agent, &src->user_agent); 1012 pj_strdup_with_null(pool, &dst->stun_srv, &src->stun_srv); 1004 1013 } 1005 1014 … … 1335 1344 1336 1345 /** 1337 * This structure describes STUN configuration for SIP and media transport,1338 * and is embedded inside pjsua_transport_config structure.1339 */1340 typedef struct pjsua_stun_config1341 {1342 /**1343 * The first STUN server IP address or hostname.1344 */1345 pj_str_t stun_srv1;1346 1347 /**1348 * Port number of the first STUN server.1349 * If zero, default STUN port will be used.1350 */1351 unsigned stun_port1;1352 1353 /**1354 * Optional second STUN server IP address or hostname, for which the1355 * result of the mapping request will be compared to. If the value1356 * is empty, only one STUN server will be used.1357 */1358 pj_str_t stun_srv2;1359 1360 /**1361 * Port number of the second STUN server.1362 * If zero, default STUN port will be used.1363 */1364 unsigned stun_port2;1365 1366 } pjsua_stun_config;1367 1368 1369 1370 /**1371 * Call this function to initialize STUN config with default values.1372 * STUN config is normally embedded inside pjsua_transport_config, so1373 * normally there is no need to call this function and rather just1374 * call pjsua_transport_config_default() instead.1375 *1376 * @param cfg The STUN config to be initialized.1377 *1378 * \par Python:1379 * The corresponding Python function creates and initialize the config:1380 * \code1381 stun_cfg = py_pjsua.stun_config_default()1382 * \endcode1383 */1384 PJ_INLINE(void) pjsua_stun_config_default(pjsua_stun_config *cfg)1385 {1386 pj_bzero(cfg, sizeof(*cfg));1387 }1388 1389 1390 /**1391 1346 * Transport configuration for creating transports for both SIP 1392 1347 * and media. Before setting some values to this structure, application … … 1436 1391 1437 1392 /** 1438 * Flag to indicate whether STUN should be used.1439 */1440 pj_bool_t use_stun;1441 1442 /**1443 * STUN configuration, must be specified when STUN is used.1444 */1445 pjsua_stun_config stun_config;1446 1447 /**1448 1393 * This specifies TLS settings for TLS transport. It is only be used 1449 1394 * when this transport config is being used to create a SIP TLS … … 1469 1414 { 1470 1415 pj_bzero(cfg, sizeof(*cfg)); 1471 pjsua_stun_config_default(&cfg->stun_config);1472 1416 pjsip_tls_setting_default(&cfg->tls_setting); 1473 }1474 1475 1476 /**1477 * This is a utility function to normalize STUN config. It's only1478 * used internally by the library.1479 *1480 * @param cfg The STUN config to be initialized.1481 *1482 * \par Python:1483 * \code1484 py_pjsua.normalize_stun_config(cfg)1485 * \code1486 */1487 PJ_INLINE(void) pjsua_normalize_stun_config( pjsua_stun_config *cfg )1488 {1489 if (cfg->stun_srv1.slen) {1490 1491 if (cfg->stun_port1 == 0)1492 cfg->stun_port1 = 3478;1493 1494 if (cfg->stun_srv2.slen == 0) {1495 cfg->stun_srv2 = cfg->stun_srv1;1496 cfg->stun_port2 = cfg->stun_port1;1497 } else {1498 if (cfg->stun_port2 == 0)1499 cfg->stun_port2 = 3478;1500 }1501 1502 } else {1503 cfg->stun_port1 = 0;1504 cfg->stun_srv2.slen = 0;1505 cfg->stun_port2 = 0;1506 }1507 1417 } 1508 1418 … … 1523 1433 const pjsua_transport_config *src) 1524 1434 { 1435 PJ_UNUSED_ARG(pool); 1525 1436 pj_memcpy(dst, src, sizeof(*src)); 1526 1527 if (src->stun_config.stun_srv1.slen) {1528 pj_strdup_with_null(pool, &dst->stun_config.stun_srv1,1529 &src->stun_config.stun_srv1);1530 }1531 1532 if (src->stun_config.stun_srv2.slen) {1533 pj_strdup_with_null(pool, &dst->stun_config.stun_srv2,1534 &src->stun_config.stun_srv2);1535 }1536 1537 pjsua_normalize_stun_config(&dst->stun_config);1538 1437 } 1539 1438 … … 3531 3430 int jb_max; 3532 3431 3432 /** 3433 * Enable ICE 3434 */ 3435 pj_bool_t enable_ice; 3436 3437 /** 3438 * Enable ICE media relay. 3439 */ 3440 pj_bool_t enable_relay; 3533 3441 }; 3534 3442
Note: See TracChangeset
for help on using the changeset viewer.