Changeset 894 for pjproject/trunk
- Timestamp:
- Jan 21, 2007 7:36:00 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r893 r894 1844 1844 puts("| S Send arbitrary REQUEST | V Adjust audio Volume | f Save config |"); 1845 1845 puts("+------------------------------+--------------------------+-------------------+"); 1846 puts("| q QUIT 1846 puts("| q QUIT sleep N: console sleep for N ms |"); 1847 1847 puts("+=============================================================================+"); 1848 1848 … … 2072 2072 fflush(stdout); 2073 2073 2074 fgets(menuin, sizeof(menuin), stdin); 2074 if (fgets(menuin, sizeof(menuin), stdin) == NULL) { 2075 /* 2076 * Be friendly to users who redirect commands into 2077 * program, when file ends, resume with kbd. 2078 * If exit is desired end script with q for quit 2079 */ 2080 /* Reopen stdin/stdout/stderr to /dev/console */ 2081 #if defined(PJ_WIN32) && PJ_WIN32!=0 2082 if (freopen ("CONIN$", "r", stdin) == NULL) { 2083 #else 2084 if (1) { 2085 #endif 2086 puts("Cannot switch back to console from file redirection"); 2087 menuin[0] = 'q'; 2088 menuin[1] = '\0'; 2089 } else { 2090 puts("Switched back to console from file redirection"); 2091 continue; 2092 } 2093 } 2075 2094 2076 2095 switch (menuin[0]) { … … 2618 2637 2619 2638 case 's': 2639 if (pj_ansi_strnicmp(menuin, "sleep", 5)==0) { 2640 pj_str_t tmp; 2641 int delay; 2642 2643 tmp.ptr = menuin+6; 2644 tmp.slen = pj_ansi_strlen(menuin)-7; 2645 2646 if (tmp.slen < 1) { 2647 puts("Usage: sleep MSEC"); 2648 break; 2649 } 2650 2651 delay = pj_strtoul(&tmp); 2652 if (delay < 0) delay = 0; 2653 pj_thread_sleep(delay); 2654 break; 2655 } 2656 /* Continue below */ 2657 2620 2658 case 'u': 2621 2659 /*
Note: See TracChangeset
for help on using the changeset viewer.