#include "chan_ooh323.h"#include "ootypes.h"#include "ooh323ep.h"#include "oochannels.h"#include "ooCalls.h"#include "ooCapability.h"#include "ooStackCmds.h"


Go to the source code of this file.
Defines | |
| #define | __OO_H323DRIVER_H_ |
| #define | H323_DTMF_H245ALPHANUMERIC (1 << 2) |
| #define | H323_DTMF_H245SIGNAL (1 << 3) |
| #define | H323_DTMF_INBAND (1 << 4) |
| #define | H323_DTMF_Q931 (1 << 1) |
| #define | H323_DTMF_RFC2833 (1 << 0) |
Functions | |
| int | convertH323CapToAsteriskCap (int cap) |
| int | ooh323c_set_capability (struct ast_codec_pref *prefs, int capability, int dtmf) |
| int | ooh323c_set_capability_for_call (ooCallData *call, struct ast_codec_pref *prefs, int capability, int dtmf) |
| int | ooh323c_start_stack_thread (void) |
| int | ooh323c_stop_stack_thread (void) |
| #define __OO_H323DRIVER_H_ |
Definition at line 17 of file ooh323cDriver.h.
| #define H323_DTMF_H245ALPHANUMERIC (1 << 2) |
Definition at line 27 of file ooh323cDriver.h.
Referenced by build_peer(), build_user(), ooh323_digit_begin(), ooh323_show_config(), ooh323_show_peer(), ooh323_show_user(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), and reload_config().
| #define H323_DTMF_H245SIGNAL (1 << 3) |
Definition at line 28 of file ooh323cDriver.h.
Referenced by build_peer(), build_user(), ooh323_digit_begin(), ooh323_show_config(), ooh323_show_peer(), ooh323_show_user(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), and reload_config().
| #define H323_DTMF_INBAND (1 << 4) |
Definition at line 29 of file ooh323cDriver.h.
Referenced by __oh323_new(), oh323_rtp_read(), ooh323_new(), ooh323_rtp_read(), reload_config(), and update_common_options().
| #define H323_DTMF_Q931 (1 << 1) |
Definition at line 26 of file ooh323cDriver.h.
Referenced by build_peer(), build_user(), ooh323_digit_begin(), ooh323_show_config(), ooh323_show_peer(), ooh323_show_user(), and reload_config().
| #define H323_DTMF_RFC2833 (1 << 0) |
Definition at line 25 of file ooh323cDriver.h.
Referenced by build_peer(), build_user(), create_addr(), oh323_alloc(), oh323_digit_begin(), oh323_digit_end(), oh323_request(), oh323_rtp_read(), ooh323_digit_begin(), ooh323_digit_end(), ooh323_rtp_read(), ooh323_show_config(), ooh323_show_peer(), ooh323_show_user(), ooh323c_set_capability(), ooh323c_set_capability_for_call(), reload_config(), and update_common_options().
| int convertH323CapToAsteriskCap | ( | int | cap | ) |
Definition at line 333 of file ooh323cDriver.c.
References AST_FORMAT_ALAW, AST_FORMAT_G723_1, AST_FORMAT_G729A, AST_FORMAT_GSM, AST_FORMAT_H263, AST_FORMAT_ULAW, ast_log(), and LOG_DEBUG.
Referenced by ooh323c_start_receive_channel(), and ooh323c_start_transmit_channel().
00334 { 00335 00336 switch(cap) 00337 { 00338 case OO_G711ULAW64K: 00339 return AST_FORMAT_ULAW; 00340 case OO_G711ALAW64K: 00341 return AST_FORMAT_ALAW; 00342 case OO_GSMFULLRATE: 00343 return AST_FORMAT_GSM; 00344 case OO_G729: 00345 return AST_FORMAT_G729A; 00346 case OO_G729A: 00347 return AST_FORMAT_G729A; 00348 case OO_G7231: 00349 return AST_FORMAT_G723_1; 00350 case OO_H263VIDEO: 00351 return AST_FORMAT_H263; 00352 default: 00353 ast_log(LOG_DEBUG, "Cap %d is not supported by driver yet\n"); 00354 return -1; 00355 } 00356 00357 return -1; 00358 }
| int ooh323c_set_capability | ( | struct ast_codec_pref * | prefs, | |
| int | capability, | |||
| int | dtmf | |||
| ) |
Definition at line 63 of file ooh323cDriver.c.
References ast_codec_pref_index(), AST_FORMAT_ALAW, AST_FORMAT_G723_1, AST_FORMAT_G729A, AST_FORMAT_GSM, AST_FORMAT_H263, AST_FORMAT_ULAW, ast_verbose(), FALSE, format, gH323Debug, grxframes, gtxframes, H323_DTMF_H245ALPHANUMERIC, H323_DTMF_H245SIGNAL, H323_DTMF_RFC2833, ooh323c_start_receive_channel(), ooh323c_start_transmit_channel(), ooh323c_stop_receive_channel(), and ooh323c_stop_transmit_channel().
Referenced by load_module().
00064 { 00065 int ret, x, format=0; 00066 if(gH323Debug) 00067 ast_verbose("\tAdding capabilities to H323 endpoint\n"); 00068 00069 for(x=0; 0 != (format=ast_codec_pref_index(prefs, x)); x++) 00070 { 00071 if(format & AST_FORMAT_ULAW) 00072 { 00073 if(gH323Debug) 00074 ast_verbose("\tAdding g711 ulaw capability to H323 endpoint\n"); 00075 ret= ooH323EpAddG711Capability(OO_G711ULAW64K, gtxframes, grxframes, 00076 OORXANDTX, &ooh323c_start_receive_channel, 00077 &ooh323c_start_transmit_channel, 00078 &ooh323c_stop_receive_channel, 00079 &ooh323c_stop_transmit_channel); 00080 } 00081 if(format & AST_FORMAT_ALAW) 00082 { 00083 if(gH323Debug) 00084 ast_verbose("\tAdding g711 alaw capability to H323 endpoint\n"); 00085 ret= ooH323EpAddG711Capability(OO_G711ALAW64K, gtxframes, grxframes, 00086 OORXANDTX, &ooh323c_start_receive_channel, 00087 &ooh323c_start_transmit_channel, 00088 &ooh323c_stop_receive_channel, 00089 &ooh323c_stop_transmit_channel); 00090 } 00091 00092 if(format & AST_FORMAT_G729A) 00093 { 00094 if(gH323Debug) 00095 ast_verbose("\tAdding g729A capability to H323 endpoint\n"); 00096 ret = ooH323EpAddG729Capability(OO_G729A, 2, 24, 00097 OORXANDTX, &ooh323c_start_receive_channel, 00098 &ooh323c_start_transmit_channel, 00099 &ooh323c_stop_receive_channel, 00100 &ooh323c_stop_transmit_channel); 00101 00102 if(gH323Debug) 00103 ast_verbose("\tAdding g729 capability to H323 endpoint\n"); 00104 ret |= ooH323EpAddG729Capability(OO_G729, 2, 24, 00105 OORXANDTX, &ooh323c_start_receive_channel, 00106 &ooh323c_start_transmit_channel, 00107 &ooh323c_stop_receive_channel, 00108 &ooh323c_stop_transmit_channel); 00109 } 00110 00111 if(format & AST_FORMAT_G723_1) 00112 { 00113 if(gH323Debug) 00114 ast_verbose("\tAdding g7231 capability to H323 endpoint\n"); 00115 ret = ooH323EpAddG7231Capability(OO_G7231, 4, 7, FALSE, 00116 OORXANDTX, &ooh323c_start_receive_channel, 00117 &ooh323c_start_transmit_channel, 00118 &ooh323c_stop_receive_channel, 00119 &ooh323c_stop_transmit_channel); 00120 00121 } 00122 00123 if(format & AST_FORMAT_H263) 00124 { 00125 if(gH323Debug) 00126 ast_verbose("\tAdding h263 capability to H323 endpoint\n"); 00127 ret = ooH323EpAddH263VideoCapability(OO_H263VIDEO, 1, 0, 0, 0, 0, 320*1024, 00128 OORXANDTX, &ooh323c_start_receive_channel, 00129 &ooh323c_start_transmit_channel, 00130 &ooh323c_stop_receive_channel, 00131 &ooh323c_stop_transmit_channel); 00132 00133 } 00134 00135 if(format & AST_FORMAT_GSM) 00136 { 00137 if(gH323Debug) 00138 ast_verbose("\tAdding gsm capability to H323 endpoint\n"); 00139 ret = ooH323EpAddGSMCapability(OO_GSMFULLRATE, 4, FALSE, FALSE, 00140 OORXANDTX, &ooh323c_start_receive_channel, 00141 &ooh323c_start_transmit_channel, 00142 &ooh323c_stop_receive_channel, 00143 &ooh323c_stop_transmit_channel); 00144 00145 } 00146 00147 } 00148 00149 if(dtmf & H323_DTMF_RFC2833) 00150 ret |= ooH323EpEnableDTMFRFC2833(0); 00151 else if(dtmf & H323_DTMF_H245ALPHANUMERIC) 00152 ret |= ooH323EpEnableDTMFH245Alphanumeric(); 00153 else if(dtmf & H323_DTMF_H245SIGNAL) 00154 ret |= ooH323EpEnableDTMFH245Signal(); 00155 00156 return ret; 00157 }
| int ooh323c_set_capability_for_call | ( | ooCallData * | call, | |
| struct ast_codec_pref * | prefs, | |||
| int | capability, | |||
| int | dtmf | |||
| ) |
Definition at line 160 of file ooh323cDriver.c.
References ast_codec_pref_index(), AST_FORMAT_ALAW, AST_FORMAT_G723_1, AST_FORMAT_G729A, AST_FORMAT_GSM, AST_FORMAT_H263, AST_FORMAT_ULAW, ast_verbose(), FALSE, format, ast_codec_pref::framing, gH323Debug, grxframes, H323_DTMF_H245ALPHANUMERIC, H323_DTMF_H245SIGNAL, H323_DTMF_RFC2833, ooh323c_start_receive_channel(), ooh323c_start_transmit_channel(), ooh323c_stop_receive_channel(), and ooh323c_stop_transmit_channel().
Referenced by onNewCallCreated(), and ooh323_onReceivedSetup().
00161 { 00162 int ret, x, txframes, rxframes; 00163 int format=0; 00164 if(gH323Debug) 00165 ast_verbose("\tAdding capabilities to call(%s, %s)\n", call->callType, 00166 call->callToken); 00167 if(dtmf & H323_DTMF_RFC2833) 00168 ret |= ooCallEnableDTMFRFC2833(call,0); 00169 else if(dtmf & H323_DTMF_H245ALPHANUMERIC) 00170 ret |= ooCallEnableDTMFH245Alphanumeric(call); 00171 else if(dtmf & H323_DTMF_H245SIGNAL) 00172 ret |= ooCallEnableDTMFH245Signal(call); 00173 00174 00175 for(x=0; 0 !=(format=ast_codec_pref_index(prefs, x)); x++) 00176 { 00177 if(format & AST_FORMAT_ULAW) 00178 { 00179 if(gH323Debug) 00180 ast_verbose("\tAdding g711 ulaw capability to call(%s, %s)\n", 00181 call->callType, call->callToken); 00182 txframes = prefs->framing[x]; 00183 ret= ooCallAddG711Capability(call, OO_G711ULAW64K, txframes, 00184 grxframes, OORXANDTX, 00185 &ooh323c_start_receive_channel, 00186 &ooh323c_start_transmit_channel, 00187 &ooh323c_stop_receive_channel, 00188 &ooh323c_stop_transmit_channel); 00189 } 00190 if(format & AST_FORMAT_ALAW) 00191 { 00192 if(gH323Debug) 00193 ast_verbose("\tAdding g711 alaw capability to call(%s, %s)\n", 00194 call->callType, call->callToken); 00195 txframes = prefs->framing[x]; 00196 ret= ooCallAddG711Capability(call, OO_G711ALAW64K, txframes, 00197 grxframes, OORXANDTX, 00198 &ooh323c_start_receive_channel, 00199 &ooh323c_start_transmit_channel, 00200 &ooh323c_stop_receive_channel, 00201 &ooh323c_stop_transmit_channel); 00202 } 00203 00204 if(format & AST_FORMAT_G729A) 00205 { 00206 if(gH323Debug) 00207 ast_verbose("\tAdding g729A capability to call(%s, %s)\n", 00208 call->callType, call->callToken); 00209 txframes = (prefs->framing[x])/10; 00210 ret= ooCallAddG729Capability(call, OO_G729A, txframes, 24, 00211 OORXANDTX, &ooh323c_start_receive_channel, 00212 &ooh323c_start_transmit_channel, 00213 &ooh323c_stop_receive_channel, 00214 &ooh323c_stop_transmit_channel); 00215 00216 if(gH323Debug) 00217 ast_verbose("\tAdding g729 capability to call(%s, %s)\n", 00218 call->callType, call->callToken); 00219 ret|= ooCallAddG729Capability(call, OO_G729, txframes, 24, 00220 OORXANDTX, &ooh323c_start_receive_channel, 00221 &ooh323c_start_transmit_channel, 00222 &ooh323c_stop_receive_channel, 00223 &ooh323c_stop_transmit_channel); 00224 } 00225 00226 if(format & AST_FORMAT_G723_1) 00227 { 00228 if(gH323Debug) 00229 ast_verbose("\tAdding g7231 capability to call (%s, %s)\n", 00230 call->callType, call->callToken); 00231 ret = ooCallAddG7231Capability(call, OO_G7231, 4, 7, FALSE, 00232 OORXANDTX, &ooh323c_start_receive_channel, 00233 &ooh323c_start_transmit_channel, 00234 &ooh323c_stop_receive_channel, 00235 &ooh323c_stop_transmit_channel); 00236 00237 } 00238 00239 if(format & AST_FORMAT_H263) 00240 { 00241 if(gH323Debug) 00242 ast_verbose("\tAdding h263 capability to call (%s, %s)\n", 00243 call->callType, call->callToken); 00244 ret = ooCallAddH263VideoCapability(call, OO_H263VIDEO, 1, 0, 0, 0, 0, 320*1024, 00245 OORXANDTX, &ooh323c_start_receive_channel, 00246 &ooh323c_start_transmit_channel, 00247 &ooh323c_stop_receive_channel, 00248 &ooh323c_stop_transmit_channel); 00249 00250 } 00251 00252 if(format & AST_FORMAT_GSM) 00253 { 00254 if(gH323Debug) 00255 ast_verbose("\tAdding gsm capability to call(%s, %s)\n", 00256 call->callType, call->callToken); 00257 ret = ooCallAddGSMCapability(call, OO_GSMFULLRATE, 4, FALSE, FALSE, 00258 OORXANDTX, &ooh323c_start_receive_channel, 00259 &ooh323c_start_transmit_channel, 00260 &ooh323c_stop_receive_channel, 00261 &ooh323c_stop_transmit_channel); 00262 } 00263 } 00264 }
| int ooh323c_start_stack_thread | ( | void | ) |
Definition at line 41 of file ooh323cDriver.c.
References ast_log(), ast_pthread_create, LOG_ERROR, ooh323c_stack_thread(), and ooh323c_thread.
Referenced by load_module().
00042 { 00043 if(ast_pthread_create(&ooh323c_thread, NULL, ooh323c_stack_thread, NULL) < 0) 00044 { 00045 ast_log(LOG_ERROR, "Unable to start ooh323c thread.\n"); 00046 return -1; 00047 } 00048 return 0; 00049 }
| int ooh323c_stop_stack_thread | ( | void | ) |
Definition at line 51 of file ooh323cDriver.c.
References AST_PTHREADT_NULL, and ooh323c_thread.
Referenced by unload_module().
00052 { 00053 if(ooh323c_thread != AST_PTHREADT_NULL) 00054 { 00055 ooStopMonitor(); 00056 pthread_join(ooh323c_thread, NULL); 00057 ooh323c_thread = AST_PTHREADT_NULL; 00058 } 00059 return 0; 00060 }
1.5.9