Properly play a holdtime message if the announce-holdtime option is
[asterisk-bristuff.git] / include / asterisk / fskmodem.h
blobe6d1a54196a49f1bbeb801877f5a2a79987f5f76
1 /*
2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 1999 - 2005, Digium, Inc.
6 * Mark Spencer <markster@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
19 /*! \file
20 * \brief FSK Modem Support
21 * \note Includes code and algorithms from the Zapata library.
22 * \todo Translate Emiliano Zapata's spanish comments to english, please.
25 #ifndef _ASTERISK_FSKMODEM_H
26 #define _ASTERISK_FSKMODEM_H
28 #define PARITY_NONE 0
29 #define PARITY_EVEN 1
30 #define PARITY_ODD 2
33 #define NCOLA 0x4000
35 typedef struct {
36 float spb; /*!< Samples / Bit */
37 int nbit; /*!< Number of Data Bits (5,7,8) */
38 float nstop; /*!< Number of Stop Bits 1,1.5,2 */
39 int paridad; /*!< Parity 0=none 1=even 2=odd */
40 int hdlc; /*!< Modo Packet */
41 float x0;
42 float x1;
43 float x2;
44 float cont;
45 int bw; /*!< Ancho de Banda */
46 double fmxv[8],fmyv[8]; /*!< filter stuff for M filter */
47 int fmp; /*!< pointer for M filter */
48 double fsxv[8],fsyv[8]; /*!< filter stuff for S filter */
49 int fsp; /*!< pointer for S filter */
50 double flxv[8],flyv[8]; /*!< filter stuff for L filter */
51 int flp; /*!< pointer for L filter */
52 int f_mark_idx; /*!< Indice de frecuencia de marca (f_M-500)/5 */
53 int f_space_idx; /*!< Indice de frecuencia de espacio (f_S-500)/5 */
54 int state;
55 int pcola; /*!< Puntero de las colas de datos */
56 float cola_in[NCOLA]; /*!< Cola de muestras de entrada */
57 float cola_filtro[NCOLA]; /*!< Cola de muestras tras filtros */
58 float cola_demod[NCOLA]; /*!< Cola de muestras demoduladas */
59 } fsk_data;
61 /* \brief Retrieve a serial byte into outbyte.
62 Buffer is a pointer into a series of
63 shorts and len records the number of bytes in the buffer. len will be
64 overwritten with the number of bytes left that were not consumed.
65 \return return value is as follows:
66 \arg 0: Still looking for something...
67 \arg 1: An output byte was received and stored in outbyte
68 \arg -1: An error occured in the transmission
69 He must be called with at least 80 bytes of buffer. */
70 int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte);
72 #endif /* _ASTERISK_FSKMODEM_H */