? doc/api Index: channels/chan_iax2.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v retrieving revision 1.88 diff -u -r1.88 chan_iax2.c --- channels/chan_iax2.c 12 Jan 2004 18:03:35 -0000 1.88 +++ channels/chan_iax2.c 3 Feb 2004 19:16:34 -0000 @@ -1430,7 +1430,7 @@ /* + ((float)iaxs[fr->callno]->jitter) * 0.1 */; - if (option_debug) + if (iaxdebug) ast_log(LOG_DEBUG, "min = %d, max = %d, jb = %d, lateness = %d\n", min, max, iaxs[fr->callno]->jitterbuffer, ms); /* Subtract the lateness from our jitter buffer to know how long to wait @@ -1451,8 +1451,9 @@ if ((ms > -4) || (fr->af.frametype != AST_FRAME_VOICE)) { __do_deliver(fr); } else { - if (option_debug) - ast_log(LOG_DEBUG, "Dropping voice packet since %d ms is, too old\n", ms); + if (iaxdebug) + ast_log(LOG_NOTICE, "Dropping voice packet " + "since %d ms is too old\n", ms); /* Free our iax frame */ iax2_frame_free(fr); } @@ -2713,7 +2714,23 @@ return RESULT_SUCCESS; } - +static int iax2_do_buffer(int fd, int argc, char *argv[]) +{ + if (argc != 2) + return RESULT_SHOWUSAGE; + use_jitterbuffer = 1; + ast_cli(fd, "IAX2 Jitter Buffer Enabled\n"); + return RESULT_SUCCESS; +} + +static int iax2_no_buffer(int fd, int argc, char *argv[]) +{ + if (argc != 3) + return RESULT_SHOWUSAGE; + use_jitterbuffer = 0; + ast_cli(fd, "IAX2 Jitter Buffer Disabled\n"); + return RESULT_SUCCESS; +} static char show_users_usage[] = "Usage: iax2 show users\n" @@ -2739,6 +2756,14 @@ "Usage: iax2 no debug\n" " Disables dumping of IAX packets for debugging purposes\n"; +static char buffer_usage[] = +"Usage: iax2 buffer\n" +" Enables the IAX jitter buffer\n"; + +static char no_buffer_usage[] = +"Usage: iax2 no buffer\n" +" Disables the IAX jitter buffer\n"; + static char debug_trunk_usage[] = "Usage: iax2 trunk debug\n" " Requests current status of IAX trunking\n"; @@ -2757,6 +2782,11 @@ { { "iax2", "trunk", "debug", NULL }, iax2_do_trunk_debug, "Request IAX trunk debug", debug_trunk_usage }; static struct ast_cli_entry cli_no_debug = { { "iax2", "no", "debug", NULL }, iax2_no_debug, "Disable IAX debugging", no_debug_usage }; +static struct ast_cli_entry cli_buffer = + { { "iax2", "buffer", NULL }, iax2_do_buffer, "Enable IAX jitter buffer", buffer_usage }; +static struct ast_cli_entry cli_no_buffer = + { { "iax2", "no", "buffer", NULL }, iax2_no_buffer, "Disable IAX jitter buffer", no_buffer_usage }; + static int iax2_write(struct ast_channel *c, struct ast_frame *f) { @@ -6049,6 +6079,8 @@ ast_cli_unregister(&cli_debug); ast_cli_unregister(&cli_trunk_debug); ast_cli_unregister(&cli_no_debug); + ast_cli_unregister(&cli_buffer); + ast_cli_unregister(&cli_no_buffer); ast_cli_unregister(&cli_set_jitter); ast_cli_unregister(&cli_show_stats); ast_cli_unregister(&cli_show_cache); @@ -6115,6 +6147,8 @@ ast_cli_register(&cli_debug); ast_cli_register(&cli_trunk_debug); ast_cli_register(&cli_no_debug); + ast_cli_register(&cli_buffer); + ast_cli_register(&cli_no_buffer); ast_cli_register(&cli_set_jitter); ast_cli_register(&cli_show_stats); ast_cli_register(&cli_show_cache);