From c1e51752909124eed7a2dc4342b5ff1955351b2b Mon Sep 17 00:00:00 2001 From: Steve Underwood Date: Wed, 24 Jul 2013 00:21:23 +0800 Subject: [PATCH] Tweaks to spandsp --- libs/spandsp/src/t30.c | 115 ++-- libs/spandsp/src/t4_rx.c | 24 +- libs/spandsp/src/t4_tx.c | 184 +++-- libs/spandsp/tests/v18_tests.c | 1159 ++++++++++++++++++++++---------- 4 files changed, 1014 insertions(+), 468 deletions(-) diff --git a/libs/spandsp/src/t30.c b/libs/spandsp/src/t30.c index 9dd571fe5d..c93636a265 100644 --- a/libs/spandsp/src/t30.c +++ b/libs/spandsp/src/t30.c @@ -435,7 +435,6 @@ static void decode_20digit_msg(t30_state_t *s, char *msg, const uint8_t *pkt, in static void decode_url_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int len); static int decode_nsf_nss_nsc(t30_state_t *s, uint8_t *msg[], const uint8_t *pkt, int len); static void set_min_scan_time(t30_state_t *s); -static int send_cfr_sequence(t30_state_t *s, int start); static void timer_t2_start(t30_state_t *s); static void timer_t2a_start(t30_state_t *s); static void timer_t2b_start(t30_state_t *s); @@ -1217,24 +1216,6 @@ int t30_build_dis_or_dtc(t30_state_t *s) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T85_L0_CAPABLE); } - if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_COLOUR)) - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_FULL_COLOUR_CAPABLE); - - if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T42_T81)) - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); - if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T43)) - { - /* Note 25 of table 2/T.30 */ - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T43_CAPABLE); - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); - } - if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T45)) - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T45_CAPABLE); - if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_SYCC_T81)) - { - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SYCC_T81_CAPABLE); - } //if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T88)) //{ // set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T88_CAPABILITY_1); @@ -1242,14 +1223,37 @@ int t30_build_dis_or_dtc(t30_state_t *s) // set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T88_CAPABILITY_3); //} - if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_12BIT)) - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_12BIT_CAPABLE); + //if ((s->supported_compressions & (T4_SUPPORT_COMPRESSION_COLOUR | T4_SUPPORT_COMPRESSION_GRAYSCALE))) + { + if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_COLOUR)) + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_FULL_COLOUR_CAPABLE); - //if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_NO_SUBSAMPLING)) - // set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_NO_SUBSAMPLING); + if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T42_T81)) + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); + if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T43)) + { + /* Note 25 of table 2/T.30 */ + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T43_CAPABLE); + /* No plane interleave */ + } + if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_T45)) + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T45_CAPABLE); + if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_SYCC_T81)) + { + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SYCC_T81_CAPABLE); + } - /* No custom illuminant */ - /* No custom gamut range */ + if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_12BIT)) + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_12BIT_CAPABLE); + + //if ((s->supported_compressions & T4_SUPPORT_COMPRESSION_NO_SUBSAMPLING)) + // set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_NO_SUBSAMPLING); + + /* No custom illuminant */ + /* No custom gamut range */ + } } if ((s->supported_t30_features & T30_SUPPORT_FIELD_NOT_VALID)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_FNV_CAPABLE); @@ -1257,12 +1261,6 @@ int t30_build_dis_or_dtc(t30_state_t *s) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_MULTIPLE_SELECTIVE_POLLING_CAPABLE); if ((s->supported_t30_features & T30_SUPPORT_POLLED_SUB_ADDRESSING)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE); - - /* No plane interleave */ - /* No G.726 */ - /* No extended voice coding */ - /* Superfine minimum scan line time pattern follows fine */ - if ((s->supported_t30_features & T30_SUPPORT_SELECTIVE_POLLING)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE); if ((s->supported_t30_features & T30_SUPPORT_SUB_ADDRESSING)) @@ -1270,10 +1268,16 @@ int t30_build_dis_or_dtc(t30_state_t *s) if ((s->supported_t30_features & T30_SUPPORT_IDENTIFICATION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD); + /* No G.726 */ + /* No extended voice coding */ + /* Superfine minimum scan line time pattern follows fine */ + /* Ready to transmit a data file (polling) */ if (s->tx_file[0]) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_READY_TO_TRANSMIT_DATA_FILE); + /* No simple phase C BFT negotiations */ + /* No extended BFT negotiations */ /* No Binary file transfer (BFT) */ /* No Document transfer mode (DTM) */ /* No Electronic data interchange (EDI) */ @@ -1295,11 +1299,9 @@ int t30_build_dis_or_dtc(t30_state_t *s) /* No HFX40-I hashing */ /* No alternative hashing system number 2 */ /* No alternative hashing system number 3 */ - /* No T.44 (mixed raster content) */ + /* No T.44 (mixed raster content) */ /* No page length maximum strip size for T.44 (mixed raster content) */ - /* No simple phase C BFT negotiations */ - /* No extended BFT negotiations */ if ((s->supported_t30_features & T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS); @@ -1353,9 +1355,9 @@ int t30_build_dis_or_dtc(t30_state_t *s) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_COLOUR_GRAY_100_100_CAPABLE); if ((s->supported_bilevel_resolutions & (T4_SUPPORT_RESOLUTION_R8_STANDARD | T4_SUPPORT_RESOLUTION_R8_FINE | T4_SUPPORT_RESOLUTION_R8_SUPERFINE | T4_SUPPORT_RESOLUTION_R16_SUPERFINE))) - set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INCH_RESOLUTION_PREFERRED); - if ((s->supported_bilevel_resolutions & (T4_SUPPORT_RESOLUTION_200_100 | T4_SUPPORT_RESOLUTION_200_200 | T4_SUPPORT_RESOLUTION_200_400 | T4_SUPPORT_RESOLUTION_300_300 | T4_SUPPORT_RESOLUTION_300_600 | T4_SUPPORT_RESOLUTION_400_400 | T4_SUPPORT_RESOLUTION_400_800 | T4_SUPPORT_RESOLUTION_600_600 | T4_SUPPORT_RESOLUTION_600_1200 | T4_SUPPORT_RESOLUTION_1200_1200))) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_METRIC_RESOLUTION_PREFERRED); + if ((s->supported_bilevel_resolutions & (T4_SUPPORT_RESOLUTION_200_100 | T4_SUPPORT_RESOLUTION_200_200 | T4_SUPPORT_RESOLUTION_200_400 | T4_SUPPORT_RESOLUTION_300_300 | T4_SUPPORT_RESOLUTION_300_600 | T4_SUPPORT_RESOLUTION_400_400 | T4_SUPPORT_RESOLUTION_400_800 | T4_SUPPORT_RESOLUTION_600_600 | T4_SUPPORT_RESOLUTION_600_1200 | T4_SUPPORT_RESOLUTION_1200_1200))) + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INCH_RESOLUTION_PREFERRED); /* No double sided printing (alternate mode) */ /* No double sided printing (continuous mode) */ @@ -1426,11 +1428,11 @@ static int build_dcs(t30_state_t *s) int image_type; /* Reacquire page information, in case the image was resized, flattened, etc. */ - s->x_resolution = t4_tx_get_x_resolution(&s->t4.tx); - s->y_resolution = t4_tx_get_y_resolution(&s->t4.tx); - s->current_page_resolution = t4_tx_get_resolution(&s->t4.tx); - s->image_width = t4_tx_get_image_width(&s->t4.tx); - image_type = t4_tx_get_image_type(&s->t4.tx); + s->current_page_resolution = t4_tx_get_tx_resolution(&s->t4.tx); + s->x_resolution = t4_tx_get_tx_x_resolution(&s->t4.tx); + s->y_resolution = t4_tx_get_tx_y_resolution(&s->t4.tx); + s->image_width = t4_tx_get_tx_image_width(&s->t4.tx); + image_type = t4_tx_get_tx_image_type(&s->t4.tx); /* Make a DCS frame based on local issues and the latest received DIS/DTC frame. Negotiate the result based on what both parties can do. */ @@ -2399,11 +2401,9 @@ static int step_fallback_entry(t30_state_t *s) } if (fallback_sequence[s->current_fallback].which == 0) return -1; - /* TODO: This only sets the minimum row time for future pages. It doesn't fix up the - current page, though it is benign - fallback will only result in an excessive - minimum. */ + /* We need to update the minimum scan time, in case we are in non-ECM mode. */ set_min_scan_time(s); - /* We need to rebuild the DCS message we will send. */ + /* Now we need to rebuild the DCS message we will send. */ build_dcs(s); return s->current_fallback; } @@ -2669,16 +2669,18 @@ static void set_min_scan_time(t30_state_t *s) } span_log(&s->logging, SPAN_LOG_FLOW, "Remote FAX does not support fine resolution. Squashing image.\n"); /* Fall through */ - default: case T4_Y_RESOLUTION_STANDARD: case T4_Y_RESOLUTION_100: s->min_scan_time_code = translate_min_scan_time[0][min_bits_field]; break; + default: + s->min_scan_time_code = T30_MIN_SCAN_0MS; + break; } - if (!s->error_correcting_mode && (s->iaf & T30_IAF_MODE_NO_FILL_BITS)) + if ((s->iaf & T30_IAF_MODE_NO_FILL_BITS)) min_row_bits = 0; else - min_row_bits = fallback_sequence[s->current_fallback].bit_rate*min_scan_times[s->min_scan_time_code]/1000; + min_row_bits = (fallback_sequence[s->current_fallback].bit_rate*min_scan_times[s->min_scan_time_code])/1000; span_log(&s->logging, SPAN_LOG_FLOW, "Minimum bits per row will be %d\n", min_row_bits); t4_tx_set_min_bits_per_row(&s->t4.tx, min_row_bits); } @@ -2714,10 +2716,11 @@ static int start_sending_document(t30_state_t *s) return -1; } - s->x_resolution = t4_tx_get_x_resolution(&s->t4.tx); - s->y_resolution = t4_tx_get_y_resolution(&s->t4.tx); - s->image_width = t4_tx_get_image_width(&s->t4.tx); - /* The minimum scan time to be used can't be evaluated until we know the Y resolution. */ + s->x_resolution = t4_tx_get_tx_x_resolution(&s->t4.tx); + s->y_resolution = t4_tx_get_tx_y_resolution(&s->t4.tx); + s->image_width = t4_tx_get_tx_image_width(&s->t4.tx); + /* The minimum scan time to be used can't be evaluated until we know the Y resolution, and + must be evaluated before the minimum scan row bits can be evaluated. */ set_min_scan_time(s); if (s->error_correcting_mode) @@ -6483,7 +6486,8 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status) { /* Send the end of page or partial page message */ set_phase(s, T30_PHASE_D_TX); - s->next_tx_step = check_next_tx_step(s); + if (s->ecm_at_page_end) + s->next_tx_step = check_next_tx_step(s); if (send_pps_frame(s) == T30_NULL) set_state(s, T30_STATE_IV_PPS_NULL); else @@ -6808,7 +6812,10 @@ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s, s->supported_compressions = T4_SUPPORT_COMPRESSION_T4_1D | T4_SUPPORT_COMPRESSION_T4_2D; s->supported_bilevel_resolutions = T4_SUPPORT_RESOLUTION_R8_STANDARD | T4_SUPPORT_RESOLUTION_R8_FINE - | T4_SUPPORT_RESOLUTION_R8_SUPERFINE; + | T4_SUPPORT_RESOLUTION_R8_SUPERFINE + | T4_SUPPORT_RESOLUTION_200_100 + | T4_SUPPORT_RESOLUTION_200_200 + | T4_SUPPORT_RESOLUTION_200_400; s->supported_image_sizes = T4_SUPPORT_WIDTH_215MM | T4_SUPPORT_LENGTH_US_LETTER | T4_SUPPORT_LENGTH_US_LEGAL diff --git a/libs/spandsp/src/t4_rx.c b/libs/spandsp/src/t4_rx.c index 7723e14eb2..247b9ae726 100644 --- a/libs/spandsp/src/t4_rx.c +++ b/libs/spandsp/src/t4_rx.c @@ -371,6 +371,7 @@ static int set_tiff_directory_info(t4_rx_state_t *s) break; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: + s->metadata.image_length = t88_decode_get_image_length(&s->decoder.t88); break; #endif case T4_COMPRESSION_T42_T81: @@ -383,6 +384,7 @@ static int set_tiff_directory_info(t4_rx_state_t *s) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: + s->metadata.image_length = t45_decode_get_image_length(&s->decoder.t45); break; #endif } @@ -884,7 +886,7 @@ SPAN_DECLARE(int) t4_rx_set_row_write_handler(t4_rx_state_t *s, t4_row_write_han return t85_decode_set_row_write_handler(&s->decoder.t85, handler, user_data); #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: - break; + return t88_decode_set_row_write_handler(&s->decoder.t88, handler, user_data); #endif case T4_COMPRESSION_T42_T81: return t42_decode_set_row_write_handler(&s->decoder.t42, handler, user_data); @@ -894,7 +896,7 @@ SPAN_DECLARE(int) t4_rx_set_row_write_handler(t4_rx_state_t *s, t4_row_write_han #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: - break; + return t45_decode_set_row_write_handler(&s->decoder.t45, handler, user_data); #endif } return -1; @@ -942,7 +944,7 @@ SPAN_DECLARE(void) t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t break; #endif case T4_COMPRESSION_T42_T81: - t->type = 0; + t->type = T4_IMAGE_TYPE_COLOUR_8BIT; //T4_IMAGE_TYPE_GRAY_8BIT; t->width = t42_decode_get_image_width(&s->decoder.t42); t->length = t42_decode_get_image_length(&s->decoder.t42); t->image_type = t->type; @@ -952,7 +954,7 @@ SPAN_DECLARE(void) t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t break; #if defined(SPANDSP_SUPPORT_T43) case T4_COMPRESSION_T43: - t->type = 0; + t->type = T4_IMAGE_TYPE_COLOUR_8BIT; t->width = t43_decode_get_image_width(&s->decoder.t43); t->length = t43_decode_get_image_length(&s->decoder.t43); t->image_type = t->type; @@ -986,6 +988,7 @@ SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s) break; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: + t88_decode_restart(&s->decoder.t88); break; #endif case T4_COMPRESSION_T42_T81: @@ -998,6 +1001,7 @@ SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: + t45_decode_restart(&s->decoder.t45); break; #endif } @@ -1052,11 +1056,17 @@ SPAN_DECLARE(int) t4_rx_end_page(t4_rx_state_t *s) break; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: + t88_decode_put(&s->decoder.t88, NULL, 0); + length = t88_decode_get_image_length(&s->decoder.t88); break; #endif case T4_COMPRESSION_T42_T81: t42_decode_put(&s->decoder.t42, NULL, 0); length = t42_decode_get_image_length(&s->decoder.t42); + if (s->decoder.t42.samples_per_pixel == 3) + select_tiff_compression(s, T4_IMAGE_TYPE_COLOUR_8BIT); + else + select_tiff_compression(s, T4_IMAGE_TYPE_GRAY_8BIT); break; #if defined(SPANDSP_SUPPORT_T43) case T4_COMPRESSION_T43: @@ -1066,6 +1076,8 @@ SPAN_DECLARE(int) t4_rx_end_page(t4_rx_state_t *s) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: + t45_decode_put(&s->decoder.t45, NULL, 0); + length = t45_decode_get_image_length(&s->decoder.t45); break; #endif } @@ -1156,7 +1168,7 @@ SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s) return t85_decode_release(&s->decoder.t85); #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: - break; + return t88_decode_release(&s->decoder.t88); #endif case T4_COMPRESSION_T42_T81: return t42_decode_release(&s->decoder.t42); @@ -1166,7 +1178,7 @@ SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: - break; + return t45_decode_release(&s->decoder.t45); #endif } return -1; diff --git a/libs/spandsp/src/t4_tx.c b/libs/spandsp/src/t4_tx.c index ee0d6202d9..d0001aa720 100644 --- a/libs/spandsp/src/t4_tx.c +++ b/libs/spandsp/src/t4_tx.c @@ -485,7 +485,7 @@ static int test_tiff_directory_info(t4_tx_state_t *s) parm32 = 0; TIFFGetField(t->tiff_file, TIFFTAG_IMAGEWIDTH, &parm32); - if (s->metadata.image_width != (int) parm32) + if (s->tiff.image_width != (int) parm32) return 1; x_resolution = 0.0f; TIFFGetField(t->tiff_file, TIFFTAG_XRESOLUTION, &x_resolution); @@ -541,16 +541,16 @@ static int tiff_row_read_handler(void *user_data, uint8_t buf[], size_t len) int j; s = (t4_tx_state_t *) user_data; - if (s->tiff.row >= s->metadata.image_length) + if (s->tiff.row >= s->tiff.image_length) return 0; memcpy(buf, &s->tiff.image_buffer[s->tiff.row*len], len); s->tiff.row++; /* If this is a bi-level image which has more vertical resolution than the far end will accept, we need to squash it down to size. */ - for (i = 1; i < s->row_squashing_ratio && s->tiff.row < s->metadata.image_length; i++) + for (i = 1; i < s->row_squashing_ratio && s->tiff.row < s->tiff.image_length; i++) { - for (j = 0; j < s->metadata.image_width/8; j++) + for (j = 0; j < s->tiff.image_width/8; j++) buf[j] |= s->tiff.image_buffer[s->tiff.row*len + j]; s->tiff.row++; } @@ -604,7 +604,6 @@ static int read_tiff_t85_image(t4_tx_state_t *s) { int biggest; int num_strips; - int total_len; int len; int i; int result; @@ -615,8 +614,8 @@ static int read_tiff_t85_image(t4_tx_state_t *s) /* Size up and allocate the buffer for the raw data */ num_strips = TIFFNumberOfStrips(s->tiff.tiff_file); - biggest = TIFFRawStripSize(s->tiff.tiff_file, 0); - for (i = 1; i < num_strips; i++) + biggest = 0; + for (i = 0; i < num_strips; i++) { len = TIFFRawStripSize(s->tiff.tiff_file, i); if (len > biggest) @@ -625,11 +624,14 @@ static int read_tiff_t85_image(t4_tx_state_t *s) if ((raw_data = malloc(biggest)) == NULL) return -1; - s->tiff.image_size = s->metadata.image_length*((s->metadata.image_width + 7)/8); + s->tiff.image_size = s->tiff.image_length*((s->tiff.image_width + 7)/8); if (s->tiff.image_size >= s->tiff.image_buffer_size) { if ((t = realloc(s->tiff.image_buffer, s->tiff.image_size)) == NULL) + { + free(raw_data); return -1; + } s->tiff.image_buffer_size = s->tiff.image_size; s->tiff.image_buffer = t; } @@ -640,14 +642,14 @@ static int read_tiff_t85_image(t4_tx_state_t *s) t85_decode_init(&t85, packing_row_write_handler, &pack); t85_decode_set_comment_handler(&t85, 1000, embedded_comment_handler, s); - total_len = 0; result = -1; - for (i = 0; i < num_strips; i++, total_len += len) + for (i = 0; i < num_strips; i++) { len = TIFFRawStripSize(s->tiff.tiff_file, i); if ((len = TIFFReadRawStrip(s->tiff.tiff_file, i, raw_data, len)) < 0) { - span_log(&s->logging, SPAN_LOG_WARNING, "%s: ReadRaw error.\n", s->tiff.file); + span_log(&s->logging, SPAN_LOG_WARNING, "%s: TIFFReadRawStrip error.\n", s->tiff.file); + free(raw_data); return -1; } result = t85_decode_put(&t85, raw_data, len); @@ -658,7 +660,7 @@ static int read_tiff_t85_image(t4_tx_state_t *s) result = t85_decode_put(&t85, NULL, 0); len = t85_decode_get_compressed_image_size(&t85); - span_log(&s->logging, SPAN_LOG_WARNING, "Compressed image is %d bytes, %d rows\n", len/8, s->metadata.image_length); + span_log(&s->logging, SPAN_LOG_WARNING, "Compressed image is %d bytes, %d rows\n", len/8, s->tiff.image_length); t85_decode_release(&t85); free(raw_data); return 0; @@ -717,20 +719,26 @@ static int read_tiff_t43_image(t4_tx_state_t *s, uint8_t **buf) #endif #if 0 -static int read_tiff_t42_t81_image(t4_tx_state_t *s, uint8_t **buf) +static int read_tiff_t42_t81_image(t4_tx_state_t *s) { int total_len; int len; int i; int num_strips; int total_image_len; - int image_size; + uint8_t *t; uint8_t *raw_data; uint8_t *jpeg_table; uint32_t jpeg_table_len; - uint32_t w; - uint32_t h; - tsize_t off; + packer_t pack; + uint16_t bits_per_sample; + uint16_t samples_per_pixel; + t42_decode_state_t t42; + + bits_per_sample = 1; + TIFFGetField(s->tiff.tiff_file, TIFFTAG_BITSPERSAMPLE, &bits_per_sample); + samples_per_pixel = 1; + TIFFGetField(s->tiff.tiff_file, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel); num_strips = TIFFNumberOfStrips(s->tiff.tiff_file); total_image_len = 0; @@ -753,7 +761,8 @@ static int read_tiff_t42_t81_image(t4_tx_state_t *s, uint8_t **buf) { if ((len = TIFFReadRawStrip(s->tiff.tiff_file, i, &raw_data[total_len], total_image_len - total_len)) < 0) { - span_log(&s->logging, SPAN_LOG_FLOW, "TIFF read error.\n"); + span_log(&s->logging, SPAN_LOG_WARNING, "%s: TIFFReadRawStrip error.\n", s->tiff.file); + free(raw_data); return -1; } } @@ -763,18 +772,30 @@ static int read_tiff_t42_t81_image(t4_tx_state_t *s, uint8_t **buf) if (total_len != total_image_len) span_log(&s->logging, SPAN_LOG_FLOW, "Size mismatch %d %d\n", (int) total_len, (int) total_image_len); - image_size = 3*s->metadata.image_length*s->metadata.image_width; - if ((*buf = malloc(image_size)) == NULL) - return -1; - - off = 0; - if (!t42_itulab_to_srgb(&s->logging, &s->lab_params, *buf, &off, raw_data, total_image_len, &w, &h)) + s->tiff.image_size = samples_per_pixel*s->tiff.image_width*s->tiff.image_length; + if (s->tiff.image_size >= s->tiff.image_buffer_size) { - span_log(&s->logging, SPAN_LOG_FLOW, "Failed to convert from ITULAB.\n"); - return -1; + if ((t = realloc(s->tiff.image_buffer, s->tiff.image_size)) == NULL) + { + free(raw_data); + return -1; + } + s->tiff.image_buffer_size = s->tiff.image_size; + s->tiff.image_buffer = t; } + + t42_decode_init(&t42, packing_row_write_handler, &pack); + + pack.buf = s->tiff.image_buffer; + pack.ptr = 0; + pack.row = 0; + + t42_decode_put(&t42, raw_data, total_image_len); + t42_decode_put(&t42, NULL, 0); + + t42_decode_release(&t42); free(raw_data); - return image_size; + return s->tiff.image_size; } /*- End of function --------------------------------------------------------*/ #endif @@ -789,7 +810,7 @@ static int read_tiff_decompressed_image(t4_tx_state_t *s) /* Decode the whole image into a buffer */ /* Let libtiff handle the decompression */ - s->tiff.image_size = s->metadata.image_length*TIFFScanlineSize(s->tiff.tiff_file); + s->tiff.image_size = s->tiff.image_length*TIFFScanlineSize(s->tiff.tiff_file); if (s->tiff.image_size >= s->tiff.image_buffer_size) { if ((t = realloc(s->tiff.image_buffer, s->tiff.image_size)) == NULL) @@ -798,14 +819,13 @@ static int read_tiff_decompressed_image(t4_tx_state_t *s) s->tiff.image_buffer = t; } - /* Allow for the image being stored in multiple strips, although it is rare to find - a stripped image in a T.4 or T.6 encoded file. */ + /* Allow for the image being stored in multiple strips. */ num_strips = TIFFNumberOfStrips(s->tiff.tiff_file); for (i = 0, total_len = 0; i < num_strips; i++, total_len += len) { if ((len = TIFFReadEncodedStrip(s->tiff.tiff_file, i, &s->tiff.image_buffer[total_len], s->tiff.image_size - total_len)) < 0) { - span_log(&s->logging, SPAN_LOG_WARNING, "%s: Read error.\n", s->tiff.file); + span_log(&s->logging, SPAN_LOG_WARNING, "%s: TIFFReadEncodedStrip error.\n", s->tiff.file); return -1; } } @@ -935,7 +955,7 @@ static int set_row_read_handler(t4_tx_state_t *s, t4_row_read_handler_t handler, return t85_encode_set_row_read_handler(&s->encoder.t85, handler, user_data); #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: - break; + return t88_encode_set_row_read_handler(&s->encoder.t88, handler, user_data); #endif case T4_COMPRESSION_T42_T81: case T4_COMPRESSION_SYCC_T81: @@ -946,7 +966,7 @@ static int set_row_read_handler(t4_tx_state_t *s, t4_row_read_handler_t handler, #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: - break; + return t45_encode_set_row_read_handler(&s->encoder.t45, handler, user_data); #endif } return -1; @@ -997,7 +1017,8 @@ static int make_header(t4_tx_state_t *s) static int header_row_read_handler(void *user_data, uint8_t buf[], size_t len) { - int repeats; + int x_repeats; + int y_repeats; int pattern; int pos; int row; @@ -1008,28 +1029,30 @@ static int header_row_read_handler(void *user_data, uint8_t buf[], size_t len) switch (s->metadata.y_resolution) { case T4_Y_RESOLUTION_1200: - repeats = 12; + y_repeats = 12; break; case T4_Y_RESOLUTION_800: - repeats = 8; + y_repeats = 8; break; case T4_Y_RESOLUTION_600: - repeats = 6; + y_repeats = 6; break; case T4_Y_RESOLUTION_SUPERFINE: - repeats = 4; + case T4_Y_RESOLUTION_400: + y_repeats = 4; break; case T4_Y_RESOLUTION_300: - repeats = 3; + y_repeats = 3; break; case T4_Y_RESOLUTION_FINE: - repeats = 2; + case T4_Y_RESOLUTION_200: + y_repeats = 2; break; default: - repeats = 1; + y_repeats = 1; break; } - repeats /= s->row_squashing_ratio; + y_repeats /= s->row_squashing_ratio; if (s->header_overlays_image) { /* Read and dump a row of the real image, allowing for the possibility @@ -1040,7 +1063,7 @@ static int header_row_read_handler(void *user_data, uint8_t buf[], size_t len) return len; } } - row = s->header_row/repeats; + row = s->header_row/y_repeats; pos = 0; for (t = s->header_text; *t && pos <= len - 2; t++) { @@ -1051,7 +1074,7 @@ static int header_row_read_handler(void *user_data, uint8_t buf[], size_t len) while (pos < len) buf[pos++] = 0; s->header_row++; - if (s->header_row >= 16*repeats) + if (s->header_row >= 16*y_repeats) { /* End of header. Change to normal image row data. */ set_row_read_handler(s, s->row_handler, s->row_handler_user_data); @@ -1089,10 +1112,10 @@ SPAN_DECLARE(int) t4_tx_set_row_read_handler(t4_tx_state_t *s, t4_row_read_handl } /*- End of function --------------------------------------------------------*/ -SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) +SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int compression) { { - switch (encoding) + switch (compression) { case T4_COMPRESSION_T4_1D: case T4_COMPRESSION_T4_2D: @@ -1104,12 +1127,12 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) case T4_COMPRESSION_T6: break; default: - t4_t6_encode_init(&s->encoder.t4_t6, encoding, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); + t4_t6_encode_init(&s->encoder.t4_t6, compression, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); t4_t6_encode_set_max_2d_rows_per_1d_row(&s->encoder.t4_t6, -s->metadata.y_resolution); break; } - s->metadata.compression = encoding; - if (t4_t6_encode_set_encoding(&s->encoder.t4_t6, encoding)) + s->metadata.compression = compression; + if (t4_t6_encode_set_encoding(&s->encoder.t4_t6, compression)) return -1; return s->metadata.compression; case T4_COMPRESSION_T85: @@ -1123,7 +1146,7 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) t85_encode_init(&s->encoder.t85, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); break; } - s->metadata.compression = encoding; + s->metadata.compression = compression; return s->metadata.compression; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: @@ -1132,9 +1155,10 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) case T4_COMPRESSION_T88: break; default: + t88_encode_init(&s->encoder.t88, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); break; } - s->metadata.compression = encoding; + s->metadata.compression = compression; return s->metadata.compression; #endif case T4_COMPRESSION_T42_T81: @@ -1148,7 +1172,7 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) t42_encode_init(&s->encoder.t42, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); break; } - s->metadata.compression = encoding; + s->metadata.compression = compression; return s->metadata.compression; #if defined(SPANDSP_SUPPORT_T43) case T4_COMPRESSION_T43: @@ -1160,7 +1184,7 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) t43_encode_init(&s->encoder.t43, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); break; } - s->metadata.compression = encoding; + s->metadata.compression = compression; return s->metadata.compression; #endif #if defined(SPANDSP_SUPPORT_T45) @@ -1170,9 +1194,10 @@ SPAN_DECLARE(int) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) case T4_COMPRESSION_T45: break; default: + t45_encode_init(&s->encoder.t45, s->metadata.image_width, s->metadata.image_length, s->row_handler, s->row_handler_user_data); break; } - s->metadata.compression = encoding; + s->metadata.compression = compression; return s->metadata.compression; #endif } @@ -1194,6 +1219,42 @@ SPAN_DECLARE(void) t4_tx_set_min_bits_per_row(t4_tx_state_t *s, int bits) } /*- End of function --------------------------------------------------------*/ +SPAN_DECLARE(int) t4_tx_get_tx_compression(t4_tx_state_t *s) +{ + return s->metadata.compression; +} +/*- End of function --------------------------------------------------------*/ + +SPAN_DECLARE(int) t4_tx_get_tx_image_type(t4_tx_state_t *s) +{ + return s->metadata.image_type; +} +/*- End of function --------------------------------------------------------*/ + +SPAN_DECLARE(int) t4_tx_get_tx_resolution(t4_tx_state_t *s) +{ + return s->metadata.resolution_code; +} +/*- End of function --------------------------------------------------------*/ + +SPAN_DECLARE(int) t4_tx_get_tx_x_resolution(t4_tx_state_t *s) +{ + return s->metadata.x_resolution; +} +/*- End of function --------------------------------------------------------*/ + +SPAN_DECLARE(int) t4_tx_get_tx_y_resolution(t4_tx_state_t *s) +{ + return s->metadata.y_resolution; +} +/*- End of function --------------------------------------------------------*/ + +SPAN_DECLARE(int) t4_tx_get_tx_image_width(t4_tx_state_t *s) +{ + return s->metadata.image_width; +} +/*- End of function --------------------------------------------------------*/ + SPAN_DECLARE(void) t4_tx_set_image_width(t4_tx_state_t *s, int image_width) { s->metadata.image_width = image_width; @@ -1210,6 +1271,7 @@ SPAN_DECLARE(void) t4_tx_set_image_width(t4_tx_state_t *s, int image_width) break; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: + t88_encode_set_image_width(&s->encoder.t88, image_width); break; #endif case T4_COMPRESSION_T42_T81: @@ -1223,6 +1285,7 @@ SPAN_DECLARE(void) t4_tx_set_image_width(t4_tx_state_t *s, int image_width) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: + t45_encode_set_image_width(&s->encoder.t45, image_width); break; #endif } @@ -1240,6 +1303,7 @@ static void t4_tx_set_image_length(t4_tx_state_t *s, uint32_t image_length) break; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: + t88_encode_set_image_length(&s->encoder.t88, image_length); break; #endif case T4_COMPRESSION_T42_T81: @@ -1253,6 +1317,7 @@ static void t4_tx_set_image_length(t4_tx_state_t *s, uint32_t image_length) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: + t45_encode_set_image_length(&s->encoder.t45, image_length); break; #endif } @@ -1382,6 +1447,9 @@ SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t break; #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: + t->width = t88_encode_get_image_width(&s->encoder.t88); + t->length = t88_encode_get_image_length(&s->encoder.t88); + t->line_image_size = t88_encode_get_compressed_image_size(&s->encoder.t88)/8; break; #endif case T4_COMPRESSION_T42_T81: @@ -1401,6 +1469,9 @@ SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: + t->width = t45_encode_get_image_width(&s->encoder.t45); + t->length = t45_encode_get_image_length(&s->encoder.t45); + t->line_image_size = t45_encode_get_compressed_image_size(&s->encoder.t45)/8; break; #endif } @@ -1471,7 +1542,7 @@ SPAN_DECLARE(int) t4_tx_get(t4_tx_state_t *s, uint8_t buf[], size_t max_len) return t85_encode_get(&s->encoder.t85, buf, max_len); #if defined(SPANDSP_SUPPORT_T88) case T4_COMPRESSION_T88: - break; + return t88_encode_get(&s->encoder.t88, buf, max_len); #endif case T4_COMPRESSION_T42_T81: case T4_COMPRESSION_SYCC_T81: @@ -1482,7 +1553,7 @@ SPAN_DECLARE(int) t4_tx_get(t4_tx_state_t *s, uint8_t buf[], size_t max_len) #endif #if defined(SPANDSP_SUPPORT_T45) case T4_COMPRESSION_T45: - break; + return t45_encode_get(&s->encoder.t45, buf, max_len); #endif } #endif @@ -1548,7 +1619,6 @@ SPAN_DECLARE(int) t4_tx_start_page(t4_tx_state_t *s) s->image_get_handler = NULL; break; } - /* If there is a page header, create that first */ if (s->metadata.image_type == T4_IMAGE_TYPE_BILEVEL && s->header_info && s->header_info[0] && make_header(s) == 0) //if (s->header_info && s->header_info[0] && make_header(s) == 0) diff --git a/libs/spandsp/tests/v18_tests.c b/libs/spandsp/tests/v18_tests.c index 0cb6d93b8f..0c12678c80 100644 --- a/libs/spandsp/tests/v18_tests.c +++ b/libs/spandsp/tests/v18_tests.c @@ -88,7 +88,6 @@ static void put_text_msg(void *user_data, const uint8_t *msg, int len) static void basic_tests(int mode) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -133,6 +132,8 @@ static void basic_tests(int mode) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { if (push == 0) @@ -204,9 +205,13 @@ static void basic_tests(int mode) } /*- End of function --------------------------------------------------------*/ +static void misc_01_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_01(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -223,15 +228,15 @@ static int test_misc_01(void) Preamble: N/A Method: A call is made to the TUT from the tester which remains off hook for 10 minutes without sending any signal. - Pass criteria: The TUT should answer the call and enter the probing state after 3 seconds. The + Pass criteria: The TUT should answer the call and enter the probing state after 3s. The TUT should continue to probe until the test is terminated. Comments: This feature should also be verified by observation during the automoding tests. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_01_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -251,6 +256,8 @@ static int test_misc_01(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -299,9 +306,13 @@ static int test_misc_01(void) } /*- End of function --------------------------------------------------------*/ +static void misc_02_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_02(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -315,22 +326,22 @@ static int test_misc_02(void) /* III.5.4.1.2 Automatic resumption of automoding Purpose: To ensure that the DCE can be configured to automatically re-assume the automode - calling state after 10 s of no valid signal. + calling state after 10s of no valid signal. Preamble: The TUT should be configured to automatically re-assume the initial automoding state. Method: The tester should set up a call to the TUT in V.21 mode and then drop the carrier. - The tester will then transmit silence for 11 seconds followed by a 1300Hz tone for - 5 seconds (i.e. V.23). - Pass criteria: 1) Ten seconds after dropping the carrier the TUT should return to state Monitor 1. - 2) After 2.7+-0.3 seconds the TUT should select V.23 mode and send a 390Hz tone. + The tester will then transmit silence for 11s followed by a 1300Hz tone for + 5s (i.e. V.23). + Pass criteria: 1) 10s after dropping the carrier the TUT should return to state Monitor 1. + 2) After 2.7+-0.3s the TUT should select V.23 mode and send a 390Hz tone. Comments: The TUT should indicate that carrier has been lost at some time after the 1650Hz signal is lost. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_02_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -350,6 +361,8 @@ static int test_misc_02(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -398,9 +411,13 @@ static int test_misc_02(void) } /*- End of function --------------------------------------------------------*/ +static void misc_03_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_03(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -418,18 +435,18 @@ static int test_misc_03(void) Preamble: The TUT should be configured to remain in the selected transmission mode when the carrier is lost. Method: The tester should set up a call to the TUT in V.21 mode, for example. It will drop - the carrier for 9 seconds and then re-start transmission of the same carrier for - 1 second followed by a short message. + the carrier for 9s and then re-start transmission of the same carrier for + 1s followed by a short message. Pass criteria: The TUT should resume operation in V.21 mode and capture the entire test message. Comments: The TUT should indicate that carrier has been lost at some time after the carrier signal is removed and not disconnect. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_03_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -449,6 +466,8 @@ static int test_misc_03(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -497,9 +516,13 @@ static int test_misc_03(void) } /*- End of function --------------------------------------------------------*/ +static void misc_04_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_04(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -523,11 +546,11 @@ static int test_misc_04(void) automatically hang up when busy tone is detected. PABX busy tones may differ in frequency and cadence from national parameters. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_04_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -547,6 +570,8 @@ static int test_misc_04(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -595,9 +620,13 @@ static int test_misc_04(void) } /*- End of function --------------------------------------------------------*/ +static void misc_05_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_05(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -618,11 +647,11 @@ static int test_misc_05(void) Pass criteria: The RINGING condition should be visually indicated by the TUT. Comments: This test should be repeated across a range of valid timings and ring voltages. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_05_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -642,6 +671,8 @@ static int test_misc_05(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -690,9 +721,13 @@ static int test_misc_05(void) } /*- End of function --------------------------------------------------------*/ +static void misc_06_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_06(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -716,11 +751,11 @@ static int test_misc_06(void) mode. There may be other cases, e.g. where the V.18 DCE is used in a gateway, when automatic disconnection is required. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_06_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -740,6 +775,8 @@ static int test_misc_06(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -788,9 +825,13 @@ static int test_misc_06(void) } /*- End of function --------------------------------------------------------*/ +static void misc_07_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_07(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -812,11 +853,11 @@ static int test_misc_07(void) However, this may possibly not be indicated by the DTE. Comments: The possible modes are: V.21, V.23, Baudot 45, Baudot 50, EDT, Bell 103, DTMF. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_07_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -836,6 +877,8 @@ static int test_misc_07(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -884,9 +927,13 @@ static int test_misc_07(void) } /*- End of function --------------------------------------------------------*/ +static void misc_08_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_08(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -902,18 +949,18 @@ static int test_misc_08(void) Purpose: To ensure that the DCE implements circuit 135 or an equivalent way of indicating presence of a signal. Preamble: N/A - Method: A call from the TUT should be answered in voice mode after 20 seconds. The tester + Method: A call from the TUT should be answered in voice mode after 20s. The tester will transmit sampled voice messages. V.24 circuit 135 or its equivalent should be observed. Pass criteria: The ring tone and speech shall be indicated by circuit 135. Comment: The response times and signal level thresholds of Circuit 135 are not specified in ITU-T V.18 or V.24 and therefore the pattern indicated may vary. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_08_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -933,6 +980,8 @@ static int test_misc_08(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -981,9 +1030,13 @@ static int test_misc_08(void) } /*- End of function --------------------------------------------------------*/ +static void misc_09_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_misc_09(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1003,11 +1056,11 @@ static int test_misc_09(void) Pass criteria: TBD Comment: TBD */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, misc_09_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1027,6 +1080,8 @@ static int test_misc_09(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1075,9 +1130,13 @@ static int test_misc_09(void) } /*- End of function --------------------------------------------------------*/ +static void org_01_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_01(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1098,19 +1157,19 @@ static int test_org_01(void) check for correct coding and timing of the signal. Pass criteria: 1) No signal should be transmitted for one second after connecting to the line. 2) Four CI patterns are transmitted for each repetition. - 3) No signal is transmitted for two seconds after the end of each CI. + 3) No signal is transmitted for 2s after the end of each CI. 4) Each CI must have the correct bit pattern. - 5) The CI patterns followed by two seconds of silence must be repeated twice. + 5) The CI patterns followed by 2s of silence must be repeated twice. 6) One second after every 3 blocks CI an XCI signal must be transmitted. 7) The XCI should have the structure defined in 3.11. 8) The whole sequence should be repeated until the call is cleared. 9) When V.18 to V.18, the XCI must not force V.23 or Minitel mode. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_01_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1130,6 +1189,8 @@ static int test_org_01(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1178,9 +1239,13 @@ static int test_org_01(void) } /*- End of function --------------------------------------------------------*/ +static void org_02_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_02(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1198,17 +1263,16 @@ static int test_org_02(void) Preamble: Make a V.18 call from the TUT. Method: The Test System waits for the TUT to stop transmitting a CI and responds with an ANS signal. The V.21 demodulator is used to decode the TXP sequence and a timer - measures the silence intervals between them. ANS should be transmitted for 2 - seconds. - Pass criteria: 1) No signal should be transmitted by TUT for 0.5 seconds from detection of ANS. + measures the silence intervals between them. ANS should be transmitted for 2s. + Pass criteria: 1) No signal should be transmitted by TUT for 0.5s from detection of ANS. 2) The TUT should reply with transmission of TXP as defined in 5.1.2. 3) Verify that TXP sequence has correct bit pattern. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_02_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1228,6 +1292,8 @@ static int test_org_02(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1276,9 +1342,13 @@ static int test_org_02(void) } /*- End of function --------------------------------------------------------*/ +static void org_03_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_03(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1294,16 +1364,16 @@ static int test_org_03(void) Purpose: The TUT should stop sending TXP at the end of the current sequence when the ANS tone ceases. Preamble: Test ORG-02 should be successfully completed immediately prior to this test. - Method: The tester sends ANS for 2 seconds followed by silence. The tester will then + Method: The tester sends ANS for 2s followed by silence. The tester will then monitor for cessation of TXP at the end of the answer tone. Pass criteria: The TUT should stop sending TXP at the end of the current sequence when ANS tone ceases. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_03_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1323,6 +1393,8 @@ static int test_org_03(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1371,9 +1443,13 @@ static int test_org_03(void) } /*- End of function --------------------------------------------------------*/ +static void org_04_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_04(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1388,21 +1464,21 @@ static int test_org_04(void) III.5.4.2.4 ANS tone followed by TXP Purpose: To check correct detection of V.18 modem. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. - Method: Tester transmits ANS for 2.5 seconds followed by 75ms of no tone then transmits - 3 TXP sequences using V.21 (2) and starts a 1 s timer. It will then transmit 1650Hz - for 5 seconds. + Method: Tester transmits ANS for 2.5s followed by 75ms of no tone then transmits + 3 TXP sequences using V.21 (2) and starts a 1s timer. It will then transmit 1650Hz + for 5s. Pass criteria: 1) TUT should initially respond with TXP. - 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. - 3) TUT should respond with 980Hz carrier within 1 second of end of 3 TXP sequences. + 2) TUT should stop sending TXP within 0.2s of end of ANS. + 3) TUT should respond with 980Hz carrier within 1s of end of 3 TXP sequences. 4) Data should be transmitted and received according to ITU-T T.140 to comply with the V.18 operational requirements. Comments: The TUT should indicate that V.18 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_04_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1422,6 +1498,8 @@ static int test_org_04(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1470,9 +1548,13 @@ static int test_org_04(void) } /*- End of function --------------------------------------------------------*/ +static void org_05_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_05(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1488,21 +1570,21 @@ static int test_org_05(void) Purpose: To check correct detection of V.21 modem upper channel when preceded by answer tone and to confirm discrimination between V.21 and V.18 modes. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. - Method: Tester transmits ANS for 2.5 seconds followed by 75ms of no tone then transmits + Method: Tester transmits ANS for 2.5s followed by 75ms of no tone then transmits 1650Hz and starts a 0.7 second timer. Pass criteria: 1) TUT should initially respond with TXP. - 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. - 3) TUT should respond with 980Hz at 0.5(+0.2-0.0) seconds of start of 1650Hz. + 2) TUT should stop sending TXP within 0.2s of end of ANS. + 3) TUT should respond with 980Hz at 0.5(+0.2-0.0)s of start of 1650Hz. 4) Data should be transmitted and received at 300 bit/s complying with Annex F. Comments: Selection of ITU-T V.21 as opposed to ITU-T V.18 should be confirmed by examination of TUT. If there is no visual indication, verify by use of ITU-T T.50 for ITU-T V.21 as opposed to UTF-8 coded ISO 10646 character set for ITU-T V.18. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_05_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1522,6 +1604,8 @@ static int test_org_05(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1570,9 +1654,13 @@ static int test_org_05(void) } /*- End of function --------------------------------------------------------*/ +static void org_06_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_06(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1588,20 +1676,20 @@ static int test_org_06(void) Purpose: To check correct detection of V.23 modem upper channel when preceded by answer tone. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. - Method: Tester transmits ANS for 2.5 seconds followed by 75ms of no tone then transmits - 1300Hz and starts a 2.7 s timer. + Method: Tester transmits ANS for 2.5s followed by 75ms of no tone then transmits + 1300Hz and starts a 2.7s timer. Pass criteria: 1) TUT should initially respond with TXP. - 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. - 3) TUT should respond with 390Hz after 1.7(+0.2-0.0) seconds of start of 1300Hz. + 2) TUT should stop sending TXP within 0.2s of end of ANS. + 3) TUT should respond with 390Hz after 1.7(+0.2-0.0)s of start of 1300Hz. 4) Data should be transmitted and received at 75 bit/s and 1200 bit/s respectively by the TUT to comply with Annex E. Comments: The TUT should indicate that V.23 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_06_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1621,6 +1709,8 @@ static int test_org_06(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1669,9 +1759,13 @@ static int test_org_06(void) } /*- End of function --------------------------------------------------------*/ +static void org_07_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_07(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1686,21 +1780,21 @@ static int test_org_07(void) III.5.4.2.7 ANS tone followed by no tone Purpose: To confirm that TUT does not lock up under this condition. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. - Method: Tester transmits ANS for 2.5 seconds followed by no tone for 10 s. It then transmits - DTMF tones for 2 seconds. + Method: Tester transmits ANS for 2.5s followed by no tone for 10 s. It then transmits + DTMF tones for 2s. Pass criteria: 1) TUT should initially respond with TXP. - 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. + 2) TUT should stop sending TXP within 0.2s of end of ANS. 3) TUT should return to Monitor 1 state and then connect in DTMF mode within - 12 seconds of the end of ANS tone. + 12s of the end of ANS tone. Comments: This condition would cause the terminal to lock up if the V.18 standard is followed literally. It may however, occur when connected to certain Swedish textphones if the handset is lifted just after the start of an automatically answered incoming call. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_07_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1720,6 +1814,8 @@ static int test_org_07(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1768,9 +1864,13 @@ static int test_org_07(void) } /*- End of function --------------------------------------------------------*/ +static void org_08_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_08(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1786,16 +1886,16 @@ static int test_org_08(void) Purpose: To verify that the TUT correctly detects the Bell 103 upper channel signal during the 2-second interval between transmission of CI sequences. Preamble: N/A - Method: The tester waits for a CI and then sends a 2225Hz signal for 5 seconds. - Pass criteria: 1) The TUT should respond with a 1270Hz tone in 0.5+-0.1 seconds. + Method: The tester waits for a CI and then sends a 2225Hz signal for 5s. + Pass criteria: 1) The TUT should respond with a 1270Hz tone in 0.5+-0.1s. 2) Data should be transmitted and received at 300 bit/s to comply with Annex D. Comments: The TUT should indicate that Bell 103 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_08_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1815,6 +1915,8 @@ static int test_org_08(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1863,9 +1965,13 @@ static int test_org_08(void) } /*- End of function --------------------------------------------------------*/ +static void org_09_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_09(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1881,16 +1987,16 @@ static int test_org_09(void) Purpose: To verify that the TUT correctly detects the V.21 upper channel signal during the 2-second interval between transmission of CI sequences. Preamble: N/A - Method: The tester waits for a CI and then sends a 1650Hz signal for 5 seconds. - Pass criteria: 1) The TUT should respond with a 980Hz tone in 0.5+-0.1 seconds. + Method: The tester waits for a CI and then sends a 1650Hz signal for 5s. + Pass criteria: 1) The TUT should respond with a 980Hz tone in 0.5+-0.1s. 2) Data should be transmitted and received at 300 bit/s to comply with Annex F. Comments: The TUT should indicate that V.21 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_09_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -1910,6 +2016,8 @@ static int test_org_09(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -1958,9 +2066,13 @@ static int test_org_09(void) } /*- End of function --------------------------------------------------------*/ +static void org_10_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_10(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -1976,17 +2088,17 @@ static int test_org_10(void) Purpose: To verify that the TUT correctly detects the V.23 upper channel signal during the 2-second interval between transmission of CI sequences. Preamble: N/A - Method: The tester waits for a CI and then sends a 1300Hz signal for 5 seconds. - Pass criteria: 1) The TUT should respond with a 390Hz tone in 1.7+-0.1 seconds. + Method: The tester waits for a CI and then sends a 1300Hz signal for 5s. + Pass criteria: 1) The TUT should respond with a 390Hz tone in 1.7+-0.1s. 2) Data should be transmitted and received at 75 bit/s and 1200 bit/s respectively by the TUT to comply with Annex E. Comments: The TUT should indicate that V.23 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_10_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2006,6 +2118,8 @@ static int test_org_10(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2054,9 +2168,13 @@ static int test_org_10(void) } /*- End of function --------------------------------------------------------*/ +static void org_11_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_11(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2072,20 +2190,20 @@ static int test_org_11(void) Purpose: To confirm correct selection of V.23 reverse mode during sending of XCI. Preamble: N/A Method: The tester should wait for the start of the XCI signal and then send 390Hz to TUT - for 5 seconds. + for 5s. Pass criteria: 1) The TUT should complete the XCI as normal. 2) The TUT should then maintain the 1300Hz tone while the 390Hz test tone is present. 3) Data should be transmitted and received at 1200 bit/s and 75 bit/s respectively by the TUT to comply with Annex E when connection is indicated. - Comments: The TUT should indicate that V.23 mode has been selected at least 3 seconds after + Comments: The TUT should indicate that V.23 mode has been selected at least 3s after the start of the 390Hz tone. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_11_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2105,6 +2223,8 @@ static int test_org_11(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2153,9 +2273,13 @@ static int test_org_11(void) } /*- End of function --------------------------------------------------------*/ +static void org_12_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_12(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2185,11 +2309,11 @@ static int test_org_12(void) automode answer state. The TUT may then select either 45.45 or 50 bit/s for the transmission. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_12_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2209,6 +2333,8 @@ static int test_org_12(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2257,9 +2383,13 @@ static int test_org_12(void) } /*- End of function --------------------------------------------------------*/ +static void org_13_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_13(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2283,11 +2413,11 @@ static int test_org_13(void) TUT should comply with ITU-T Q.24 for the Danish Administration while receiving for best possible performance. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_13_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2307,6 +2437,8 @@ static int test_org_13(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2355,9 +2487,13 @@ static int test_org_13(void) } /*- End of function --------------------------------------------------------*/ +static void org_14_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_14(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2383,11 +2519,11 @@ static int test_org_14(void) the number lost should be minimal. The data bits and parity are specified in Annex C. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_14_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2407,6 +2543,8 @@ static int test_org_14(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2455,9 +2593,13 @@ static int test_org_14(void) } /*- End of function --------------------------------------------------------*/ +static void org_15_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_15(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2473,16 +2615,16 @@ static int test_org_15(void) Purpose: To verify the presence of 980/1180Hz at a different signalling rate than 110 bit/s returns the TUT modem to the "monitor A" state. Preamble: N/A - Method: The tester transmits 980/1180Hz signals at 300 bit/s for 2 seconds. + Method: The tester transmits 980/1180Hz signals at 300 bit/s for 2s. Pass criteria: The TUT should not select EDT or any other mode and should continue to transmit the CI signal. Comments: Echoes of the CI sequences may be detected at 300 bit/s. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_15_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2502,6 +2644,8 @@ static int test_org_15(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2550,9 +2694,13 @@ static int test_org_15(void) } /*- End of function --------------------------------------------------------*/ +static void org_16_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_16(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2567,17 +2715,17 @@ static int test_org_16(void) III.5.4.2.16 980Hz detection Purpose: To confirm correct selection of V.21 reverse mode. Preamble: N/A - Method: The tester sends 980Hz to TUT for 5 seconds. - Pass criteria: 1) TUT should respond with 1650Hz tone after 1.5+-0.1 seconds after start of + Method: The tester sends 980Hz to TUT for 5s. + Pass criteria: 1) TUT should respond with 1650Hz tone after 1.5+-0.1s after start of 980Hz tone. 2) Data should be transmitted and received at 300 bit/s complying with Annex F. Comments: The TUT should indicate that V.21 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_16_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2597,6 +2745,8 @@ static int test_org_16(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2645,9 +2795,13 @@ static int test_org_16(void) } /*- End of function --------------------------------------------------------*/ +static void org_17_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_17(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2662,15 +2816,15 @@ static int test_org_17(void) III.5.4.2.17 Loss of signal after 980Hz Purpose: To confirm that TUT returns to the Monitor 1 state if 980Hz signal disappears. Preamble: N/A - Method: The tester sends 980Hz to TUT for 1.2 seconds followed by silence for 5 seconds. + Method: The tester sends 980Hz to TUT for 1.2s followed by silence for 5s. Pass criteria: TUT should not respond to the 980Hz tone and resume sending CI signals after a - maximum of 2.4 seconds from the end of the 980Hz tone. + maximum of 2.4s from the end of the 980Hz tone. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_17_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2690,6 +2844,8 @@ static int test_org_17(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2738,9 +2894,13 @@ static int test_org_17(void) } /*- End of function --------------------------------------------------------*/ +static void org_18_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_18(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2755,17 +2915,17 @@ static int test_org_18(void) III.5.4.2.18 Tr timer Purpose: To confirm that TUT returns to the Monitor 1 state if Timer Tr expires. Preamble: N/A - Method: The tester sends 980Hz to TUT for 1.2 seconds followed by 1650Hz for 5 seconds + Method: The tester sends 980Hz to TUT for 1.2s followed by 1650Hz for 5s with no pause. - Pass criteria: TUT should respond with 980Hz after 1.3+-0.1 seconds of 1650Hz. - Comments: This implies timer Tr has expired 2 seconds after the start of the 980Hz tone and - then 1650Hz has been detected for 0.5 seconds. + Pass criteria: TUT should respond with 980Hz after 1.3+-0.1s of 1650Hz. + Comments: This implies timer Tr has expired 2s after the start of the 980Hz tone and + then 1650Hz has been detected for 0.5s. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_18_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2785,6 +2945,8 @@ static int test_org_18(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2833,9 +2995,13 @@ static int test_org_18(void) } /*- End of function --------------------------------------------------------*/ +static void org_19_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_19(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2850,16 +3016,16 @@ static int test_org_19(void) III.5.4.2.19 Bell 103 (1270Hz signal) detection Purpose: To confirm correct selection of Bell 103 reverse mode. Preamble: N/A - Method: The tester sends 1270Hz to TUT for 5 seconds. + Method: The tester sends 1270Hz to TUT for 5s. Pass criteria: 1) TUT should respond with 2225Hz tone after 0.7+-0.1 s. 2) Data should be transmitted and received at 300 bit/s complying with Annex D. Comments: The TUT should indicate that Bell 103 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_19_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2879,6 +3045,8 @@ static int test_org_19(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -2927,9 +3095,13 @@ static int test_org_19(void) } /*- End of function --------------------------------------------------------*/ +static void org_20_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_20(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -2956,11 +3128,11 @@ static int test_org_20(void) presence and cadence of the tones for instance by a flashing light. The TUT may disconnect on reception of tones indicating a failed call attempt. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_20_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -2980,6 +3152,8 @@ static int test_org_20(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3028,9 +3202,13 @@ static int test_org_20(void) } /*- End of function --------------------------------------------------------*/ +static void org_21_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_21(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3053,11 +3231,11 @@ static int test_org_21(void) Comments: Some high speed modems may fall back to a compatibility mode, e.g. V.21 or V.23 that should be correctly detected by the TUT. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_21_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3077,6 +3255,8 @@ static int test_org_21(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3125,9 +3305,13 @@ static int test_org_21(void) } /*- End of function --------------------------------------------------------*/ +static void org_22_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_22(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3149,11 +3333,11 @@ static int test_org_22(void) Comments: Ideally the TUT should detect the presence of a fax machine and report it back to the user. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_22_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3173,6 +3357,8 @@ static int test_org_22(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3221,9 +3407,13 @@ static int test_org_22(void) } /*- End of function --------------------------------------------------------*/ +static void org_23_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_23(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3245,11 +3435,11 @@ static int test_org_23(void) Comments: Ideally the TUT should report the presence of speech back to the user, e.g. via circuit 135. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_23_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3269,6 +3459,8 @@ static int test_org_23(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3317,9 +3509,13 @@ static int test_org_23(void) } /*- End of function --------------------------------------------------------*/ +static void org_24_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_24(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3337,17 +3533,17 @@ static int test_org_24(void) Preamble: Make a V.18 call from the TUT. Method: The Test System waits for the TUT to stop transmitting a CI and responds with an ANSam signal. The V.21 demodulator is used to decode the CM sequence. ANSam - should be transmitted for 2 seconds. - Pass criteria: 1) No signal should be transmitted by TUT for 0.5 seconds from detection of + should be transmitted for 2s. + Pass criteria: 1) No signal should be transmitted by TUT for 0.5s from detection of ANSam. 2) The TUT should reply with transmission of CM as defined in 5.2.13. 3) Verify that CM sequence has correct bit pattern. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_24_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3367,6 +3563,8 @@ static int test_org_24(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3415,9 +3613,13 @@ static int test_org_24(void) } /*- End of function --------------------------------------------------------*/ +static void org_25_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_org_25(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3436,11 +3638,11 @@ static int test_org_25(void) Method: The Test System waits for the TUT to start transmitting V.21 carrier (1). Pass criteria: The TUT should connect by sending V.21 carrier (1). */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, org_25_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3460,6 +3662,8 @@ static int test_org_25(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3508,9 +3712,13 @@ static int test_org_25(void) } /*- End of function --------------------------------------------------------*/ +static void ans_01_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_01(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3523,18 +3731,18 @@ static int test_ans_01(void) /* III.5.4.3.1 Ta timer - Purpose: To ensure that on connecting the call, the DCE starts timer Ta (3 seconds) and on + Purpose: To ensure that on connecting the call, the DCE starts timer Ta (3s) and on expiry begins probing. Preamble: N/A Method: The tester makes a call to the TUT and attempts to determine when the TUT answers the call. It will then monitor for any signal. - Pass criteria: The TUT should start probing 3 seconds after answering the call. + Pass criteria: The TUT should start probing 3s after answering the call. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_01_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3554,6 +3762,8 @@ static int test_ans_01(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3602,9 +3812,13 @@ static int test_ans_01(void) } /*- End of function --------------------------------------------------------*/ +static void ans_02_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_02(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3619,18 +3833,18 @@ static int test_ans_02(void) III.5.4.3.2 CI signal detection Purpose: To confirm the correct detection and response to the V.18 CI signal. Preamble: N/A - Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. It will + Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2s. It will monitor for ANS and measure duration. Pass criteria: 1) The TUT should respond after either the first or second CI with ANSam tone. - 2) ANSam tone should remain for 3 seconds +-0.5 s followed by silence. + 2) ANSam tone should remain for 3s+-0.5s followed by silence. Comments: The ANSam tone is a modulated 2100Hz tone. It may have phase reversals. The XCI signal is tested in a separate test. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_02_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3650,6 +3864,8 @@ static int test_ans_02(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3698,9 +3914,13 @@ static int test_ans_02(void) } /*- End of function --------------------------------------------------------*/ +static void ans_03_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_03(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3716,8 +3936,8 @@ static int test_ans_03(void) Purpose: To confirm that the TUT will respond correctly to TXP signals, i.e. by stopping ANSam tone on reception of TXP signal. Preamble: N/A - Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. On - reception of the ANSam tone the tester will wait 0.5 seconds and then begin + Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2s. On + reception of the ANSam tone the tester will wait 0.5s and then begin transmitting the TXP signal in V.21 (1) mode. Pass criteria: 1) On reception of the TXP signal, the TUT should remain silent for 75+-5ms. 2) The TUT should then transmit 3 TXP sequences in V.21(2) mode. @@ -3726,11 +3946,11 @@ static int test_ans_03(void) V.18 mode connection is completed. Comments: The TUT should indicate V.18 mode. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_03_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3750,6 +3970,8 @@ static int test_ans_03(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3798,9 +4020,13 @@ static int test_ans_03(void) } /*- End of function --------------------------------------------------------*/ +static void ans_04_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_04(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3817,14 +4043,14 @@ static int test_ans_04(void) timer Tt expires. Preamble: Successful completion of test ANS-03. Method: After completion of test ANS-03 the tester will continue to monitor for signals. - Pass criteria: The TUT should start probing 3 seconds after ANSam disappears. + Pass criteria: The TUT should start probing 3s after ANSam disappears. Comments: It is assumed that timer Ta is restarted on return to Monitor A. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_04_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3844,6 +4070,8 @@ static int test_ans_04(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3892,9 +4120,13 @@ static int test_ans_04(void) } /*- End of function --------------------------------------------------------*/ +static void ans_05_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_05(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -3910,16 +4142,16 @@ static int test_ans_05(void) Purpose: To check correct detection of V.21 modem lower channel when preceded by answer tone. Preamble: N/A - Method: Tester transmits ANS for 2.5 seconds followed by 75ms of no tone then transmits - 980Hz and starts a 1 s timer. + Method: Tester transmits ANS for 2.5s followed by 75ms of no tone then transmits + 980Hz and starts a 1s timer. Pass criteria: TUT should respond with 1650Hz within 400+-100ms of start of 980Hz. Comments: The TUT should indicate that V.21 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_05_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -3939,6 +4171,8 @@ static int test_ans_05(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -3987,9 +4221,13 @@ static int test_ans_05(void) } /*- End of function --------------------------------------------------------*/ +static void ans_06_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_06(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4005,16 +4243,16 @@ static int test_ans_06(void) Purpose: To check correct detection of V.23 modem upper channel when preceded by answer tone. Preamble: N/A - Method: Tester transmits ANS for 2.5 seconds followed by 75ms of no tone then transmits + Method: Tester transmits ANS for 2.5s followed by 75ms of no tone then transmits 1300Hz and starts a 2-s timer. - Pass criteria: TUT should respond with 390Hz after 1.7(+0.2-0.0) seconds of start of 1300Hz. + Pass criteria: TUT should respond with 390Hz after 1.7(+0.2-0.0)s of start of 1300Hz. Comments: The TUT should indicate that V.23 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_06_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4034,6 +4272,8 @@ static int test_ans_06(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4082,9 +4322,13 @@ static int test_ans_06(void) } /*- End of function --------------------------------------------------------*/ +static void ans_07_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_07(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4100,16 +4344,16 @@ static int test_ans_07(void) Purpose: To check correct detection of V.21 modem upper channel when preceded by answer tone and to confirm discrimination between V.21 and V.18 modes. Preamble: N/A - Method: Tester transmits ANS for 2.5 seconds followed by 75ms of no tone then transmits + Method: Tester transmits ANS for 2.5s followed by 75ms of no tone then transmits 1650Hz and starts a 1-second timer. Pass criteria: TUT should respond with 980Hz within 400+-100ms of start of 1650Hz. Comments: The TUT should indicate that V.21 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_07_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4129,6 +4373,8 @@ static int test_ans_07(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4177,9 +4423,13 @@ static int test_ans_07(void) } /*- End of function --------------------------------------------------------*/ +static void ans_08_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_08(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4200,13 +4450,13 @@ static int test_ans_08(void) Pass criteria: The TUT should respond with the appropriate carrier depending on when it connects. Comments: The TUT should indicate a V.21 connection. The time for which each frequency is - transmitted is random and varies between 0.64 and 2.56 seconds. + transmitted is random and varies between 0.64 and 2.56s. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_08_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4226,6 +4476,8 @@ static int test_ans_08(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4274,9 +4526,13 @@ static int test_ans_08(void) } /*- End of function --------------------------------------------------------*/ +static void ans_09_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_09(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4292,17 +4548,17 @@ static int test_ans_09(void) Purpose: To confirm correct detection of 980Hz calling tones as defined in V.25. Preamble: N/A Method: The tester will send bursts of 980Hz signals (a) 400ms, (b) 500ms, (c) 700ms and - (d) 800ms followed by 1 second of silence. - Pass criteria: 1) The TUT should not respond to bursts of 400 or 800ms. - 2) The TUT should immediately begin probing after a burst of 980Hz for 500 or - 700ms followed by 1 second of silence. + (d) 800ms followed by 1s of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400ms or 800ms. + 2) The TUT should immediately begin probing after a burst of 980Hz for 500ms or + 700ms followed by 1s of silence. Comments: The probe sent by the TUT will depend on the country setting. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_09_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4322,6 +4578,8 @@ static int test_ans_09(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4370,9 +4628,13 @@ static int test_ans_09(void) } /*- End of function --------------------------------------------------------*/ +static void ans_10_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_10(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4388,15 +4650,15 @@ static int test_ans_10(void) Purpose: To confirm correct selection of V.21 calling modem when the received signal is not modulated, i.e. there is no 1180Hz. Preamble: N/A - Method: The tester sends 980Hz to TUT for 2 seconds. - Pass criteria: The TUT should respond with a 1650Hz tone in 1.5+-0.1 seconds. + Method: The tester sends 980Hz to TUT for 2s. + Pass criteria: The TUT should respond with a 1650Hz tone in 1.5+-0.1s. Comments: The TUT should indicate that V.21 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_10_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4416,6 +4678,8 @@ static int test_ans_10(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4464,9 +4728,13 @@ static int test_ans_10(void) } /*- End of function --------------------------------------------------------*/ +static void ans_11_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_11(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4490,11 +4758,11 @@ static int test_ans_11(void) be lost during the detection process. However, the number lost should be minimal. The data bits and parity are specified in Annex C. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_11_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4514,6 +4782,8 @@ static int test_ans_11(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4562,9 +4832,13 @@ static int test_ans_11(void) } /*- End of function --------------------------------------------------------*/ +static void ans_12_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_12(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4589,11 +4863,11 @@ static int test_ans_12(void) (1650Hz) probe. However, it is catered for in V.18. It is more likely that this is where CI or TXP characters would be detected (see test ANS-02). */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_12_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4613,6 +4887,8 @@ static int test_ans_12(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4661,9 +4937,13 @@ static int test_ans_12(void) } /*- End of function --------------------------------------------------------*/ +static void ans_13_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_13(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4677,21 +4957,21 @@ static int test_ans_13(void) /* III.5.4.3.13 Tr timer Purpose: To ensure that the TUT returns to the Monitor A state on expiry of timer Tr - (2 seconds). Timer Tr is started when a modulated V.21 (1) signal is detected. + (2s). Timer Tr is started when a modulated V.21 (1) signal is detected. Preamble: N/A Method: The tester will transmit 980Hz for 200ms followed by alternating 980Hz/1180Hz - at 110 bit/s for 100ms followed by 980Hz for 1 second. - Pass criteria: The TUT should begin probing 4+-0.5 seconds after the 980Hz signal is removed. + at 110 bit/s for 100ms followed by 980Hz for 1s. + Pass criteria: The TUT should begin probing 4+-0.5s after the 980Hz signal is removed. Comments: It is not possible to be precise on timings for this test since the definition of a "modulated signal" as in 5.2.4.4 is not specified. Therefore it is not known exactly when timer Tr will start. It is assumed that timer Ta is restarted on re-entering the Monitor A state. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_13_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4711,6 +4991,8 @@ static int test_ans_13(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4759,9 +5041,13 @@ static int test_ans_13(void) } /*- End of function --------------------------------------------------------*/ +static void ans_14_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_14(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4775,18 +5061,18 @@ static int test_ans_14(void) /* III.5.4.3.14 Te timer Purpose: To ensure that the TUT returns to the Monitor A on expiry of timer Te - (2.7 seconds). Timer Te is started when a 980Hz signal is detected. + (2.7s). Timer Te is started when a 980Hz signal is detected. Preamble: N/A Method: The tester will transmit 980Hz for 200ms followed silence for 7 s. - Pass criteria: The TUT should begin probing 5.5+-0.5 seconds after the 980Hz signal is removed. - Comments: It is assumed that timer Ta (3 seconds) is restarted on re-entering the Monitor A + Pass criteria: The TUT should begin probing 5.5+-0.5s after the 980Hz signal is removed. + Comments: It is assumed that timer Ta (3s) is restarted on re-entering the Monitor A state. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_14_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4806,6 +5092,8 @@ static int test_ans_14(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4854,9 +5142,13 @@ static int test_ans_14(void) } /*- End of function --------------------------------------------------------*/ +static void ans_15_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_15(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4887,11 +5179,11 @@ static int test_ans_15(void) automode answer state. The TUT may then select either 45.45 or 50 bit/s for the transmission. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_15_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -4911,6 +5203,8 @@ static int test_ans_15(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -4959,9 +5253,13 @@ static int test_ans_15(void) } /*- End of function --------------------------------------------------------*/ +static void ans_16_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_16(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -4983,11 +5281,11 @@ static int test_ans_16(void) Comments: The TUT should indicate that it has selected DTMF mode. The DTMF capabilities of the TUT should comply with ITU-T Q.24 for the Danish Administration. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_16_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5007,6 +5305,8 @@ static int test_ans_16(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5055,9 +5355,13 @@ static int test_ans_16(void) } /*- End of function --------------------------------------------------------*/ +static void ans_17_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_17(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5072,15 +5376,15 @@ static int test_ans_17(void) III.5.4.3.17 Bell 103 (1270Hz signal) detection Purpose: To ensure correct detection and selection of Bell 103 modems. Preamble: N/A - Method: The tester sends 1270Hz to TUT for 5 seconds. - Pass criteria: TUT should respond with 2225Hz tone after 0.7+-0.1 s. + Method: The tester sends 1270Hz to TUT for 5s. + Pass criteria: TUT should respond with 2225Hz tone after 0.7+-0.1s. Comments: The TUT should indicate that Bell 103 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_17_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5100,6 +5404,8 @@ static int test_ans_17(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5148,9 +5454,13 @@ static int test_ans_17(void) } /*- End of function --------------------------------------------------------*/ +static void ans_18_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_18(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5165,16 +5475,16 @@ static int test_ans_18(void) III.5.4.3.18 Bell 103 (2225Hz signal) detection Purpose: To ensure correct detection and selection of Bell 103 modems in reverse mode. Preamble: N/A - Method: The tester sends 2225Hz to TUT for 5 seconds. - Pass criteria: The TUT should respond with 1270Hz after 1+-0.2 seconds. + Method: The tester sends 2225Hz to TUT for 5s. + Pass criteria: The TUT should respond with 1270Hz after 1+-0.2s. Comments: The TUT should indicate that Bell 103 mode has been selected. Bell 103 modems use 2225Hz as both answer tone and higher frequency of the upper channel. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_18_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5194,6 +5504,8 @@ static int test_ans_18(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5242,9 +5554,13 @@ static int test_ans_18(void) } /*- End of function --------------------------------------------------------*/ +static void ans_19_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_19(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5259,15 +5575,15 @@ static int test_ans_19(void) III.5.4.3.19 V.21 Reverse mode (1650Hz) detection Purpose: To ensure correct detection and selection of V.21 reverse mode. Preamble: N/A - Method: The tester sends 1650Hz to TUT for 5 seconds. - Pass criteria: The TUT should respond with 980Hz after 0.4+-0.2 seconds. + Method: The tester sends 1650Hz to TUT for 5s. + Pass criteria: The TUT should respond with 980Hz after 0.4+-0.2s. Comments: The TUT should indicate that V.21 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_19_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5287,6 +5603,8 @@ static int test_ans_19(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5335,9 +5653,13 @@ static int test_ans_19(void) } /*- End of function --------------------------------------------------------*/ +static void ans_20_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_20(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5353,17 +5675,17 @@ static int test_ans_20(void) Purpose: To confirm correct detection of 1300Hz calling tones as defined in ITU-T V.25. Preamble: N/A Method: The tester will send 1300Hz bursts of (a) 400ms, (b) 500ms, (c) 700ms and - (d) 800ms followed by 1 second of silence. - Pass criteria: 1) The TUT should not respond to bursts of 400 or 800ms. - 2) The TUT should immediately begin probing after a burst of 1300Hz for 500 or - 700ms followed by 1 second of silence. + (d) 800ms followed by 1s of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400ms or 800ms. + 2) The TUT should immediately begin probing after a burst of 1300Hz for 500ms or + 700ms followed by 1s of silence. Comments: The probe sent by the TUT will depend on the country setting. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_20_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5383,6 +5705,8 @@ static int test_ans_20(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5431,9 +5755,13 @@ static int test_ans_20(void) } /*- End of function --------------------------------------------------------*/ +static void ans_21_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_21(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5448,15 +5776,15 @@ static int test_ans_21(void) III.5.4.3.21 V.23 Reverse mode (1300Hz) detection Purpose: To ensure correct detection and selection of V.23 reverse mode. Preamble: N/A - Method: The tester sends 1300Hz only, with no XCI signals, to TUT for 5 seconds. - Pass criteria: The TUT should respond with 390Hz after 1.7+-0.1 seconds. + Method: The tester sends 1300Hz only, with no XCI signals, to TUT for 5s. + Pass criteria: The TUT should respond with 390Hz after 1.7+-0.1s. Comments: The TUT should indicate that V.23 mode has been selected. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_21_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5476,6 +5804,8 @@ static int test_ans_21(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5524,9 +5854,13 @@ static int test_ans_21(void) } /*- End of function --------------------------------------------------------*/ +static void ans_22_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_22(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5545,11 +5879,11 @@ static int test_ans_22(void) silent for 500ms then transmit the TXP signal in V.21 (1) mode. Pass criteria: The TUT should respond with TXP using V.21 (2) and select V.18 mode. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_22_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5569,6 +5903,8 @@ static int test_ans_22(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5617,9 +5953,13 @@ static int test_ans_22(void) } /*- End of function --------------------------------------------------------*/ +static void ans_23_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_23(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5641,11 +5981,11 @@ static int test_ans_23(void) Pass criteria: The TUT should use the orders described in Appendix I. Comments: The order of the probes is not mandatory. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_23_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5665,6 +6005,8 @@ static int test_ans_23(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5713,9 +6055,13 @@ static int test_ans_23(void) } /*- End of function --------------------------------------------------------*/ +static void ans_24_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_24(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5734,14 +6080,14 @@ static int test_ans_24(void) Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent by the TUT. Pass criteria: The TUT should send the user defined probe message for Annexes A, B, and C - modes followed by a pause of Tm (default 3) seconds. + modes followed by a pause of Tm (default 3)s. Comments: The carrierless modes are those described in Annexes A, B and C. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_24_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5761,6 +6107,8 @@ static int test_ans_24(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5809,9 +6157,13 @@ static int test_ans_24(void) } /*- End of function --------------------------------------------------------*/ +static void ans_25_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_25(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5825,19 +6177,19 @@ static int test_ans_25(void) /* III.5.4.3.25 Interrupted carrierless mode probe Purpose: To ensure that the TUT continues probing from the point of interruption a maximum - of 20 s after a failed connect attempt. + of 20s after a failed connect attempt. Preamble: The TUT should be configured for the UK country setting. Method: The tester will call the TUT, wait for Ta to expire and then during the pause after the first Baudot probe it will send a 200ms burst of 1270Hz followed by silence - for 30 s. + for 30s. Pass criteria: The TUT should transmit silence on detecting the 1270Hz tone and then continue - probing starting with the V.23 probe 20 seconds after the end of the 1270Hz signal. + probing starting with the V.23 probe 20s after the end of the 1270Hz signal. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_25_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5857,6 +6209,8 @@ static int test_ans_25(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -5905,9 +6259,13 @@ static int test_ans_25(void) } /*- End of function --------------------------------------------------------*/ +static void ans_26_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_26(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -5920,20 +6278,20 @@ static int test_ans_26(void) /* III.5.4.3.26 Stimulate carrier mode probe time - Purpose: To ensure that the TUT sends each carrier mode for time Tc (default 6 seconds) + Purpose: To ensure that the TUT sends each carrier mode for time Tc (default 6s) preceded by the correct answer tone. Preamble: None. Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent by the TUT. - Pass criteria: The TUT should send the ANS tone (2100Hz) for 1 second followed by silence for + Pass criteria: The TUT should send the ANS tone (2100Hz) for 1s followed by silence for 75+-5ms and then the 1650Hz, 1300Hz and 2225Hz probes for time Tc. Comments: The carrier modes are those described in Annexes D, E, and F. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_26_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -5953,6 +6311,8 @@ static int test_ans_26(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6001,9 +6361,13 @@ static int test_ans_26(void) } /*- End of function --------------------------------------------------------*/ +static void ans_27_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_27(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6019,21 +6383,21 @@ static int test_ans_27(void) Purpose: To confirm correct selection of V.23 mode. Preamble: N/A Method: The tester waits until the 1300Hz probe is detected from the TUT and then - transmits 390Hz for 11 seconds. - Pass criteria: 1) After 3 seconds of the 390Hz signal the TUT should indicate that V.23 has + transmits 390Hz for 11s. + Pass criteria: 1) After 3s of the 390Hz signal the TUT should indicate that V.23 has been selected. 2) The tester will confirm that the 1300Hz carrier is maintained for at least - 4 seconds beyond the normal probe duration, i.e. Tc (= 6 s default) + 4 s = - 10 seconds total. + 4s beyond the normal probe duration, i.e. Tc (= 6s default) + 4s = + 10s total. Comments: All known V.23 devices need to receive 1300Hz tone before they will respond with 390Hz. When the 1300Hz probe is not being transmitted, a 390Hz tone may be interpreted as a 400Hz network tone. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_27_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6053,6 +6417,8 @@ static int test_ans_27(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6101,9 +6467,13 @@ static int test_ans_27(void) } /*- End of function --------------------------------------------------------*/ +static void ans_28_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_28(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6117,21 +6487,21 @@ static int test_ans_28(void) /* III.5.4.3.28 Interrupted carrier mode probe Purpose: To ensure that the TUT continues probing from the point of interruption a maximum - of 4 s after a failed connect attempt. + of 4s after a failed connect attempt. Preamble: The TUT should be configured for the UK country setting. Method: The tester will call the TUT, wait for Ta to expire and then during the first V.21 - probe it will send a 200ms burst of 1270Hz followed by silence for 30 s. + probe it will send a 200ms burst of 1270Hz followed by silence for 30s. Pass criteria: The TUT should transmit silence on detecting the 1270Hz tone and then continue - probing with the Baudot stored message 4 seconds after the end of the 1270Hz + probing with the Baudot stored message 4s after the end of the 1270Hz burst. - Comments: It is most likely that the TUT will return to probing time Ta (3 seconds) after the + Comments: It is most likely that the TUT will return to probing time Ta (3s) after the 1270Hz tone ceases. This condition needs further clarification. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_28_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6151,6 +6521,8 @@ static int test_ans_28(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6199,9 +6571,13 @@ static int test_ans_28(void) } /*- End of function --------------------------------------------------------*/ +static void ans_29_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_29(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6224,11 +6600,11 @@ static int test_ans_29(void) Comments: The TUT may not respond to any signals while a carrierless mode probe is being sent since these modes are half duplex. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_29_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6248,6 +6624,8 @@ static int test_ans_29(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6296,9 +6674,13 @@ static int test_ans_29(void) } /*- End of function --------------------------------------------------------*/ +static void ans_30_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_30(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6323,11 +6705,11 @@ static int test_ans_30(void) tones may be ignored. Some devices may only provide a visual indication of the presence and cadence of the tones for instance by a flashing light. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_30_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6347,6 +6729,8 @@ static int test_ans_30(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6395,9 +6779,13 @@ static int test_ans_30(void) } /*- End of function --------------------------------------------------------*/ +static void ans_31_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_31(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6413,17 +6801,17 @@ static int test_ans_31(void) Purpose: To determine whether the TUT can discriminate fax calling tones. Preamble: N/A Method: The tester will call the TUT and send the fax calling tone, CNG. This is an 1100Hz - tone with cadence of 0.5 seconds ON and 3 seconds OFF as defined in ITU-T T.30. + tone with cadence of 0.5s ON and 3s OFF as defined in ITU-T T.30. Pass criteria: The TUT should not respond to this signal and may report it as being a calling fax machine. Comments: This is an optional test as detection of the fax calling tone is not required by ITU-T V.18. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_31_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6443,6 +6831,8 @@ static int test_ans_31(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6491,9 +6881,13 @@ static int test_ans_31(void) } /*- End of function --------------------------------------------------------*/ +static void ans_32_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_32(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6515,11 +6909,11 @@ static int test_ans_32(void) Comments: Ideally the TUT should report the presence of speech back to the user. This is an optional test. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_32_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6539,6 +6933,8 @@ static int test_ans_32(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6587,9 +6983,13 @@ static int test_ans_32(void) } /*- End of function --------------------------------------------------------*/ +static void ans_33_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_ans_33(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6605,8 +7005,8 @@ static int test_ans_33(void) Purpose: To confirm that the TUT will respond correctly to CM signals and connect according to V.8 procedures. Preamble: N/A - Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. On - reception of the ANSam tone the tester will wait 0.5 seconds and then begin + Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2s. On + reception of the ANSam tone the tester will wait 0.5s and then begin transmitting the CM signal with textphone and V.21 specified. Pass criteria: 1) On reception of the CM signal, the TUT should transmit JM with textphone and V.21. @@ -6616,11 +7016,11 @@ static int test_ans_33(void) V.18 mode connection is completed. Comments: The TUT should indicate V.18 mode. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, ans_33_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6640,6 +7040,8 @@ static int test_ans_33(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6688,6 +7090,11 @@ static int test_ans_33(void) } /*- End of function --------------------------------------------------------*/ +static void mon_01_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_mon_01(void) { printf("Test not yet implemented\n"); @@ -6695,9 +7102,13 @@ static int test_mon_01(void) } /*- End of function --------------------------------------------------------*/ +static void mon_21_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_mon_21(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6710,18 +7121,18 @@ static int test_mon_21(void) /* III.5.4.4.1 Automode monitor Ta timer test - Purpose: To ensure that on entering monitor mode, timer Ta (3 seconds) is not active and that + Purpose: To ensure that on entering monitor mode, timer Ta (3s) is not active and that the TUT does not enter the probing state. Preamble: N/A Method: The TUT should be put into monitor state. The tester will then monitor for signals for 1 minute. Pass criteria: The TUT should not start probing. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_21_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6741,6 +7152,8 @@ static int test_mon_21(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6789,9 +7202,13 @@ static int test_mon_21(void) } /*- End of function --------------------------------------------------------*/ +static void mon_22_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_mon_22(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6808,18 +7225,18 @@ static int test_mon_22(void) ITU-T V.25. Preamble: N/A Method: The tester will send 1300Hz bursts of (a) 400ms, (b) 500ms, (c) 700ms and - (d) 800ms followed by 1 second of silence. - Pass criteria: 1) The TUT should not respond to bursts of 400 or 800ms. + (d) 800ms followed by 1s of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400ms or 800ms. 2) The TUT should report detection of calling tones to the DTE after a burst of - 1300Hz for 500 or 700ms followed by 1 second of silence. + 1300Hz for 500ms or 700ms followed by 1s of silence. Comments: In automode answer, the 1300Hz calling causes the DCE to start probing. In monitor mode it should only report detection to the DTE. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_22_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6839,6 +7256,8 @@ static int test_mon_22(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6887,9 +7306,13 @@ static int test_mon_22(void) } /*- End of function --------------------------------------------------------*/ +static void mon_23_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_mon_23(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -6906,18 +7329,18 @@ static int test_mon_23(void) ITU-T V.25. Preamble: N/A Method: The tester will send 980Hz bursts of (a) 400ms, (b) 500ms, (c) 700ms and - (d) 800ms followed by 1 second of silence. - Pass criteria: 1) The TUT should not respond to bursts of 400 or 800ms. + (d) 800ms followed by 1s of silence. + Pass criteria: 1) The TUT should not respond to bursts of 400ms or 800ms. 2) The TUT should report detection of calling tones to the DTE after a burst of - 980Hz for 500 or 700ms followed by 1 second of silence. + 980Hz for 500ms or 700ms followed by 1s of silence. Comments: In automode answer, the 980Hz calling causes the DCE to start probing. In monitor mode it should only report detection to the DTE. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, mon_23_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -6937,6 +7360,8 @@ static int test_mon_23(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -6989,7 +7414,7 @@ static void x_01_put_text_msg(void *user_data, const uint8_t *msg, int len) { printf("1-1 %d '%s'\n", len, msg); if (user_data == NULL) - strcat(result[0], (const char *) msg); + strcat(result[1], (const char *) msg); //else // v18_put(v18[1], "abcdefghij", 10); } @@ -7046,6 +7471,8 @@ static int test_x_01(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; v18_put(v18[0], "z", 1); for (i = 0; i < 10000; i++) { @@ -7093,15 +7520,19 @@ static int test_x_01(void) ref = "cdefghij"; printf("Result:\n%s\n", result[0]); printf("Reference result:\n%s\n", ref); - if (unexpected_echo || strcmp(result[0], ref) != 0) + if (unexpected_echo || strcmp(result[1], ref) != 0) return -1; return 1; } /*- End of function --------------------------------------------------------*/ +static void x_02_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_x_02(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -7121,11 +7552,11 @@ static int test_x_02(void) transmit the string "abcdef" at each rate. Pass criteria: The tester will measure the bit timings and confirm the rates. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_02_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -7145,6 +7576,8 @@ static int test_x_02(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -7193,9 +7626,13 @@ static int test_x_02(void) } /*- End of function --------------------------------------------------------*/ +static void x_03_put_text_msg(void *user_data, const uint8_t *msg, int len) +{ +} +/*- End of function --------------------------------------------------------*/ + static int test_x_03(void) { - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -7218,11 +7655,11 @@ static int test_x_03(void) Comments: The probe message must be long enough for the tester to establish the bit rate. "GA" may not be sufficient. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 0); + v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, NULL, (void *) (intptr_t) 1); + v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_USA, x_03_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -7242,6 +7679,8 @@ static int test_x_03(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -7290,24 +7729,27 @@ static int test_x_03(void) } /*- End of function --------------------------------------------------------*/ -static void x_04_put_echo_text_msg(void *user_data, const uint8_t *msg, int len) -{ - printf("Unexpected ECHO received (%d) '%s'\n", len, msg); - unexpected_echo = TRUE; -} -/*- End of function --------------------------------------------------------*/ - static void x_04_put_text_msg(void *user_data, const uint8_t *msg, int len) { + if (user_data == NULL) + { + strcat(result[0], (const char *) msg); +printf("Unexpected ECHO received (%d) '%s'\n", len, msg); + unexpected_echo = TRUE; + } + else + { printf("1-1 %d '%s'\n", len, msg); - strcat(result[0], (const char *) msg); + strcat(result[1], (const char *) msg); + /* Echo each received character */ + //v18_put(v18[1], msg, len); + } } /*- End of function --------------------------------------------------------*/ static int test_x_04(void) { char msg[1024]; - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -7336,11 +7778,11 @@ static int test_x_04(void) assumed that the character conversion is the same for Baudot at 50 bit/s and any other supported speed. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_04_put_echo_text_msg, NULL); + v18[0] = v18_init(NULL, TRUE, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); - v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, NULL); + v18[1] = v18_init(NULL, FALSE, V18_MODE_5BIT_4545 | V18_MODE_REPETITIVE_SHIFTS_OPTION, V18_AUTOMODING_GLOBAL, x_04_put_text_msg, (void *) (intptr_t) 1); logging = v18_get_logging_state(v18[1]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "TUT"); @@ -7360,14 +7802,15 @@ static int test_x_04(void) exit(2); } - result[0][0] = '\0'; + result[0][0] = + result[1][0] = '\0'; unexpected_echo = FALSE; for (i = 0; i < 127; i++) msg[i] = i + 1; msg[127] = '\0'; v18_put(v18[0], msg, 127); - for (i = 0; i < 1000; i++) + for (i = 0; i < 2000; i++) { for (j = 0; j < 2; j++) { @@ -7410,8 +7853,9 @@ static int test_x_04(void) v18_free(v18[0]); v18_free(v18[1]); printf("Result:\n%s\n", result[0]); + printf("Result:\n%s\n", result[1]); printf("Reference result:\n%s\n", full_baudot_rx); - if (unexpected_echo || strcmp(result[0], full_baudot_rx) != 0) + if (unexpected_echo || strcmp(result[1], full_baudot_rx) != 0) return -1; return 0; } @@ -7450,7 +7894,7 @@ static int test_x_05(void) display will show when its receiver is re-enabled. Pass criteria: The receiver should be re-enabled after 300ms. */ - v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, NULL); + v18[0] = v18_init(NULL, TRUE, V18_MODE_DTMF, V18_AUTOMODING_GLOBAL, x_05_put_text_msg, (void *) (intptr_t) 0); logging = v18_get_logging_state(v18[0]); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Tester"); @@ -7474,7 +7918,8 @@ static int test_x_05(void) exit(2); } - result[0][0] = '\0'; + result[0][0] = + result[1][0] = '\0'; v18_put(v18[0], "e", 1); for (i = 0; i < 1000; i++) @@ -7532,6 +7977,7 @@ static int test_x_05(void) static void x_06_put_text_msg(void *user_data, const uint8_t *msg, int len) { if (user_data == NULL) + ; else strcat(result[1], (const char *) msg); } @@ -7540,9 +7986,7 @@ static void x_06_put_text_msg(void *user_data, const uint8_t *msg, int len) static int test_x_06(void) { char msg[128]; - char dtmf[1024]; const char *ref; - v18_state_t *v18[2]; logging_state_t *logging; int16_t amp[2][SAMPLES_PER_CHUNK]; int16_t model_amp[2][SAMPLES_PER_CHUNK]; @@ -7591,12 +8035,13 @@ static int test_x_06(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 127; i++) msg[i] = i + 1; msg[127] = '\0'; - printf("Original:\n%s\n", msg); + v18_put(v18[0], msg, 127); - result[0][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -7707,6 +8152,8 @@ static int test_x_07(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -7806,6 +8253,8 @@ static int test_x_08(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -7908,6 +8357,8 @@ static int test_x_09(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -8013,6 +8464,8 @@ static int test_x_10(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -8116,6 +8569,8 @@ static int test_x_11(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++) @@ -8216,6 +8671,8 @@ static int test_x_12(void) exit(2); } + result[0][0] = + result[1][0] = '\0'; for (i = 0; i < 10000; i++) { for (j = 0; j < 2; j++)