Changeset 203
- Timestamp:
- 12/27/07 17:30:44
(8 months ago)
- Author:
- sip
- Message:
"h324m debug level" cmd implemented.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r200 |
r203 |
|
| 38 | 38 | #include <asterisk/causes.h> |
|---|
| 39 | 39 | #include <asterisk/time.h> |
|---|
| | 40 | #include "asterisk/cli.h" |
|---|
| 40 | 41 | |
|---|
| 41 | 42 | #ifndef AST_FORMAT_AMRNB |
|---|
| … | … | |
| 114 | 115 | "audio and video). To use this function with H324M calls you first have to use\n" |
|---|
| 115 | 116 | "the h324m_gw() function.\n"; |
|---|
| | 117 | |
|---|
| | 118 | /* Commands */ |
|---|
| | 119 | static int h324m_do_debug(int fd, int argc, char *argv[]) |
|---|
| | 120 | { |
|---|
| | 121 | int level; |
|---|
| | 122 | |
|---|
| | 123 | /* Check number of arguments */ |
|---|
| | 124 | if (argc != 4) |
|---|
| | 125 | return RESULT_SHOWUSAGE; |
|---|
| | 126 | |
|---|
| | 127 | /* Get level */ |
|---|
| | 128 | level = atoi(argv[3]); |
|---|
| | 129 | |
|---|
| | 130 | /* Check it's correct */ |
|---|
| | 131 | if((level < 0) || (level > 9)) |
|---|
| | 132 | return RESULT_SHOWUSAGE; |
|---|
| | 133 | |
|---|
| | 134 | /* Print result */ |
|---|
| | 135 | if(level) |
|---|
| | 136 | ast_cli(fd, "app_h324m Debugging enabled level: %d\n", level); |
|---|
| | 137 | else |
|---|
| | 138 | ast_cli(fd, "app_h324m Debugging disabled\n"); |
|---|
| | 139 | |
|---|
| | 140 | /* Set log level */ |
|---|
| | 141 | H324MLoggerSetLevel(level); |
|---|
| | 142 | |
|---|
| | 143 | /* Exit */ |
|---|
| | 144 | return RESULT_SUCCESS; |
|---|
| | 145 | } |
|---|
| | 146 | |
|---|
| | 147 | static char debug_usage[] = |
|---|
| | 148 | "Usage: h324m debug level {0-9}\n" |
|---|
| | 149 | " Enables debug messages in app_h324m\n" |
|---|
| | 150 | " 0 - No debug\n" |
|---|
| | 151 | " 1 - Error messages\n" |
|---|
| | 152 | " 2 - Log messages\n" |
|---|
| | 153 | " 3 - Warning messages\n" |
|---|
| | 154 | " 4 - Debug messages\n" |
|---|
| | 155 | " 5 - File dumps\n"; |
|---|
| | 156 | |
|---|
| | 157 | |
|---|
| | 158 | static struct ast_cli_entry cli_debug = |
|---|
| | 159 | { { "h324m", "debug", "level" }, h324m_do_debug, |
|---|
| | 160 | "Set app_h324m debug log level", debug_usage }; |
|---|
| | 161 | |
|---|
| 116 | 162 | |
|---|
| 117 | 163 | static short blockSize[16] = { 13, 14, 16, 18, 19, 21, 26, 31, 6, -1, -1, -1, -1, -1, -1, -1}; |
|---|
| … | … | |
| 1297 | 1343 | res &= ast_register_application(name_h324m_gw_answer, app_h324m_gw_answer, syn_h324m_gw_answer, des_h324m_gw_answer); |
|---|
| 1298 | 1344 | res &= ast_register_application(name_video_loopback, app_video_loopback, syn_video_loopback, des_video_loopback); |
|---|
| | 1345 | |
|---|
| | 1346 | ast_cli_register(&cli_debug); |
|---|
| | 1347 | |
|---|
| | 1348 | /* No loging by default */ |
|---|
| | 1349 | H324MLoggerSetLevel(1); |
|---|
| | 1350 | |
|---|
| 1299 | 1351 | return 0; |
|---|
| 1300 | 1352 | } |
|---|
Download in other formats:
|
|