00001 /* 00002 * SpanDSP - a series of DSP components for telephony 00003 * 00004 * t38_terminal.h - T.38 termination, less the packet exchange part 00005 * 00006 * Written by Steve Underwood <steveu@coppice.org> 00007 * 00008 * Copyright (C) 2005 Steve Underwood 00009 * 00010 * All rights reserved. 00011 * 00012 * This program is free software; you can redistribute it and/or modify 00013 * it under the terms of the GNU Lesser General Public License version 2.1, 00014 * as published by the Free Software Foundation. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00024 * 00025 * $Id: t38_terminal.h,v 1.41 2009/02/03 16:28:41 steveu Exp $ 00026 */ 00027 00028 /*! \file */ 00029 00030 #if !defined(_SPANDSP_T38_TERMINAL_H_) 00031 #define _SPANDSP_T38_TERMINAL_H_ 00032 00033 /*! \page t38_terminal_page T.38 real time FAX over IP termination 00034 \section t38_terminal_page_sec_1 What does it do? 00035 00036 \section t38_terminal_page_sec_2 How does it work? 00037 */ 00038 00039 /* Make sure the HDLC frame buffers are big enough for ECM frames. */ 00040 #define T38_MAX_HDLC_LEN 260 00041 00042 typedef struct t38_terminal_state_s t38_terminal_state_t; 00043 00044 #if defined(__cplusplus) 00045 extern "C" 00046 { 00047 #endif 00048 00049 SPAN_DECLARE(int) t38_terminal_send_timeout(t38_terminal_state_t *s, int samples); 00050 00051 SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int without_pacing); 00052 00053 /*! Select whether the time for talker echo protection tone will be allowed for when sending. 00054 \brief Select whether TEP time will be allowed for. 00055 \param s The T.38 context. 00056 \param use_tep TRUE if TEP should be allowed for. 00057 */ 00058 SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep); 00059 00060 /*! Select whether non-ECM fill bits are to be removed during transmission. 00061 \brief Select whether non-ECM fill bits are to be removed during transmission. 00062 \param s The T.38 context. 00063 \param remove TRUE if fill bits are to be removed. 00064 */ 00065 SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove); 00066 00067 /*! Get a pointer to the T.30 engine associated with a termination mode T.38 context. 00068 \brief Get a pointer to the T.30 engine associated with a T.38 context. 00069 \param s The T.38 context. 00070 \return A pointer to the T.30 context, or NULL. 00071 */ 00072 SPAN_DECLARE(t30_state_t *) t38_terminal_get_t30_state(t38_terminal_state_t *s); 00073 00074 /*! Get a pointer to the T.38 core IFP packet engine associated with a 00075 termination mode T.38 context. 00076 \brief Get a pointer to the T.38 core IFP packet engine associated 00077 with a T.38 context. 00078 \param s The T.38 context. 00079 \return A pointer to the T.38 core context, or NULL. 00080 */ 00081 SPAN_DECLARE(t38_core_state_t *) t38_terminal_get_t38_core_state(t38_terminal_state_t *s); 00082 00083 /*! Get a pointer to the logging context associated with a T.38 context. 00084 \brief Get a pointer to the logging context associated with a T.38 context. 00085 \param s The T.38 context. 00086 \return A pointer to the logging context, or NULL. 00087 */ 00088 SPAN_DECLARE(logging_state_t *) t38_terminal_get_logging_state(t38_terminal_state_t *s); 00089 00090 /*! \brief Initialise a termination mode T.38 context. 00091 \param s The T.38 context. 00092 \param calling_party TRUE if the context is for a calling party. FALSE if the 00093 context is for an answering party. 00094 \param tx_packet_handler A callback routine to encapsulate and transmit T.38 packets. 00095 \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine. 00096 \return A pointer to the termination mode T.38 context, or NULL if there was a problem. */ 00097 SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s, 00098 int calling_party, 00099 t38_tx_packet_handler_t *tx_packet_handler, 00100 void *tx_packet_user_data); 00101 00102 /*! Release a termination mode T.38 context. 00103 \brief Release a T.38 context. 00104 \param s The T.38 context. 00105 \return 0 for OK, else -1. */ 00106 SPAN_DECLARE(int) t38_terminal_release(t38_terminal_state_t *s); 00107 00108 /*! Free a a termination mode T.38 context. 00109 \brief Free a T.38 context. 00110 \param s The T.38 context. 00111 \return 0 for OK, else -1. */ 00112 SPAN_DECLARE(int) t38_terminal_free(t38_terminal_state_t *s); 00113 00114 #if defined(__cplusplus) 00115 } 00116 #endif 00117 00118 #endif 00119 /*- End of file ------------------------------------------------------------*/