windows build.

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@270 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Michael Jerris 2007-06-17 19:40:35 +00:00
parent 18d09620fe
commit 1795451255
4 changed files with 22 additions and 22 deletions

View File

@ -482,7 +482,7 @@ void zap_global_set_logger(zap_logger_t logger);
void zap_global_set_default_logger(int level); void zap_global_set_default_logger(int level);
uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen); uint32_t zap_separate_string(char *buf, char delim, char **array, int arraylen);
void print_bits(uint8_t *b, int bl, char *buf, int blen, int e, uint8_t ss); void print_bits(uint8_t *b, int bl, char *buf, int blen, int e, uint8_t ss);
void print_hex_bytes(uint8_t *data, zap_size_t dlen, uint8_t *buf, zap_size_t blen); void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen);
ZIO_CODEC_FUNCTION(zio_slin2ulaw); ZIO_CODEC_FUNCTION(zio_slin2ulaw);
ZIO_CODEC_FUNCTION(zio_ulaw2slin); ZIO_CODEC_FUNCTION(zio_ulaw2slin);
ZIO_CODEC_FUNCTION(zio_slin2alaw); ZIO_CODEC_FUNCTION(zio_slin2alaw);

View File

@ -126,11 +126,11 @@ void teletone_goertzel_update(teletone_goertzel_state_t *goertzel_state,
for (i = 0; i < samples; i++) { for (i = 0; i < samples; i++) {
v1 = goertzel_state->v2; v1 = goertzel_state->v2;
goertzel_state->v2 = goertzel_state->v3; goertzel_state->v2 = goertzel_state->v3;
goertzel_state->v3 = goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i]; goertzel_state->v3 = (float)(goertzel_state->fac*goertzel_state->v2 - v1 + sample_buffer[i]);
} }
} }
#define teletone_goertzel_result(gs) ((gs)->v3 * (gs)->v3 + (gs)->v2 * (gs)->v2 - (gs)->v2 * (gs)->v3 * (gs)->fac) #define teletone_goertzel_result(gs) (float)(((gs)->v3 * (gs)->v3 + (gs)->v2 * (gs)->v2 - (gs)->v2 * (gs)->v3 * (gs)->fac))
void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate) void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state, int sample_rate)
{ {
@ -140,17 +140,17 @@ void teletone_dtmf_detect_init (teletone_dtmf_detect_state_t *dtmf_detect_state,
dtmf_detect_state->hit1 = dtmf_detect_state->hit2 = 0; dtmf_detect_state->hit1 = dtmf_detect_state->hit2 = 0;
for (i = 0; i < GRID_FACTOR; i++) { for (i = 0; i < GRID_FACTOR; i++) {
theta = M_TWO_PI*(dtmf_row[i]/(float)sample_rate); theta = (float)(M_TWO_PI*(dtmf_row[i]/(float)sample_rate));
dtmf_detect_row[i].fac = 2.0*cos(theta); dtmf_detect_row[i].fac = (float)(2.0*cos(theta));
theta = M_TWO_PI*(dtmf_col[i]/(float)sample_rate); theta = (float)(M_TWO_PI*(dtmf_col[i]/(float)sample_rate));
dtmf_detect_col[i].fac = 2.0*cos(theta); dtmf_detect_col[i].fac = (float)(2.0*cos(theta));
theta = M_TWO_PI*(dtmf_row[i]*2.0/(float)sample_rate); theta = (float)(M_TWO_PI*(dtmf_row[i]*2.0/(float)sample_rate));
dtmf_detect_row_2nd[i].fac = 2.0*cos(theta); dtmf_detect_row_2nd[i].fac = (float)(2.0*cos(theta));
theta = M_TWO_PI*(dtmf_col[i]*2.0/(float)sample_rate); theta = (float)(M_TWO_PI*(dtmf_col[i]*2.0/(float)sample_rate));
dtmf_detect_col_2nd[i].fac = 2.0*cos(theta); dtmf_detect_col_2nd[i].fac = (float)(2.0*cos(theta));
goertzel_init (&dtmf_detect_state->row_out[i], &dtmf_detect_row[i]); goertzel_init (&dtmf_detect_state->row_out[i], &dtmf_detect_row[i]);
goertzel_init (&dtmf_detect_state->col_out[i], &dtmf_detect_col[i]); goertzel_init (&dtmf_detect_state->col_out[i], &dtmf_detect_col[i]);
@ -196,8 +196,8 @@ void teletone_multi_tone_init(teletone_multi_tone_t *mt, teletone_tone_map_t *ma
break; break;
} }
mt->tone_count++; mt->tone_count++;
theta = M_TWO_PI*(map->freqs[x]/(float)mt->sample_rate); theta = (float)(M_TWO_PI*(map->freqs[x]/(float)mt->sample_rate));
mt->tdd[x].fac = 2.0 * cos(theta); mt->tdd[x].fac = (float)(2.0 * cos(theta));
goertzel_init (&mt->gs[x], &mt->tdd[x]); goertzel_init (&mt->gs[x], &mt->tdd[x]);
goertzel_init (&mt->gs2[x], &mt->tdd[x]); goertzel_init (&mt->gs2[x], &mt->tdd[x]);
} }
@ -230,11 +230,11 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
for(x = 0; x < mt->tone_count; x++) { for(x = 0; x < mt->tone_count; x++) {
v1 = mt->gs[x].v2; v1 = mt->gs[x].v2;
mt->gs[x].v2 = mt->gs[x].v3; mt->gs[x].v2 = mt->gs[x].v3;
mt->gs[x].v3 = mt->gs[x].fac * mt->gs[x].v2 - v1 + famp; mt->gs[x].v3 = (float)(mt->gs[x].fac * mt->gs[x].v2 - v1 + famp);
v1 = mt->gs2[x].v2; v1 = mt->gs2[x].v2;
mt->gs2[x].v2 = mt->gs2[x].v3; mt->gs2[x].v2 = mt->gs2[x].v3;
mt->gs2[x].v3 = mt->gs2[x].fac*mt->gs2[x].v2 - v1 + famp; mt->gs2[x].v3 = (float)(mt->gs2[x].fac*mt->gs2[x].v2 - v1 + famp);
} }
} }
@ -245,7 +245,7 @@ int teletone_multi_tone_detect (teletone_multi_tone_t *mt,
eng_sum = 0; eng_sum = 0;
for(x = 0; x < mt->tone_count; x++) { for(x = 0; x < mt->tone_count; x++) {
eng_all[x] = teletone_goertzel_result (&mt->gs[x]); eng_all[x] = (float)(teletone_goertzel_result (&mt->gs[x]));
eng_sum += eng_all[x]; eng_sum += eng_all[x];
} }
@ -325,19 +325,19 @@ int teletone_dtmf_detect (teletone_dtmf_detect_state_t *dtmf_detect_state,
for(x = 0; x < GRID_FACTOR; x++) { for(x = 0; x < GRID_FACTOR; x++) {
v1 = dtmf_detect_state->row_out[x].v2; v1 = dtmf_detect_state->row_out[x].v2;
dtmf_detect_state->row_out[x].v2 = dtmf_detect_state->row_out[x].v3; dtmf_detect_state->row_out[x].v2 = dtmf_detect_state->row_out[x].v3;
dtmf_detect_state->row_out[x].v3 = dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp; dtmf_detect_state->row_out[x].v3 = (float)(dtmf_detect_state->row_out[x].fac*dtmf_detect_state->row_out[x].v2 - v1 + famp);
v1 = dtmf_detect_state->col_out[x].v2; v1 = dtmf_detect_state->col_out[x].v2;
dtmf_detect_state->col_out[x].v2 = dtmf_detect_state->col_out[x].v3; dtmf_detect_state->col_out[x].v2 = dtmf_detect_state->col_out[x].v3;
dtmf_detect_state->col_out[x].v3 = dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp; dtmf_detect_state->col_out[x].v3 = (float)(dtmf_detect_state->col_out[x].fac*dtmf_detect_state->col_out[x].v2 - v1 + famp);
v1 = dtmf_detect_state->col_out2nd[x].v2; v1 = dtmf_detect_state->col_out2nd[x].v2;
dtmf_detect_state->col_out2nd[x].v2 = dtmf_detect_state->col_out2nd[x].v3; dtmf_detect_state->col_out2nd[x].v2 = dtmf_detect_state->col_out2nd[x].v3;
dtmf_detect_state->col_out2nd[x].v3 = dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp; dtmf_detect_state->col_out2nd[x].v3 = (float)(dtmf_detect_state->col_out2nd[x].fac*dtmf_detect_state->col_out2nd[x].v2 - v1 + famp);
v1 = dtmf_detect_state->row_out2nd[x].v2; v1 = dtmf_detect_state->row_out2nd[x].v2;
dtmf_detect_state->row_out2nd[x].v2 = dtmf_detect_state->row_out2nd[x].v3; dtmf_detect_state->row_out2nd[x].v2 = dtmf_detect_state->row_out2nd[x].v3;
dtmf_detect_state->row_out2nd[x].v3 = dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp; dtmf_detect_state->row_out2nd[x].v3 = (float)(dtmf_detect_state->row_out2nd[x].fac*dtmf_detect_state->row_out2nd[x].v2 - v1 + famp);
} }
} }

