udptl.h
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 #include "asterisk/netsock2.h"
00035
00036
00037 enum ast_t38_ec_modes {
00038 UDPTL_ERROR_CORRECTION_NONE,
00039 UDPTL_ERROR_CORRECTION_FEC,
00040 UDPTL_ERROR_CORRECTION_REDUNDANCY
00041 };
00042
00043 #if defined(__cplusplus) || defined(c_plusplus)
00044 extern "C" {
00045 #endif
00046
00047 struct ast_udptl_protocol {
00048
00049 struct ast_udptl *(*get_udptl_info)(struct ast_channel *chan);
00050
00051 int (* const set_udptl_peer)(struct ast_channel *chan, struct ast_udptl *peer);
00052 const char * const type;
00053 AST_RWLIST_ENTRY(ast_udptl_protocol) list;
00054 };
00055
00056 struct ast_udptl;
00057
00058 typedef int (*ast_udptl_callback)(struct ast_udptl *udptl, struct ast_frame *f, void *data);
00059
00060 struct ast_udptl *ast_udptl_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int callbackmode, struct ast_sockaddr *in);
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 void __attribute__((format(printf, 2, 3))) ast_udptl_set_tag(struct ast_udptl *udptl, const char *format, ...);
00076
00077 void ast_udptl_set_peer(struct ast_udptl *udptl, const struct ast_sockaddr *them);
00078
00079 void ast_udptl_get_peer(const struct ast_udptl *udptl, struct ast_sockaddr *them);
00080
00081 void ast_udptl_get_us(const struct ast_udptl *udptl, struct ast_sockaddr *us);
00082
00083 void ast_udptl_destroy(struct ast_udptl *udptl);
00084
00085 void ast_udptl_reset(struct ast_udptl *udptl);
00086
00087 void ast_udptl_set_callback(struct ast_udptl *udptl, ast_udptl_callback callback);
00088
00089 void ast_udptl_set_data(struct ast_udptl *udptl, void *data);
00090
00091 int ast_udptl_write(struct ast_udptl *udptl, struct ast_frame *f);
00092
00093 struct ast_frame *ast_udptl_read(struct ast_udptl *udptl);
00094
00095 int ast_udptl_fd(const struct ast_udptl *udptl);
00096
00097 int ast_udptl_setqos(struct ast_udptl *udptl, unsigned int tos, unsigned int cos);
00098
00099 void ast_udptl_set_m_type(struct ast_udptl *udptl, unsigned int pt);
00100
00101 void ast_udptl_set_udptlmap_type(struct ast_udptl *udptl, unsigned int pt,
00102 char *mimeType, char *mimeSubtype);
00103
00104 enum ast_t38_ec_modes ast_udptl_get_error_correction_scheme(const struct ast_udptl *udptl);
00105
00106 void ast_udptl_set_error_correction_scheme(struct ast_udptl *udptl, enum ast_t38_ec_modes ec);
00107
00108 void ast_udptl_set_local_max_ifp(struct ast_udptl *udptl, unsigned int max_ifp);
00109
00110
00111
00112
00113
00114
00115
00116 unsigned int ast_udptl_get_local_max_datagram(struct ast_udptl *udptl);
00117
00118
00119
00120
00121
00122 void ast_udptl_set_far_max_datagram(struct ast_udptl *udptl, unsigned int max_datagram);
00123
00124 unsigned int ast_udptl_get_far_max_datagram(const struct ast_udptl *udptl);
00125
00126
00127
00128
00129
00130
00131
00132 unsigned int ast_udptl_get_far_max_ifp(struct ast_udptl *udptl);
00133
00134 void ast_udptl_setnat(struct ast_udptl *udptl, int nat);
00135
00136 int ast_udptl_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags,
00137 struct ast_frame **fo, struct ast_channel **rc);
00138
00139 int ast_udptl_proto_register(struct ast_udptl_protocol *proto);
00140
00141 void ast_udptl_proto_unregister(struct ast_udptl_protocol *proto);
00142
00143 void ast_udptl_stop(struct ast_udptl *udptl);
00144
00145 void ast_udptl_init(void);
00146
00147
00148
00149
00150 int ast_udptl_reload(void);
00151
00152 #if defined(__cplusplus) || defined(c_plusplus)
00153 }
00154 #endif
00155
00156 #endif