#include <inttypes.h>#include <stdlib.h>#include <stdio.h>#include <fcntl.h>#include <time.h>#include <string.h>#include "floating_fudge.h"#include <assert.h>#include <memory.h>#include <tiffio.h>#include "spandsp/telephony.h"#include "spandsp/logging.h"#include "spandsp/bit_operations.h"#include "spandsp/t38_core.h"Defines | |
| #define | ACCEPTABLE_SEQ_NO_OFFSET 2000 |
Functions | |
| const char * | t38_indicator_to_str (int indicator) |
| Convert the code for an indicator to a short text name. | |
| const char * | t38_data_type_to_str (int data_type) |
| Convert the code for a type of data to a short text name. | |
| const char * | t38_field_type_to_str (int field_type) |
| Convert the code for a type of data field to a short text name. | |
| const char * | t38_cm_profile_to_str (int profile) |
| Convert the code for a CM profile code to text description. | |
| const char * | t38_jm_to_str (const uint8_t *data, int len) |
| Convert a JM message code to text description. | |
| int | t38_v34rate_to_bps (const uint8_t *data, int len) |
| Convert a V34rate message to an actual bit rate. | |
| int | t38_core_rx_ifp_packet (t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no) |
| Process a received T.38 IFP packet. | |
| int | t38_core_send_indicator (t38_core_state_t *s, int indicator, int count) |
| Send an indicator packet. | |
| int | t38_core_send_data (t38_core_state_t *s, int data_type, int field_type, const uint8_t field[], int field_len, int count) |
| Send a data packet. | |
| int | t38_core_send_data_multi_field (t38_core_state_t *s, int data_type, const t38_data_field_t field[], int fields, int count) |
| Send a data packet. | |
| void | t38_set_data_rate_management_method (t38_core_state_t *s, int method) |
| void | t38_set_data_transport_protocol (t38_core_state_t *s, int data_transport_protocol) |
| void | t38_set_fill_bit_removal (t38_core_state_t *s, int fill_bit_removal) |
| void | t38_set_mmr_transcoding (t38_core_state_t *s, int mmr_transcoding) |
| void | t38_set_jbig_transcoding (t38_core_state_t *s, int jbig_transcoding) |
| void | t38_set_max_buffer_size (t38_core_state_t *s, int max_buffer_size) |
| void | t38_set_max_datagram_size (t38_core_state_t *s, int max_datagram_size) |
| void | t38_set_t38_version (t38_core_state_t *s, int t38_version) |
| void | t38_set_sequence_number_handling (t38_core_state_t *s, int check) |
| int | t38_get_fastest_image_data_rate (t38_core_state_t *s) |
| t38_core_state_t * | t38_core_init (t38_core_state_t *s, t38_rx_indicator_handler_t *rx_indicator_handler, t38_rx_data_handler_t *rx_data_handler, t38_rx_missing_handler_t *rx_missing_handler, void *rx_user_data, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) |
| const char* t38_cm_profile_to_str | ( | int | profile | ) |
Convert the code for a CM profile code to text description.
| profile | The profile code from a CM message. |
| int t38_core_rx_ifp_packet | ( | t38_core_state_t * | s, | |
| const uint8_t * | buf, | |||
| int | len, | |||
| uint16_t | seq_no | |||
| ) |
Process a received T.38 IFP packet.
| s | The T.38 context. | |
| buf | The packet contents. | |
| len | The length of the packet contents. | |
| seq_no | The packet sequence number. |
References t38_core_state_s::check_sequence_numbers, t38_core_state_s::current_rx_data_type, t38_core_state_s::current_rx_field_type, t38_core_state_s::current_rx_indicator, t38_core_state_s::logging, t38_core_state_s::missing_packets, t38_core_state_s::rx_data_handler, t38_core_state_s::rx_expected_seq_no, t38_core_state_s::rx_indicator_handler, t38_core_state_s::rx_missing_handler, t38_core_state_s::rx_user_data, span_log(), span_log_buf(), span_log_test(), t38_data_type_to_str(), t38_field_type_to_str(), t38_indicator_to_str(), and t38_core_state_s::t38_version.
| int t38_core_send_data | ( | t38_core_state_t * | s, | |
| int | data_type, | |||
| int | field_type, | |||
| const uint8_t | field[], | |||
| int | field_len, | |||
| int | count | |||
| ) |
Send a data packet.
| s | The T.38 context. | |
| data_type | The packet's data type. | |
| field_type | The packet's field type. | |
| field | The message data content for the packet. | |
| field_len | The length of the message data, in bytes. | |
| count | The number of copies of the packet to send. |
References t38_data_field_t::field, t38_data_field_t::field_len, t38_data_field_t::field_type, t38_core_state_s::logging, span_log(), t38_core_state_s::tx_packet_handler, t38_core_state_s::tx_packet_user_data, and t38_core_state_s::tx_seq_no.
| int t38_core_send_data_multi_field | ( | t38_core_state_t * | s, | |
| int | data_type, | |||
| const t38_data_field_t | field[], | |||
| int | fields, | |||
| int | count | |||
| ) |
Send a data packet.
| s | The T.38 context. | |
| data_type | The packet's data type. | |
| field | The list of fields. | |
| fields | The number of fields in the list. | |
| count | The number of copies of the packet to send. |
References t38_core_state_s::logging, span_log(), t38_core_state_s::tx_packet_handler, t38_core_state_s::tx_packet_user_data, and t38_core_state_s::tx_seq_no.
| int t38_core_send_indicator | ( | t38_core_state_t * | s, | |
| int | indicator, | |||
| int | count | |||
| ) |
Send an indicator packet.
| s | The T.38 context. | |
| indicator | The indicator to send. | |
| count | The number of copies of the packet to send. |
References t38_core_state_s::current_tx_indicator, t38_core_state_s::logging, span_log(), t38_indicator_to_str(), t38_core_state_s::tx_packet_handler, t38_core_state_s::tx_packet_user_data, and t38_core_state_s::tx_seq_no.
| const char* t38_data_type_to_str | ( | int | data_type | ) |
Convert the code for a type of data to a short text name.
| data_type | The data type. |
Referenced by t38_core_rx_ifp_packet().
| const char* t38_field_type_to_str | ( | int | field_type | ) |
Convert the code for a type of data field to a short text name.
| field_type | The field type. |
Referenced by t38_core_rx_ifp_packet().
| const char* t38_indicator_to_str | ( | int | indicator | ) |
Convert the code for an indicator to a short text name.
| indicator | The type of indicator. |
Referenced by t38_core_rx_ifp_packet(), and t38_core_send_indicator().
| const char* t38_jm_to_str | ( | const uint8_t * | data, | |
| int | len | |||
| ) |
Convert a JM message code to text description.
| data | The data field of the message. | |
| len | The length of the data field. |
| void t38_set_data_rate_management_method | ( | t38_core_state_t * | s, | |
| int | method | |||
| ) |
Set the method to be used for data rate management, as per the T.38 spec.
| s | The T.38 context. | |
| method | 1 for pass TCF across the T.38 link, 2 for handle TCF locally. |
References t38_core_state_s::data_rate_management_method.
| void t38_set_data_transport_protocol | ( | t38_core_state_t * | s, | |
| int | data_transport_protocol | |||
| ) |
Set the data transport protocol.
| s | The T.38 context. | |
| data_transport_protocol | UDPTL, RTP or TPKT. |
References t38_core_state_s::data_transport_protocol.
| void t38_set_fill_bit_removal | ( | t38_core_state_t * | s, | |
| int | fill_bit_removal | |||
| ) |
Set the non-ECM fill bit removal mode.
| s | The T.38 context. | |
| fill_bit_removal | TRUE to remove fill bits across the T.38 link, else FALSE. |
References t38_core_state_s::fill_bit_removal.
| void t38_set_jbig_transcoding | ( | t38_core_state_t * | s, | |
| int | jbig_transcoding | |||
| ) |
Set the JBIG transcoding mode.
| s | The T.38 context. | |
| jbig_transcoding | TRUE to transcode to JBIG across the T.38 link, else FALSE. |
References t38_core_state_s::jbig_transcoding.
| void t38_set_mmr_transcoding | ( | t38_core_state_t * | s, | |
| int | mmr_transcoding | |||
| ) |
Set the MMR transcoding mode.
| s | The T.38 context. | |
| mmr_transcoding | TRUE to transcode to MMR across the T.38 link, else FALSE. |
References t38_core_state_s::mmr_transcoding.
| void t38_set_t38_version | ( | t38_core_state_t * | s, | |
| int | t38_version | |||
| ) |
Set the T.38 version to be emulated.
| s | The T.38 context. | |
| t38_version | Version number, as in the T.38 spec. |
References t38_core_state_s::t38_version.
| int t38_v34rate_to_bps | ( | const uint8_t * | data, | |
| int | len | |||
| ) |
Convert a V34rate message to an actual bit rate.
| data | The data field of the message. | |
| len | The length of the data field. |
1.5.6