Sat Aug 6 00:39:32 2011

Asterisk developer's documentation


tdd.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 1999 - 2005, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  * \brief TTY/TDD Generation support
00021  * \note Includes code and algorithms from the Zapata library.
00022  */
00023 
00024 #ifndef _ASTERISK_TDD_H
00025 #define _ASTERISK_TDD_H
00026 
00027 #define  TDD_BYTES_PER_CHAR   2700
00028 
00029 struct tdd_state;
00030 typedef struct tdd_state TDDSTATE;
00031 
00032 /*! CallerID Initialization */
00033 /*!
00034  * Initializes the TDD system.  Mostly stuff for inverse FFT
00035  */
00036 void tdd_init(void);
00037 
00038 /*! Generates a CallerID FSK stream in ulaw format suitable for transmission. */
00039 /*!
00040  * \param tdd tdd structure
00041  * \param buf Buffer to use. This needs to be large enough to accomodate all the generated samples.
00042  * \param string This is the string to send.
00043  * This function creates a stream of TDD data in ulaw format. It returns the size
00044  * (in bytes) of the data (if it returns a size of 0, there is probably an error)
00045 */
00046 int tdd_generate(struct tdd_state *tdd, unsigned char *buf, const char *string);
00047 
00048 /*! Create a TDD state machine */
00049 /*!
00050  * This function returns a malloc'd instance of the tdd_state data structure.
00051  * Returns a pointer to a malloc'd tdd_state structure, or NULL on error.
00052  */
00053 struct tdd_state *tdd_new(void);
00054 
00055 /*! Read samples into the state machine, and return character (if any). */
00056 /*!
00057  * \param tdd Which state machine to act upon
00058  * \param ubuf containing your samples
00059  * \param samples number of samples contained within the buffer.
00060  *
00061  * Send received audio to the TDD demodulator.
00062  * Returns -1 on error, 0 for "needs more samples",
00063  * and > 0 (the character) if reception of a character is complete.
00064  */
00065 int tdd_feed(struct tdd_state *tdd, unsigned char *ubuf, int samples);
00066 
00067 /*! Free a TDD state machine */
00068 /*!
00069  * \param tdd This is the tdd_state state machine to free
00070  * This function frees tdd_state tdd.
00071  */
00072 void tdd_free(struct tdd_state *tdd);
00073 
00074 /*! Generate Echo Canceller diable tone (2100HZ) */
00075 /*!
00076  * \param outbuf This is the buffer to receive the tone data
00077  * \param len This is the length (in samples) of the tone data to generate
00078  * Returns 0 if no error, and -1 if error.
00079  */
00080 int ast_tdd_gen_ecdisa(unsigned char *outbuf, int len);
00081 
00082 #endif /* _ASTERISK_TDD_H */

Generated on Sat Aug 6 00:39:32 2011 for Asterisk - the Open Source PBX by  doxygen 1.4.7