Asterisk - The Open Source Telephony Project GIT-master-67613d1
Macros | Functions | Variables
eagi_proxy.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
#include <errno.h>
#include <ctype.h>
#include <pthread.h>
Include dependency graph for eagi_proxy.c:

Go to the source code of this file.

Macros

#define BUFSIZE   1024
 
#define COMMAND_PORT   8417
 
#define SEND_ENVIORNMENT   /*send the enviornment thru the socket*/
 
#define SIGNAL_PORT   8418
 
#define WINBUF_NUM   2400 /* number of WINSIZE windows = 1 minute */
 
#define WINSIZE   400 /* 25 ms @ 8 kHz and 16bit */
 

Functions

int connect_to_host (char *host, int port)
 
void finalize ()
 
int main ()
 
void read_full (int file, char *buffer, int num)
 
int read_some (int file, char *buffer, int size)
 
void * readSignal (void *ptr)
 
void * readStdin (void *ptr)
 
void setnonblocking (int desc)
 
int write_amap (int file, char *buffer, int num)
 
void write_buf (int file, char *buffer, int num)
 

Variables

char * be
 
char * bs
 
char buf [BUFSIZE]
 
int command_desc
 
pthread_mutex_t command_mutex
 
char connected =1
 
char * end
 
pthread_t signal_thread
 
int speech_desc
 
pthread_t stdin_thread
 
char * winbuf
 
char window [WINSIZE]
 

Macro Definition Documentation

◆ BUFSIZE

#define BUFSIZE   1024

Definition at line 65 of file eagi_proxy.c.

◆ COMMAND_PORT

#define COMMAND_PORT   8417

Definition at line 60 of file eagi_proxy.c.

◆ SEND_ENVIORNMENT

#define SEND_ENVIORNMENT   /*send the enviornment thru the socket*/

Definition at line 61 of file eagi_proxy.c.

◆ SIGNAL_PORT

#define SIGNAL_PORT   8418

Definition at line 59 of file eagi_proxy.c.

◆ WINBUF_NUM

#define WINBUF_NUM   2400 /* number of WINSIZE windows = 1 minute */

Definition at line 71 of file eagi_proxy.c.

◆ WINSIZE

#define WINSIZE   400 /* 25 ms @ 8 kHz and 16bit */

Definition at line 68 of file eagi_proxy.c.

Function Documentation

◆ connect_to_host()

int connect_to_host ( char *  host,
int  port 
)

Definition at line 217 of file eagi_proxy.c.

218{
219 int address;
220 struct hostent* host_entity;
221 int res,desc;
222 int opts;
223 struct sockaddr_in host;
224
225
226 /* get address */
227 if(!strcmp(name,"localhost"))
228 address=htonl(2130706433); /*127.0.0.1*/
229 else
230 {
231 address=inet_addr(name); /* check if it's an IP that's written in the string */
232 if(address==(in_addr_t)-1)
233 {
234 host_entity = gethostbyname(name); /* search for the host under this name */
235
236 if(!host_entity)
237 {
238 fprintf(stderr,"EAGI proxy: Wrong address!\n"); /* can't find anything*/
239 return -1;
240 }
241 address=*((int*)host_entity->h_addr);
242 }
243 }
244
245 desc=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
246 if(desc<0)
247 {
248 fprintf(stderr,"EAGI proxy: Cannot create socket!\n");
249 return -1;
250 }
251
252 memset((void*)&host,0,sizeof(struct sockaddr_in));
253
254 host.sin_family=AF_INET;
255 host.sin_port=htons(port);
256 host.sin_addr.s_addr=address;
257
258 res=connect(desc,(struct sockaddr*)&host,sizeof(host));
259 if(res<0)
260 {
261 fprintf(stderr,"EAGI proxy: Cannot connect!\n");
262 return -1;
263 }
264
265 /* set to non-blocking mode */
266 opts = fcntl(desc,F_GETFL);
267 if (opts < 0) {
268 perror("fcntl(F_GETFL)");
269 exit(EXIT_FAILURE);
270 }
271 opts = (opts | O_NONBLOCK);
272 if (fcntl(desc,F_SETFL,opts) < 0) {
273 perror("fcntl(F_SETFL)");
274 exit(EXIT_FAILURE);
275 }
276
277
278 return desc;
279}
static const char desc[]
Definition: cdr_radius.c:84
char * address
Definition: f2c.h:59
static const char name[]
Definition: format_mp3.c:68
#define gethostbyname
Definition: lock.h:639
#define EXIT_FAILURE

References desc, EXIT_FAILURE, gethostbyname, and name.

Referenced by main().

◆ finalize()

void finalize ( )

Definition at line 154 of file eagi_proxy.c.

155{
156 close(command_desc);
157 close(speech_desc);
158 free(winbuf);
159}
char * winbuf
Definition: eagi_proxy.c:72
int speech_desc
Definition: eagi_proxy.c:81
int command_desc
Definition: eagi_proxy.c:80
void free()

References command_desc, free(), speech_desc, and winbuf.

Referenced by main().

