- Timestamp:
- Apr 2, 2007 8:43:06 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r1127 r1135 1318 1318 static void app_dump(pj_bool_t detail) 1319 1319 { 1320 unsigned old_decor; 1321 char buf[1024]; 1322 1323 PJ_LOG(3,(THIS_FILE, "Start dumping application states:")); 1324 1325 old_decor = pj_log_get_decor(); 1326 pj_log_set_decor(old_decor & (PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR)); 1327 1328 if (detail) 1329 pj_dump_config(); 1330 1331 pjsip_endpt_dump(pjsua_get_pjsip_endpt(), detail); 1332 pjmedia_endpt_dump(pjsua_get_pjmedia_endpt()); 1333 pjsip_tsx_layer_dump(detail); 1334 pjsip_ua_dump(detail); 1335 1336 1337 /* Dump all invite sessions: */ 1338 PJ_LOG(3,(THIS_FILE, "Dumping invite sessions:")); 1339 1340 if (pjsua_call_get_count() == 0) { 1341 1342 PJ_LOG(3,(THIS_FILE, " - no sessions -")); 1343 1344 } else { 1345 unsigned i; 1346 1347 for (i=0; i<app_config.cfg.max_calls; ++i) { 1348 if (pjsua_call_is_active(i)) { 1349 pjsua_call_dump(i, detail, buf, sizeof(buf), " "); 1350 PJ_LOG(3,(THIS_FILE, "%s", buf)); 1351 } 1352 } 1353 } 1354 1355 /* Dump presence status */ 1356 pjsua_pres_dump(detail); 1357 1358 pj_log_set_decor(old_decor); 1359 PJ_LOG(3,(THIS_FILE, "Dump complete")); 1320 pjsua_dump(detail); 1360 1321 } 1361 1322 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r1127 r1135 1328 1328 1329 1329 1330 1330 /** 1331 * This is a utility function to dump the stack states to log, using 1332 * verbosity level 3. 1333 * 1334 * @param detail Will print detailed output (such as list of 1335 * SIP transactions) when non-zero. 1336 */ 1337 PJ_DECL(void) pjsua_dump(pj_bool_t detail); 1331 1338 1332 1339 /** -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r1134 r1135 744 744 if (pjsua_var.ua_cfg.stun_domain.slen) { 745 745 pj_str_t res_type; 746 pj_status_t status; 746 747 747 748 /* Fail if resolver is not configured */ … … 753 754 } 754 755 res_type = pj_str("_stun._udp"); 755 pjsua_var.stun_status =756 status = 756 757 pj_dns_srv_resolve(&pjsua_var.ua_cfg.stun_domain, &res_type, 757 758 3478, pjsua_var.pool, pjsua_var.resolver, 758 0, NULL, stun_dns_srv_resolver_cb);759 if ( pjsua_var.stun_status != PJ_SUCCESS) {759 0, NULL, &stun_dns_srv_resolver_cb); 760 if (status != PJ_SUCCESS) { 760 761 pjsua_perror(THIS_FILE, "Error starting DNS SRV resolution", 761 762 pjsua_var.stun_status); 763 pjsua_var.stun_status = status; 762 764 return pjsua_var.stun_status; 765 } else { 766 pjsua_var.stun_status = PJ_EPENDING; 763 767 } 764 768 } … … 1691 1695 return p ? 0 : -1; 1692 1696 } 1697 1698 1699 /* 1700 * This is a utility function to dump the stack states to log, using 1701 * verbosity level 3. 1702 */ 1703 PJ_DEF(void) pjsua_dump(pj_bool_t detail) 1704 { 1705 unsigned old_decor; 1706 unsigned i; 1707 char buf[1024]; 1708 1709 PJ_LOG(3,(THIS_FILE, "Start dumping application states:")); 1710 1711 old_decor = pj_log_get_decor(); 1712 pj_log_set_decor(old_decor & (PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR)); 1713 1714 if (detail) 1715 pj_dump_config(); 1716 1717 pjsip_endpt_dump(pjsua_get_pjsip_endpt(), detail); 1718 1719 pjmedia_endpt_dump(pjsua_get_pjmedia_endpt()); 1720 1721 PJ_LOG(3,(THIS_FILE, "Dumping media transports:")); 1722 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 1723 pjsua_call *call = &pjsua_var.calls[i]; 1724 pjmedia_sock_info skinfo; 1725 1726 pjmedia_transport_get_info(call->med_tp, &skinfo); 1727 1728 PJ_LOG(3,(THIS_FILE, " %s: %s:%d", 1729 (pjsua_var.media_cfg.enable_ice ? "ICE" : "UDP"), 1730 pj_inet_ntoa(skinfo.rtp_addr_name.sin_addr), 1731 (int)pj_ntohs(skinfo.rtp_addr_name.sin_port))); 1732 } 1733 1734 pjsip_tsx_layer_dump(detail); 1735 pjsip_ua_dump(detail); 1736 1737 1738 /* Dump all invite sessions: */ 1739 PJ_LOG(3,(THIS_FILE, "Dumping invite sessions:")); 1740 1741 if (pjsua_call_get_count() == 0) { 1742 1743 PJ_LOG(3,(THIS_FILE, " - no sessions -")); 1744 1745 } else { 1746 unsigned i; 1747 1748 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 1749 if (pjsua_call_is_active(i)) { 1750 pjsua_call_dump(i, detail, buf, sizeof(buf), " "); 1751 PJ_LOG(3,(THIS_FILE, "%s", buf)); 1752 } 1753 } 1754 } 1755 1756 /* Dump presence status */ 1757 pjsua_pres_dump(detail); 1758 1759 pj_log_set_decor(old_decor); 1760 PJ_LOG(3,(THIS_FILE, "Dump complete")); 1761 } 1762 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1134 r1135 557 557 pj_sockaddr_in addr; 558 558 pj_status_t status; 559 560 /* Make sure STUN server resolution has completed */ 561 status = pjsua_resolve_stun_server(PJ_TRUE); 562 if (status != PJ_SUCCESS) { 563 pjsua_perror(THIS_FILE, "Error resolving STUN server", status); 564 return status; 565 } 559 566 560 567 pj_sockaddr_in_init(&addr, 0, (pj_uint16_t)cfg->port);
Note: See TracChangeset
for help on using the changeset viewer.