Changeset 2152 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Jul 17, 2008 2:54:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2130 r2152 128 128 static pj_str_t uri_arg; 129 129 130 static char some_buf[ 2048];130 static char some_buf[1024 * 3]; 131 131 132 132 #ifdef STEREO_DEMO … … 1763 1763 } 1764 1764 1765 /* 1766 * Print log of call states. Since call states may be too long for logger, 1767 * printing it is a bit tricky, it should be printed part by part as long 1768 * as the logger can accept. 1769 */ 1770 static void log_call_dump(int call_id) { 1771 unsigned call_dump_len; 1772 unsigned part_len; 1773 unsigned part_idx; 1774 unsigned log_decor; 1775 1776 pjsua_call_dump(call_id, PJ_TRUE, some_buf, 1777 sizeof(some_buf), " "); 1778 call_dump_len = strlen(some_buf); 1779 1780 log_decor = pj_log_get_decor(); 1781 pj_log_set_decor(log_decor & ~(PJ_LOG_HAS_NEWLINE | PJ_LOG_HAS_CR)); 1782 PJ_LOG(3,(THIS_FILE, "\n")); 1783 pj_log_set_decor(0); 1784 1785 part_idx = 0; 1786 part_len = PJ_LOG_MAX_SIZE-80; 1787 while (part_idx < call_dump_len) { 1788 char p_orig, *p; 1789 1790 p = &some_buf[part_idx]; 1791 if (part_idx + part_len > call_dump_len) 1792 part_len = call_dump_len - part_idx; 1793 p_orig = p[part_len]; 1794 p[part_len] = '\0'; 1795 PJ_LOG(3,(THIS_FILE, "%s", p)); 1796 p[part_len] = p_orig; 1797 part_idx += part_len; 1798 } 1799 pj_log_set_decor(log_decor); 1800 } 1765 1801 1766 1802 /***************************************************************************** … … 1963 1999 /* Dump media state upon disconnected */ 1964 2000 if (1) { 1965 pjsua_call_dump(call_id, PJ_TRUE, some_buf,1966 sizeof(some_buf), " ");1967 2001 PJ_LOG(5,(THIS_FILE, 1968 "Call %d disconnected, dumping media stats\n%s", 1969 call_id, some_buf)); 2002 "Call %d disconnected, dumping media stats..", 2003 call_id)); 2004 log_call_dump(call_id); 1970 2005 } 1971 2006 … … 3720 3755 3721 3756 if (current_call != PJSUA_INVALID_ID) { 3722 pjsua_call_dump(current_call, PJ_TRUE, some_buf, 3723 sizeof(some_buf), " "); 3724 PJ_LOG(3,(THIS_FILE, "\n%s", some_buf)); 3757 log_call_dump(current_call); 3725 3758 } else { 3726 3759 PJ_LOG(3,(THIS_FILE, "No current call"));
Note: See TracChangeset
for help on using the changeset viewer.