◆ main()

int main ( )

Definition at line 107 of file eagi_proxy.c.

108{
109 int ret;
110
111 atexit(finalize);
112
113 setlinebuf(stdin);
114 setlinebuf(stdout);
115
118 bs=be=winbuf;
119
121 if(speech_desc<0)
122 {
123 perror("signal socket");
124 return -1;
125 }
126
127
129 if(command_desc<0)
130 {
131 perror("command socket");
132 return -1;
133 }
134
138
139 while(connected)
140 {
144 if(ret>0)
145 {
146 buf[ret]=0;
147 printf("%s",buf);
148 }
149 }
150
151 return 0;
152}
int connect_to_host(char *host, int port)
Definition: eagi_proxy.c:217
void * readSignal(void *ptr)
Definition: eagi_proxy.c:188
#define COMMAND_PORT
Definition: eagi_proxy.c:60
void finalize()
Definition: eagi_proxy.c:154
char * be
Definition: eagi_proxy.c:73
char connected
Definition: eagi_proxy.c:82
pthread_t signal_thread
Definition: eagi_proxy.c:97
char * bs
Definition: eagi_proxy.c:73
#define WINBUF_NUM
Definition: eagi_proxy.c:71
char * end
Definition: eagi_proxy.c:73
pthread_mutex_t command_mutex
Definition: eagi_proxy.c:96
pthread_t stdin_thread
Definition: eagi_proxy.c:97
char buf[BUFSIZE]
Definition: eagi_proxy.c:66
int read_some(int file, char *buffer, int size)
Definition: eagi_proxy.c:281
#define WINSIZE
Definition: eagi_proxy.c:68
#define BUFSIZE
Definition: eagi_proxy.c:65
void * readStdin(void *ptr)
Definition: eagi_proxy.c:161
#define SIGNAL_PORT
Definition: eagi_proxy.c:59
char * malloc()
#define pthread_create
Definition: lock.h:642
#define pthread_mutex_lock
Definition: lock.h:625
#define pthread_mutex_unlock
Definition: lock.h:626
#define pthread_mutex_init
Definition: lock.h:628
#define NULL
Definition: resample.c:96

References be, bs, buf, BUFSIZE, command_desc, command_mutex, COMMAND_PORT, connect_to_host(), connected, end, finalize(), malloc(), NULL, pthread_create, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, read_some(), readSignal(), readStdin(), SIGNAL_PORT, signal_thread, speech_desc, stdin_thread, winbuf, WINBUF_NUM, and WINSIZE.

◆ read_full()

void read_full ( int  file,
char *  buffer,
int  num 
)

Definition at line 200 of file eagi_proxy.c.

201{
202 int count,pos=0;
203
204 while(num)
205 {
206 count=read(file,buffer+pos,num);
207 if(count==0 || (count<0 && errno!=EAGAIN))
208 {
209 connected=0;
210 return;
211 }
212 num-=count;
213 pos+=count;
214 }
215}
int errno

References connected, errno, and make_ari_stubs::file.

Referenced by readSignal().

◆ read_some()

int read_some ( int  file,
char *  buffer,
int  size 
)

Definition at line 281 of file eagi_proxy.c.

282{
283 unsigned char c;
284 int res,i=0;
285
286 for(;;)
287 {
288 res=read(desc,&c,1);
289 if(res<1)
290 {
291 if(errno!=EAGAIN)
292 {
293 perror("Error reading");
294 connected=0;
295 }
296 break;
297 }
298 if(res==0)
299 {
300 connected=0;
301 break;
302 }
303
304 buffer[i]=c;
305 i++;
306 }
307
308 return i;
309}
static struct test_val c

References c, connected, desc, and errno.

Referenced by main().

◆ readSignal()

void * readSignal ( void *  ptr)

Definition at line 188 of file eagi_proxy.c.

189{
190 while(connected)
191 {
194 }
195
196 pthread_exit(NULL);
197}
void read_full(int file, char *buffer, int num)
Definition: eagi_proxy.c:200
void write_buf(int file, char *buffer, int num)
Definition: eagi_proxy.c:312
char window[WINSIZE]
Definition: eagi_proxy.c:69

References connected, NULL, read_full(), speech_desc, window, WINSIZE, and write_buf().

Referenced by main().

◆ readStdin()

void * readStdin ( void *  ptr)

Definition at line 161 of file eagi_proxy.c.

162{
163 while(1)/*read enviornment*/
164 {
165 fgets(buf,BUFSIZE,stdin);
166 #ifdef SEND_ENVIORNMENT
168 write_buf(command_desc,buf,strlen(buf));
170 #endif
171 if(feof(stdin) || buf[0]=='\n')
172 {
173 break;
174 }
175 }
176
177 while(connected)
178 {
179 fgets(buf,BUFSIZE,stdin);
181 write_buf(command_desc,buf,strlen(buf));
183 }
184
185 pthread_exit(NULL);
186}

References buf, BUFSIZE, command_desc, command_mutex, connected, NULL, pthread_mutex_lock, pthread_mutex_unlock, and write_buf().