View File

@ -2007,7 +2007,7 @@ int8_t zap_bitstream_get_bit(zap_bitstream_t *bsp)
return bit; return bit;
} }
void print_hex_bytes(uint8_t *data, zap_size_t dlen, uint8_t *buf, zap_size_t blen) void print_hex_bytes(uint8_t *data, zap_size_t dlen, char *buf, zap_size_t blen)
{ {
char *bp = buf; char *bp = buf;
uint8_t *byte = data; uint8_t *byte = data;

View File

@ -344,7 +344,7 @@ static __inline__ void state_advance(zap_channel_t *zchan)
#endif #endif
CalledNum.TypNum = 2; CalledNum.TypNum = 2;
CalledNum.NumPlanID = 1; CalledNum.NumPlanID = 1;
CalledNum.Size += strlen(zchan->caller_data.ani); CalledNum.Size = CalledNum.Size + (unsigned char)strlen(zchan->caller_data.ani);
gen->CalledNum = Q931AppendIE((L3UCHAR *) gen, (L3UCHAR *) &CalledNum); gen->CalledNum = Q931AppendIE((L3UCHAR *) gen, (L3UCHAR *) &CalledNum);
ptrCalledNum = Q931GetIEPtr(gen->CalledNum, gen->buf); ptrCalledNum = Q931GetIEPtr(gen->CalledNum, gen->buf);
zap_copy_string((char *)ptrCalledNum->Digit, zchan->caller_data.ani, strlen(zchan->caller_data.ani)+1); zap_copy_string((char *)ptrCalledNum->Digit, zchan->caller_data.ani, strlen(zchan->caller_data.ani)+1);