Fri Jun 19 12:09:53 2009

Asterisk developer's documentation


udptl.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- A telephony toolkit for Linux.
00003  *
00004  * UDPTL support for T.38
00005  * 
00006  * Copyright (C) 2005, Steve Underwood, partly based on RTP code which is
00007  * Copyright (C) 1999-2004, Digium, Inc.
00008  *
00009  * Steve Underwood <steveu@coppice.org>
00010  *
00011  * This program is free software, distributed under the terms of
00012  * the GNU General Public License
00013  *
00014  * A license has been granted to Digium (via disclaimer) for the use of
00015  * this code.
00016  */
00017 
00018 /*! \file
00019  * \brief UDPTL support for T.38
00020  * \author Steve Underwood <steveu@coppice.org>
00021  * \ref udptl.c
00022  * \todo add doxygen documentation to this file!
00023  */
00024 
00025 
00026 #ifndef _ASTERISK_UDPTL_H
00027 #define _ASTERISK_UDPTL_H
00028 
00029 #include "asterisk/network.h"
00030 #include "asterisk/frame.h"
00031 #include "asterisk/io.h"
00032 #include "asterisk/sched.h"
00033 #include "asterisk/channel.h"
00034 
00035 
00036 enum {
00037     UDPTL_ERROR_CORRECTION_NONE,
00038     UDPTL_ERROR_CORRECTION_FEC,
00039     UDPTL_ERROR_CORRECTION_REDUNDANCY
00040 };
00041 
00042 #if defined(__cplusplus) || defined(c_plusplus)
00043 extern "C" {
00044 #endif
00045 
00046 struct ast_udptl_protocol {
00047    /*! \brief Get UDPTL struct, or NULL if unwilling to transfer */
00048    struct ast_udptl *(*get_udptl_info)(struct ast_channel *chan);
00049    /*! \brief Set UDPTL peer */
00050    int (* const set_udptl_peer)(struct ast_channel *chan, struct ast_udptl *peer);
00051    const char * const type;
00052    AST_RWLIST_ENTRY(ast_udptl_protocol) list;
00053 };
00054 
00055 struct ast_udptl;
00056 
00057 typedef int (*ast_udptl_callback)(struct ast_udptl *udptl, struct ast_frame *f, void *data);
00058 
00059 struct ast_udptl *ast_udptl_new(struct sched_context *sched, struct io_context *io, int callbackmode);
00060 
00061 struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int callbackmode, struct in_addr in);
00062 
00063 void ast_udptl_set_peer(struct ast_udptl *udptl, struct sockaddr_in *them);
00064 
00065 void ast_udptl_get_peer(struct ast_udptl *udptl, struct sockaddr_in *them);
00066 
00067 void ast_udptl_get_us(struct ast_udptl *udptl, struct sockaddr_in *us);
00068 
00069 void ast_udptl_destroy(struct ast_udptl *udptl);
00070 
00071 void ast_udptl_reset(struct ast_udptl *udptl);
00072 
00073 void ast_udptl_set_callback(struct ast_udptl *udptl, ast_udptl_callback callback);
00074 
00075 void ast_udptl_set_data(struct ast_udptl *udptl, void *data);
00076 
00077 int ast_udptl_write(struct ast_udptl *udptl, struct ast_frame *f);
00078 
00079 struct ast_frame *ast_udptl_read(struct ast_udptl *udptl);
00080 
00081 int ast_udptl_fd(struct ast_udptl *udptl);
00082 
00083 int ast_udptl_setqos(struct ast_udptl *udptl, int tos, int cos);
00084 
00085 void ast_udptl_set_m_type(struct ast_udptl* udptl, int pt);
00086 
00087 void ast_udptl_set_udptlmap_type(struct ast_udptl* udptl, int pt,
00088           char* mimeType, char* mimeSubtype);
00089 
00090 int ast_udptl_lookup_code(struct ast_udptl* udptl, int isAstFormat, int code);
00091 
00092 void ast_udptl_offered_from_local(struct ast_udptl* udptl, int local);
00093 
00094 int ast_udptl_get_error_correction_scheme(struct ast_udptl* udptl);
00095 
00096 void ast_udptl_set_error_correction_scheme(struct ast_udptl* udptl, int ec);
00097 
00098 int ast_udptl_get_local_max_datagram(struct ast_udptl* udptl);
00099 
00100 void ast_udptl_set_local_max_datagram(struct ast_udptl* udptl, int max_datagram);
00101 
00102 int ast_udptl_get_far_max_datagram(struct ast_udptl* udptl);
00103 
00104 void ast_udptl_set_far_max_datagram(struct ast_udptl* udptl, int max_datagram);
00105 
00106 void ast_udptl_get_current_formats(struct ast_udptl* udptl,
00107               int* astFormats, int* nonAstFormats);
00108 
00109 void ast_udptl_setnat(struct ast_udptl *udptl, int nat);
00110 
00111 int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc);
00112 
00113 int ast_udptl_proto_register(struct ast_udptl_protocol *proto);
00114 
00115 void ast_udptl_proto_unregister(struct ast_udptl_protocol *proto);
00116 
00117 void ast_udptl_stop(struct ast_udptl *udptl);
00118 
00119 void ast_udptl_init(void);
00120 
00121 /*!
00122  * \version 1.6.1 return changed to int
00123  */
00124 int ast_udptl_reload(void);
00125 
00126 #if defined(__cplusplus) || defined(c_plusplus)
00127 }
00128 #endif
00129 
00130 #endif

Generated on Fri Jun 19 12:09:53 2009 for Asterisk - the Open Source PBX by  doxygen 1.4.7