Referenced by main().

◆ setnonblocking()

void setnonblocking ( int  desc)

Definition at line 402 of file eagi_proxy.c.

403{
404 int opts;
405
406 opts = fcntl(desc,F_GETFL);
407 if(opts < 0)
408 {
409 perror("fcntl(F_GETFL)");
410 exit(-1);
411 }
412
413 opts = (opts | O_NONBLOCK );
414 if(fcntl(desc,F_SETFL,opts) < 0)
415 {
416 perror("fcntl(F_SETFL)");
417 exit(-1);
418 }
419}

References desc.

◆ write_amap()

int write_amap ( int  file,
char *  buffer,
int  num 
)

Definition at line 382 of file eagi_proxy.c.

383{
384 int ret;
385 ret=write(desc,buf,size);
386 if(ret<0)
387 {
388 if(errno!=EAGAIN)
389 {
390 perror("Error writing");
391 connected=0;
392 }
393 return 0;
394 }
395 if(ret==0)
396 connected=0;
397
398 return ret;
399}

References buf, connected, desc, and errno.

Referenced by write_buf().

◆ write_buf()

void write_buf ( int  file,
char *  buffer,
int  num 
)

Definition at line 312 of file eagi_proxy.c.

313{
314 int ret;
315
316 /*NOTE: AMAP -> as much as possible */
317
318 if(be!=bs)/* if data left in buffer */
319 {
320 if(be>bs)/* if buffer not split */
321 {
322 ret=write_amap(desc,bs,be-bs);/* write AMAP */
323 bs+=ret;/* shift the start of the buffer */
324 }
325 else/* if buffer is split */
326 {
327 ret=write_amap(desc,bs,end-bs);/* write higher part first */
328 if(ret==end-bs)/* if wrote whole of the higher part */
329 {
330 ret=write_amap(desc,winbuf,be-winbuf);/* write lower part */
331 bs=winbuf+ret;/* shift start to new position */
332 }
333 else bs+=ret;/* if not wrote whole of higher part, only shift start */
334 }
335 }
336
337 if(be==bs)/* if buffer is empty now */
338 {
339 ret=write_amap(desc,buf,size);/* write AMAP of the new data */
340 buf+=ret;/* shift start of new data */
341 size-=ret;/* lower size of new data */
342 }
343
344 if(size)/* if new data still remains unsent */
345 {
346 if(be>=bs)/* if data not split */
347 {
348 if(size>end-be)/* if new data size doesn't fit higher end */
349 {
350 size-=end-be;/* reduce new data size by the higher end size */
351 memcpy(be,buf,end-be);/* copy to higher end */
352 be=winbuf;/* shift end to begining of buffer */
353 buf+=end-be;/* shift start of new data */
354 }
355 else/* if new data fits the higher end */
356 {
357 memcpy(be,buf,size);/* copy to higher end */
358 be+=size;/* shift end by size */
359 if(be>=end)/* if end goes beyond the buffer */
360 be=winbuf;/* restart */
361 size=0;/* everything copied */
362 }
363 }
364
365 if(size)/* if new data still remains */
366 {
367 if(size>=bs-be)/* if new data doesn't fit between end and start */
368 {
369 fprintf(stderr,"Buffer overflow!\n");
370 size=bs-be-1;/* reduce the size that we can copy */
371 }
372
373 if(size)/* if we can copy anything */
374 {
375 memcpy(be,buf,size);/* copy the new data between end and start */
376 be+=size;/* shift end by size */
377 }
378 }
379 }
380}
int write_amap(int file, char *buffer, int num)
Definition: eagi_proxy.c:382

References be, bs, buf, desc, end, winbuf, and write_amap().

Referenced by AST_TEST_DEFINE(), audiohook_read_frame_both(), readSignal(), readStdin(), and spy_generate().

Variable Documentation

◆ be

char * be

◆ bs

char * bs

◆ buf

char buf[BUFSIZE]
Examples
app_skel.c.

Definition at line 66 of file eagi_proxy.c.

