diff -ur orig/asterisk-1.0.7/asterisk.c asterisk-1.0.7/asterisk.c --- orig/asterisk-1.0.7/asterisk.c 2005-01-15 14:58:41.000000000 -0500 +++ asterisk-1.0.7/asterisk.c 2005-10-02 11:47:35.000000000 -0400 @@ -1832,6 +1832,10 @@ exit(1); } ast_rtp_init(); + if (init_indications()) { + printf(term_quit()); + exit(1); + } if (ast_image_init()) { printf(term_quit()); exit(1); Only in asterisk-1.0.7: asterisk.c~ diff -ur orig/asterisk-1.0.7/asterisk.h asterisk-1.0.7/asterisk.h --- orig/asterisk-1.0.7/asterisk.h 2004-09-07 11:02:53.000000000 -0400 +++ asterisk-1.0.7/asterisk.h 2005-10-02 11:48:20.000000000 -0400 @@ -44,6 +44,8 @@ extern void close_logger(void); /* Provided by frame.c */ extern int init_framer(void); +/* Provided by indications.c */ +extern int init_indications(void); /* Provided by logger.c */ extern int reload_logger(int); /* Provided by term.c */ Only in asterisk-1.0.7: asterisk.h~ diff -ur orig/asterisk-1.0.7/indications.c asterisk-1.0.7/indications.c --- orig/asterisk-1.0.7/indications.c 2005-02-18 19:41:21.000000000 -0500 +++ asterisk-1.0.7/indications.c 2005-10-02 14:23:09.000000000 -0400 @@ -55,6 +55,19 @@ short data[4000]; }; +#define SINE_TABLE_SIZE 8000 +#define SINE_TABLE_BITS ((sizeof(short) * 8)-1) +#define SINE_TABLE_MAX ((1 << (SINE_TABLE_BITS-1))-1) +static short sine_table[SINE_TABLE_SIZE]; + +static void fill_sine_table(void) +{ + unsigned i; + float dx = 2*M_PI/SINE_TABLE_SIZE; + for (i=0;imodulate) /* Modulate 1st tone with 2nd, to 90% modulation depth */ - ps->data[x] = ps->vol * 2 * ( - sin((pi->freq1 * 2.0 * M_PI / 8000.0) * (ps->pos + x)) * - (0.9 * fabs(sin((pi->freq2 * 2.0 * M_PI / 8000.0) * (ps->pos + x))) + 0.1) - ); + ps->data[x] = ((long) (ps->vol*2) * ( + sine_table[((pi->freq1) * (ps->pos + x)) % SINE_TABLE_SIZE] * + ((long) 9*abs(sine_table[((pi->freq2) * (ps->pos + x)) % SINE_TABLE_SIZE])/10 + SINE_TABLE_MAX/10) + ))>>SINE_TABLE_BITS; else /* Add 2 tones together */ - ps->data[x] = ps->vol * ( - sin((pi->freq1 * 2.0 * M_PI / 8000.0) * (ps->pos + x)) + - sin((pi->freq2 * 2.0 * M_PI / 8000.0) * (ps->pos + x)) - ); + ps->data[x] = ((long) ps->vol * ( + (long) sine_table[(pi->freq1 * (ps->pos + x)) % SINE_TABLE_SIZE] + + sine_table[(pi->freq2 * (ps->pos + x)) % SINE_TABLE_SIZE] + ))>>SINE_TABLE_BITS; } ps->f.frametype = AST_FRAME_VOICE; ps->f.subclass = AST_FORMAT_SLINEAR; @@ -501,3 +514,9 @@ ast_mutex_unlock(&tzlock); return res; } + +int init_indications(void) +{ + fill_sine_table(); + return 0; +} Only in asterisk-1.0.7: indications.c~