Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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 ast_t38_ec_modes {
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
00048 struct ast_udptl *(*get_udptl_info)(struct ast_channel *chan);
00049
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
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076 void __attribute__((format(printf, 2, 3))) ast_udptl_set_tag(struct ast_udptl *udptl, const char *format, ...);
00077
00078 void ast_udptl_set_peer(struct ast_udptl *udptl, const struct sockaddr_in *them);
00079
00080 void ast_udptl_get_peer(const struct ast_udptl *udptl, struct sockaddr_in *them);
00081
00082 void ast_udptl_get_us(const struct ast_udptl *udptl, struct sockaddr_in *us);
00083
00084 void ast_udptl_destroy(struct ast_udptl *udptl);
00085
00086 void ast_udptl_reset(struct ast_udptl *udptl);
00087
00088 void ast_udptl_set_callback(struct ast_udptl *udptl, ast_udptl_callback callback);
00089
00090 void ast_udptl_set_data(struct ast_udptl *udptl, void *data);
00091
00092 int ast_udptl_write(struct ast_udptl *udptl, struct ast_frame *f);
00093
00094 struct ast_frame *ast_udptl_read(struct ast_udptl *udptl);
00095
00096 int ast_udptl_fd(const struct ast_udptl *udptl);
00097
00098 int ast_udptl_setqos(struct ast_udptl *udptl, unsigned int tos, unsigned int cos);
00099
00100 void ast_udptl_set_m_type(struct ast_udptl *udptl, unsigned int pt);
00101
00102 void ast_udptl_set_udptlmap_type(struct ast_udptl *udptl, unsigned int pt,
00103 char *mimeType, char *mimeSubtype);
00104
00105 enum ast_t38_ec_modes ast_udptl_get_error_correction_scheme(const struct ast_udptl *udptl);
00106
00107 void ast_udptl_set_error_correction_scheme(struct ast_udptl *udptl, enum ast_t38_ec_modes ec);
00108
00109 void ast_udptl_set_local_max_ifp(struct ast_udptl *udptl, unsigned int max_ifp);
00110
00111
00112
00113
00114
00115
00116
00117 unsigned int ast_udptl_get_local_max_datagram(struct ast_udptl *udptl);
00118
00119
00120
00121
00122
00123 void ast_udptl_set_far_max_datagram(struct ast_udptl *udptl, unsigned int max_datagram);
00124
00125 unsigned int ast_udptl_get_far_max_datagram(const struct ast_udptl *udptl);
00126
00127
00128
00129
00130
00131
00132
00133 unsigned int ast_udptl_get_far_max_ifp(struct ast_udptl *udptl);
00134
00135 void ast_udptl_setnat(struct ast_udptl *udptl, int nat);
00136
00137 int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags,
00138 struct ast_frame **fo, struct ast_channel **rc);
00139
00140 int ast_udptl_proto_register(struct ast_udptl_protocol *proto);
00141
00142 void ast_udptl_proto_unregister(struct ast_udptl_protocol *proto);
00143
00144 void ast_udptl_stop(struct ast_udptl *udptl);
00145
00146 void ast_udptl_init(void);
00147
00148
00149
00150
00151 int ast_udptl_reload(void);
00152
00153 #if defined(__cplusplus) || defined(c_plusplus)
00154 }
00155 #endif
00156
00157 #endif