Referenced by __adsi_transmit_messages(), __ast_app_separate_args(), __ast_callerid_generate(), __ast_format_cap_get_names(), __ast_frdup(), __ast_str_helper(), __ast_str_helper2(), __manager_event_sessions_va(), __ovfl_get(), __rtp_recvfrom(), __rtp_sendto(), _ast_str_create(), _ast_xmldoc_build_arguments(), acf_cc_read(), acf_channel_read(), acf_curl_exec(), acf_curlopt_helper(), acf_curlopt_read(), acf_curlopt_read2(), acf_cut_exec(), acf_cut_exec2(), acf_escape(), acf_escape_backslashes(), acf_escape_ticks(), acf_exception_read(), acf_faxopt_read(), acf_fetch(), acf_iaxvar_read(), acf_if(), acf_jabberreceive_read(), acf_jabberstatus_read(), acf_meetme_info(), acf_odbc_read(), acf_odbc_write(), acf_sort_exec(), acf_sprintf(), acf_strftime(), acf_strptime(), acf_transaction_read(), acf_vm_info(), acf_vmcount_exec(), acl_to_str(), action_add_agi_cmd(), action_bridge(), action_command(), action_redirect(), active_channels_to_str_cb(), add_eprofile_to_channel(), add_eprofile_to_tdata(), add_exten_to_pattern_tree(), add_menu_entry(), adsi_begin_download(), adsi_careful_send(), adsi_clear_screen(), adsi_clear_soft_keys(), adsi_confirm_match(), adsi_connect_session(), adsi_data_mode(), adsi_delete(), adsi_disconnect_session(), adsi_display(), adsi_download_connect(), adsi_download_disconnect(), adsi_end_download(), adsi_folders(), adsi_get_cpeid(), adsi_get_cpeinfo(), adsi_goodbye(), adsi_input_control(), adsi_input_format(), adsi_load(), adsi_load_soft_key(), adsi_load_vmail(), adsi_login(), adsi_logo(), adsi_message(), adsi_password(), adsi_print(), adsi_process(), adsi_prog(), adsi_query_cpeid(), adsi_query_cpeinfo(), adsi_read_encoded_dtmf(), adsi_search_input(), adsi_set_keys(), adsi_set_line(), adsi_status(), adsi_status2(), adsi_voice_mode(), aeap_receive(), aeap_send(), aeap_transport_read(), aeap_transport_write(), ael_yy_scan_bytes(), aelsub_exec(), aes_helper(), agent_function_read(), agi_exec_full(), agi_handle_command(), allocate_tdata_buffer(), allow_wildcard_certs_to_str(), ami_outbound_registration_task(), ami_registrations_aor(), ami_subscription_detail(), analog_ss_thread(), announce_to_dial(), anti_injection(), app_exec(), append_date(), append_int(), append_string(), apply_outgoing(), assign_uuid(), ast_adsi_clear_screen(), ast_adsi_clear_soft_keys(), ast_adsi_connect_session(), ast_adsi_data_mode(), ast_adsi_disconnect_session(), ast_adsi_display(), ast_adsi_download_connect(), ast_adsi_download_disconnect(), ast_adsi_input_control(), ast_adsi_input_format(), ast_adsi_load_soft_key(), ast_adsi_query_cpeid(), ast_adsi_query_cpeinfo(), ast_adsi_read_encoded_dtmf(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_voice_mode(), ast_aeap_message_deserialize(), ast_aeap_message_serialize(), ast_aeap_send_binary(), ast_aeap_send_msg(), ast_agi_send(), ast_app_options2str64(), ast_app_separate_args(), ast_ari_callback(), ast_audiosocket_init(), ast_audiosocket_send_frame(), ast_callerid_callwaiting_full_generate(), ast_callerid_callwaiting_full_tz_generate(), ast_callerid_callwaiting_generate(), ast_callerid_full_generate(), ast_callerid_full_tz_generate(), ast_callerid_generate(), ast_callerid_merge(), ast_callerid_split(), ast_cc_get_param(), ast_cdr_serialize_variables(), ast_cli(), ast_compile_ael2(), ast_devstate_changed(), ast_el_add_history(), ast_el_read_char(), ast_el_strtoarr(), ast_expr(), ast_fax_caps_to_str(), ast_fileexists(), ast_format_cap_append_names(), ast_format_cap_get_names(), ast_format_duration_hh_mm_ss(), ast_generate_random_string(), ast_geoloc_eprofile_to_pidf(), ast_geoloc_eprofile_to_uri(), ast_geoloc_eprofiles_to_pidf(), ast_get_builtin_feature(), ast_get_extension_data(), ast_get_feature(), ast_ha_join(), ast_ha_join_cidr(), ast_http_get_contents(), ast_http_get_json(), ast_http_get_post_vars(), ast_http_header_parse(), ast_http_prefix(), ast_http_response_status_line(), ast_http_send(), ast_inet_ntoa(), ast_iostream_discard(), ast_iostream_printf(), ast_json_timeval(), ast_log_backtrace(), ast_odbc_ast_str_SQLGetData(), ast_openstream_full(), ast_openvstream(), ast_parse_arg(), ast_presence_state_changed(), ast_print_group(), ast_print_namedgroups(), ast_read_image(), ast_recvchar(), ast_recvfrom(), ast_recvtext(), ast_remotecontrol(), ast_rtp_instance_get_quality(), ast_rtp_lookup_mime_multiple2(), ast_say_digits_full(), ast_say_number_full_zh(), ast_sched_report(), ast_sendto(), ast_set_default_eid(), ast_sip_add_security_headers(), ast_sip_auths_to_str(), ast_sip_contact_to_str(), ast_sip_create_ami_event(), ast_sip_dtmf_to_str(), ast_sip_format_contact_ami(), ast_sip_get_transport_name(), ast_sip_header_to_security_mechanism(), ast_sip_security_mechanisms_to_str(), ast_sip_sorcery_object_to_ami(), ast_sip_subscription_get_local_uri(), ast_sip_subscription_get_remote_uri(), ast_sip_update_to_uri(), ast_slinfactory_read(), ast_sorcery_objectset_json_create(), ast_speech_get_setting(), ast_srtp_protect(), ast_srtp_unprotect(), ast_state2str(), ast_statsd_log_full_va(), ast_statsd_log_string_va(), ast_str_append_escapecommas(), ast_str_append_substr(), ast_str_append_va(), ast_str_buffer(), ast_str_get_encoded_str(), ast_str_quote(), ast_str_reset(), ast_str_set(), ast_str_set_escapecommas(), ast_str_set_substr(), ast_str_set_va(), ast_str_size(), ast_str_strlen(), ast_str_substitute_variables(), ast_str_substitute_variables_full(), ast_str_substitute_variables_full2(), ast_str_substitute_variables_varshead(), ast_str_thread_get(), ast_str_trim_blanks(), ast_str_update(), ast_stream_codec_prefs_to_str(), ast_stream_create_resolved(), ast_stream_to_str(), ast_stream_topology_to_str(), ast_strftime(), ast_strftime_locale(), ast_taskprocessor_build_name(), ast_taskprocessor_name_append(), ast_term_color(), AST_TEST_DEFINE(), ast_threadstorage_get(), ast_time_t_to_string(), ast_to_camel_case_delim(), ast_translate_number_ka(), ast_udptl_read(), ast_udptl_write(), ast_uuid_generate_str(), ast_uuid_to_str(), ast_vector_string_split(), ast_websocket_read_string(), ast_websocket_write_string(), ast_writefile(), ast_xmldoc_printable(), ast_yy_scan_bytes(), asterisk_daemon(), astman_append(), astman_append_json(), astman_flush(), astman_send_error_va(), astman_send_list_complete(), astman_send_list_complete_start(), astman_send_list_complete_start_common(), astman_send_response_full(), at_match_prefix(), at_read_full(), audiohook_read_frame_single(), auth_exec(), auth_method_names(), auth_type_to_str(), base64_buf_helper(), base64_helper(), base64_str_helper(), blacklist_read(), bool_handler_fn(), bucket_copy(), build_csv_record(), build_peer(), build_rand_pad(), build_regex(), build_user(), builtin_feature_get_exten(), ca_list_file_to_str(), ca_list_path_to_str(), calc_energy(), caldav_request(), calendar_busy_exec(), calendar_event_read(), calendar_join_attendees(), calendar_query_exec(), calendar_query_result_exec(), caller_id_privacy_to_str(), caller_id_tag_to_str(), caller_id_to_str(), callerid_feed(), callerid_feed_jp(), callerid_full_generate(), callerid_generate(), callerid_read(), callgroup_to_str(), cdr_get_tv(), cdr_read(), cert_file_to_str(), chan_pjsip_new(), channel_read_pjsip(), channel_read_rtcp(), channel_read_rtp(), chararray_handler_fn(), check_access(), check_header(), check_password(), clearcbone(), cleardisplay(), clearflag(), cleartimer(), cli_console_sendtext(), cli_show_subscription_common(), codec_append_name(), codec_handler_fn(), codec_prefs_to_str(), collect_digits(), compile_script(), conf_run(), config_function_read(), config_text_file_load(), connected_line_method_to_str(), connectedline_read(), contact_acl_to_str(), contact_user_to_str(), contacts_to_str(), copy(), corosync_show_members(), cpg_deliver_cb(), create_binaural_frame(), create_followme_number(), crement_function_read(), csv_log(), csv_quote(), custom_devstate_callback(), custom_presence_callback(), cut_internal(), dahdi_func_read(), dahdi_sendtext(), dahdi_setoption(), dahdi_sig2str(), dbl_list_expect_forward(), dbl_list_expect_reverse(), decode_length(), decode_open_type(), deliver_file(), destroy_mysql(), devstate_read(), dialgroup_read(), dialgroup_refreshdb(), dialog_associations_hash(), digitcollect(), digitdirect(), direct_media_glare_mitigation_to_str(), direct_media_method_to_str(), display_single_entry(), do_alignment_detection(), do_monitor(), do_monitor_headset(), do_monitor_phone(), do_notify(), double_handler_fn(), dtls_handler(), dtlsautogeneratecert_to_str(), dtlscafile_to_str(), dtlscapath_to_str(), dtlscertfile_to_str(), dtlscipher_to_str(), dtlsfingerprint_to_str(), dtlsprivatekey_to_str(), dtlsrekey_to_str(), dtlssetup_to_str(), dtlsverify_to_str(), dtmf_info_incoming_request(), dtmf_to_str(), dump_prov_flags(), dump_str_and_free(), dundi_flags2str(), dundi_hint2str(), dundi_query_read(), dundi_result_read(), dundifunc_read(), encmethods_to_str(), encode_length(), encode_open_type(), end_bridge_callback(), enum_query_read(), enum_result_read(), env_read(), epoch_to_string(), eval_exten_read(), evaluate_like(), event2str(), exchangecal_request(), exists(), expiration_struct2str(), extstate_read(), feature_read(), featuremap_get(), featuremap_read(), fetch_callerid_num(), fetch_google_access_token(), file2display(), file_basename(), file_count_line(), file_dirname(), file_format(), file_read(), fileexists_core(), fileexists_test(), fill_bridgepeer_buf(), filter(), format_ami_aor_handler(), format_ami_aorlist_handler(), format_ami_auth_handler(), format_ami_authlist_handler(), format_ami_contactlist_handler(), format_ami_endpoint(), format_ami_endpoint_transport(), format_ami_endpoints(), format_ami_resource_lists(), format_log_default(), format_log_json(), format_log_message_ap(), format_log_plain(), format_str_append_auth(), from_user_to_str(), func_chan_exists_read(), func_channel_read(), func_channels_read(), func_confbridge_channels(), func_confbridge_info(), func_get_parkingslot_channel(), func_mchan_read(), func_mixmonitor_read(), func_read(), func_read_header(), func_read_headers(), func_read_param(), func_response_read_header(), func_response_read_headers(), function_amiclient(), function_db_delete(), function_db_delete_write(), function_db_exists(), function_db_keycount(), function_db_read(), function_enum(), function_eval(), function_eval2(), function_fieldnum(), function_fieldnum_helper(), function_fieldnum_str(), function_fieldqty(), function_fieldqty_helper(), function_fieldqty_str(), function_iaxpeer(), function_ltrim(), function_ooh323_read(), function_ooh323_write(), function_realtime_read(), function_realtime_readdestroy(), function_rtrim(), function_trim(), function_txtcidname(), g723_len(), g723_samples(), gen_prios(), gen_tone(), gen_tones(), general_get(), generate_naptr_record(), generate_random_string(), generate_srv_record(), geoloc_eprofile_resolve_varlist(), geoloc_profile_read(), get_local_address(), get_mapping_weight(), get_single_field_as_var_list(), get_token(), get_user_input(), global_exists_read(), global_read(), goto_line(), goto_line_rel(), group_count_function_read(), group_function_read(), group_list_function_read(), group_match_count_function_read(), handle_call_token(), handle_cdr_pgsql_status(), handle_cli_config_reload(), handle_cli_indication_show(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_realtime_pgsql_status(), handle_commandmatchesarray(), handle_dbget(), handle_include_exec(), handle_incoming_request(), handle_input(), handle_jack_audio(), handle_minivm_show_stats(), handle_msg_cb(), handle_outgoing_request(), handle_output(), handle_recvtext(), handle_response_brsf(), handle_response_ciev(), handle_response_cind(), handle_response_clip(), handle_response_cmgr(), handle_response_cmti(), handle_response_cusd(), handle_select_codec(), handle_show_calendar(), handle_show_hint(), handle_show_hints(), handle_show_settings(), handle_speechrecognize(), handle_string(), hangupcause_keys_read(), hangupcause_read(), has_destination_cb(), hash_read(), hashkeys_read(), hashkeys_read2(), header_identify_match_check(), headers_to_vars(), hexstring(), hfp_parse_brsf(), hfp_parse_ciev(), hfp_parse_cind(), hfp_parse_cind_test(), hfp_parse_clip(), hfp_parse_cmgr(), hfp_parse_cmti(), hfp_parse_cusd(), hfp_parse_ecav(), hint_read(), hook_read(), http_body_read_contents(), http_callback(), iax2_codec_pref_convert(), iax2_codec_pref_string(), iax_provflags2str(), iax_str2flags(), iCBSearch(), iconv_read(), ident_to_str(), ifmodule_read(), iftime(), import_helper(), import_read(), inbound_auths_to_str(), incoming_answer_codec_prefs_to_str(), incoming_call_offer_pref_to_str(), incoming_offer_codec_prefs_to_str(), int_handler_fn(), internal_feature_read(), internal_featuremap_read(), iostream_read(), isexten_function_read(), isnull(), isodate(), jack_str(), jb_debug_output(), jb_error_output(), jb_warning_output(), json_decode_read(), keypadhash(), len(), linear_generator(), list_expect(), list_item_to_str(), listfilter(), listfilter_read(), listfilter_read2(), local_read(), localnet_to_str(), lock_read(), log_action(), logger_add_verbose_magic(), logger_print_normal(), loopback_parse(), loopback_subst(), main(), make_filename(), manager_log(), manager_park(), match_to_str(), math(), md5(), MD5Transform(), MD5Update(), media_address_to_str(), media_encryption_to_str(), media_offer_read_av(), message_json_deserialize(), message_json_serialize(), message_template_parse_filebody(), milliwatt_generate(), minivm_account_func_read(), minivm_counter_func_read(), moh_generate(), msg_data_func_read(), msg_func_read(), msg_to_endpoint(), mstime(), mwi_to_ami(), my_dahdi_write(), my_distinctive_ring(), my_get_callerid(), named_callgroups_to_str(), named_pickupgroups_to_str(), onevent(), outbound_auths_to_str(), outgoing_answer_codec_prefs_to_str(), outgoing_call_offer_pref_to_str(), outgoing_offer_codec_prefs_to_str(), overload_trigger_to_str(), parse_node(), parsing(), party_id_read(), party_name_read(), party_number_read(), party_subaddress_read(), passthru(), pbx_builtin_background(), pbx_builtin_serialize_variables(), pcm_write(), peek_read(), persistence_endpoint_struct2str(), persistence_expires_struct2str(), persistence_generator_data_struct2str(), persistence_tag_struct2str(), pgsql_log(), pickup_get(), pickupgroup_to_str(), pjsip_acf_channel_read(), pjsip_acf_dial_contacts_read(), pjsip_acf_dtmf_mode_read(), pjsip_acf_media_offer_read(), pjsip_acf_moh_passthrough_read(), pjsip_acf_parse_uri_read(), pjsip_aor_function_read(), pjsip_contact_function_read(), pjsip_endpoint_function_read(), poll_mailbox(), powiedz(), pp_each_extension_helper(), pp_each_extension_read(), pp_each_extension_read2(), pp_each_user_helper(), pp_each_user_read(), pp_each_user_read2(), prack_to_str(), presence_read(), print_body(), print_escaped_uri(), print_ext(), printdigest(), privkey_file_to_str(), process_description_file(), process_message(), process_output(), process_request(), process_text_line(), proto2str(), publish_to_corosync(), pw_cb(), queue_function_exists(), queue_function_mem_read(), queue_function_memberpenalty_read(), queue_function_qac_dep(), queue_function_queuegetchannel(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), queue_set_param(), quote(), raise_msg(), rcv_mac_addr(), read_environment(), read_mf_digits(), read_sf_digits(), readmimefile(), readStdin(), realtime_common(), realtime_ldap_status(), realtime_multi_mysql(), realtime_mysql(), realtimefield_read(), recvtext_exec(), redirecting_read(), regex(), reload_config(), reload_module(), remove_excess_lws(), replace(), require_client_cert_to_str(), rfc3326_add_reason_header(), rfc3326_use_reason_header(), rfc3329_incoming_response(), rfcomm_read(), rfcomm_read_and_append_char(), rfcomm_read_cmgr(), rfcomm_read_command(), rfcomm_read_result(), rfcomm_read_sms_prompt(), rfcomm_read_until_crlf(), rfcomm_read_until_ok(), rfcomm_write(), rfcomm_write_full(), rlmi_print_body(), rotate_file(), rtcp_recvfrom(), rtcp_sendto(), rtp_recvfrom(), rtp_sendto(), run_agi(), rx_data_to_ast_msg(), save_history(), say_date_generic(), say_enumeration_full(), say_number_full(), sayfile_exec(), scan_thread(), sco_write(), search_directory_sub(), security_mechanism_to_str(), security_negotiation_to_str(), select_item_menu(), send_cluster_notify(), send_delay(), send_dtmf(), send_identify_ami_event(), send_rasterisk_connect_commands(), serialize_showchan(), set(), set_bridge_peer_vars_multiparty(), set_channel_variables(), set_duration_var(), set_full_cmd(), set_state(), set_var_to_str(), setflag(), sha1(), shared_read(), shell_helper(), shift_pop(), show_dialplan_helper(), showdisplay(), showkeys(), silence_generator_generate(), sip_aor_to_ami(), sip_auth_to_ami(), sip_contact_to_ami(), sip_endpoint_to_ami(), sip_endpoints_aors_ami(), sip_identify_to_ami(), sip_publication_respond(), sip_sorcery_object_ami_set_type_name(), sip_subscription_to_ami(), sip_to_pjsip(), sip_transport_to_ami(), sla_state(), smdi_msg_read(), smdi_msg_retrieve_read(), sms_generate(), sms_hexdump(), sms_log(), sms_writefile(), sockaddr_handler_fn(), socket_read(), softmix_mixing_loop(), sorcery_function_read(), spandsp_fax_read(), speech_aeap_engine_get_setting(), speech_engine_read(), speech_grammar(), speech_read(), speech_score(), speech_test_server_handle_request(), speech_text(), speex_read(), sqlite3_escape_column_op(), sqlite3_escape_string_helper(), srv_query_read(), srv_result_read(), starttimer(), stasis_device_state_cb(), stat_read(), stir_shaken_to_str(), store_mysql(), store_pgsql(), store_tone_zone_ring_cadence(), str_appender(), strbetween(), stream_monitor(), string_tolower(), string_tolower2(), string_toupper(), string_toupper2(), stringfield_handler_fn(), strip_control_and_high(), strreplace(), subscript(), synths_(), sysinfo_helper(), system_exec_helper(), t38_tx_packet_handler(), t38udptl_ec_to_str(), tdd_feed(), test_jb_debug_output(), test_jb_error_output(), test_jb_warn_output(), timeout_read(), timers_to_str(), timeval_struct2str(), tls_method_to_str(), to_ami(), tos_audio_to_str(), tos_to_str(), tos_video_to_str(), transport_bind_handler(), transport_bind_to_str(), transport_create(), transport_protocol_to_str(), transport_read(), try_firmware(), try_load_key(), trylock_read(), tzload(), udptl_build_packet(), udptl_rx_packet(), uint_handler_fn(), unlock_read(), unshift_push(), update2_mysql(), update_mysql(), uridecode(), uriencode(), var_list_from_confidence(), var_list_from_loc_info(), var_list_from_node(), variable_exists_read(), varlist_to_str(), verify_client_to_str(), verify_server_to_str(), vm_change_password_shell(), vm_check_password_shell(), vm_newuser_setup(), vm_options(), vm_play_folder_name_gr(), vm_tempgreeting(), voicemail_extension_to_str(), websocket_client_handshake_get_response(), websocket_read(), websocket_write(), write_amap(), write_buf(), ws_safe_read(), xfer_get(), xml_copy_escape(), xml_encode_str(), xmpp_client_authenticate_digest(), xmpp_client_receive(), and yesno_handler_fn().

◆ command_desc

int command_desc

Definition at line 80 of file eagi_proxy.c.

Referenced by finalize(), main(), and readStdin().

◆ command_mutex

pthread_mutex_t command_mutex

Definition at line 96 of file eagi_proxy.c.

Referenced by main(), and readStdin().

◆ connected

char connected =1

◆ end

char* end

Definition at line 73 of file eagi_proxy.c.

Referenced by __ast_play_and_record(), _extension_match_core(), _while_exec(), aco_process_config(), add_event_to_list(), ari_originate_dial(), ast_audiosocket_connect(), ast_bridge_transfer_attended(), ast_in_delimited_string(), ast_media_index_update_for_file(), ast_serializer_shutdown_group_join(), ast_sip_pubsub_generate_body_content(), ast_str_encode_mime(), ast_str_to_imax(), ast_str_to_umax(), ast_term_init(), AST_TEST_DEFINE(), ast_tvdiff_sec(), ast_tvdiff_us(), ast_xml_escape(), ast_xmldoc_printable(), caldav_add_event(), caldav_get_events_between(), calendar_query_exec(), cli_show_channel(), cli_tps_ping(), common_exec(), consumer_should_stay(), consumer_wait_for(), consumer_wait_for_completion(), control_streamfile(), create_local_sdp(), create_video_frame(), dahdi_create_channel_range(), dahdi_create_channels(), dahdi_destroy_channel_range(), dahdi_destroy_channels(), device_state_cb(), echo_exec(), end_bridge_callback(), ewscal_write_event(), exchangecal_get_events_between(), exchangecal_write_event(), execif_exec(), ext_cmp1(), ext_cmp_pattern_pos(), file_read(), fileexists_core(), find_unused_payload_in_range(), generate_computational_cost(), get_dial_bridge(), get_ewscal_ids_for(), get_range(), h264_encap(), handle_cli_dialplan_add_extension(), handle_cli_performance_test(), handle_cli_queue_test(), handle_end_element(), handle_incoming_sdp(), has_complex_started(), headers_to_vars(), hp100_(), http_callback(), iax2_provision(), icalendar_add_event(), if_helper(), is_media_state_valid(), jingle_outgoing_hook(), jingle_send_error_response(), jingle_send_session_info(), jingle_send_session_terminate(), load_module(), main(), make_components(), mid_test_sync(), mpeg4_encap(), new_invite(), parse_qvalue(), parsedoublearg(), parsefreq(), parsetime(), parsevolarg(), parsevolume(), pbx_load_config(), publish_local_bridge_message(), regexp_flags_invalid(), regexp_pattern_invalid(), regexp_repl_invalid(), set_config(), shutdown_waitfor_completion(), shutdown_waitfor_start(), sip_outbound_publish_callback(), sip_session_refresh(), strreplace(), task_wait(), tds_log(), timing_test(), tone_detect(), two_bridge_attended_transfer(), typeof(), tzparse(), update_caldav(), update_exchangecal(), update_header(), verify_mock_cdr_record(), wait_for_completion(), wait_for_complex_completion(), wait_for_complex_start(), wait_for_empty_notice(), wait_for_resolution(), wait_for_task_pushed(), wait_until_thread_state(), wait_until_thread_state_task_pushed(), websocket_echo_callback(), worker_idle(), write_buf(), xmldoc_parse_specialtags(), and xmpp_client_service_discovery_get_hook().

◆ signal_thread

pthread_t signal_thread

Definition at line 97 of file eagi_proxy.c.

Referenced by main().

◆ speech_desc

int speech_desc

Definition at line 81 of file eagi_proxy.c.

Referenced by finalize(), main(), and readSignal().

◆ stdin_thread

pthread_t stdin_thread

Definition at line 97 of file eagi_proxy.c.

Referenced by main().

◆ winbuf

char* winbuf

Definition at line 72 of file eagi_proxy.c.

Referenced by finalize(), main(), and write_buf().

◆ window

char window[WINSIZE]

Definition at line 69 of file eagi_proxy.c.

Referenced by readSignal(), SimpleAnalysis(), and smb_pitch_shift().