Asterisk - The Open Source Telephony Project
18.5.0
|
#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>
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] |
#define BUFSIZE 1024 |
Definition at line 65 of file eagi_proxy.c.
Referenced by main(), and readStdin().
#define COMMAND_PORT 8417 |
Definition at line 60 of file eagi_proxy.c.
Referenced by main().
#define SEND_ENVIORNMENT /*send the enviornment thru the socket*/ |
Definition at line 61 of file eagi_proxy.c.
#define SIGNAL_PORT 8418 |
Definition at line 59 of file eagi_proxy.c.
Referenced by main().
Definition at line 71 of file eagi_proxy.c.
Referenced by main().
#define WINSIZE 400 /* 25 ms @ 8 kHz and 16bit */ |
Definition at line 68 of file eagi_proxy.c.
Referenced by main(), and readSignal().
int connect_to_host | ( | char * | host, |
int | port | ||
) |
Definition at line 217 of file eagi_proxy.c.
References desc, EXIT_FAILURE, and gethostbyname.
Referenced by main().
void finalize | ( | ) |
Definition at line 154 of file eagi_proxy.c.
References command_desc, free(), speech_desc, and winbuf.
Referenced by main().
int main | ( | ) |
Definition at line 107 of file eagi_proxy.c.
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.
void read_full | ( | int | file, |
char * | buffer, | ||
int | num | ||
) |
Definition at line 200 of file eagi_proxy.c.
References connected, and errno.
Referenced by readSignal().
int read_some | ( | int | file, |
char * | buffer, | ||
int | size | ||
) |
void * readSignal | ( | void * | ptr | ) |
Definition at line 188 of file eagi_proxy.c.
References connected, NULL, read_full(), speech_desc, window, WINSIZE, and write_buf().
Referenced by main().
void * readStdin | ( | void * | ptr | ) |
Definition at line 161 of file eagi_proxy.c.
References buf, BUFSIZE, command_desc, command_mutex, connected, NULL, pthread_mutex_lock, pthread_mutex_unlock, and write_buf().
Referenced by main().
void setnonblocking | ( | int | desc | ) |
Definition at line 402 of file eagi_proxy.c.
int write_amap | ( | int | file, |
char * | buffer, | ||
int | num | ||
) |
Definition at line 382 of file eagi_proxy.c.
References connected, and errno.
Referenced by write_buf().
void write_buf | ( | int | file, |
char * | buffer, | ||
int | num | ||
) |
Definition at line 312 of file eagi_proxy.c.
References be, bs, end, winbuf, and write_amap().
Referenced by AST_TEST_DEFINE(), audiohook_read_frame_both(), readSignal(), and readStdin().
char * be |
Definition at line 73 of file eagi_proxy.c.
Referenced by cdr_generic_register(), hashtab_compare_strings(), main(), and write_buf().
char * bs |
Definition at line 73 of file eagi_proxy.c.
Referenced by ast_hashtab_compare_shorts(), compare_categories(), dahdi_open(), iax_firmware_append(), main(), and write_buf().
char buf[BUFSIZE] |
Definition at line 66 of file eagi_proxy.c.
Referenced by __adsi_transmit_messages(), __ast_app_separate_args(), __ast_frdup(), __ast_test_status_update(), __ast_test_suite_event_notify(), __manager_event_sessions_va(), __ovfl_get(), __rtp_recvfrom(), __rtp_sendto(), __stub__ast_websocket_read(), __transmit_response(), _ast_str_create(), _ast_xmldoc_build_arguments(), _sip_tcp_helper_thread(), acf_escape(), acf_odbc_write(), acf_sprintf(), action_add_agi_cmd(), action_bridge(), action_command(), action_redirect(), active_channels_to_str_cb(), add_exten_to_pattern_tree(), add_menu_entry(), adsi_begin_download(), adsi_careful_send(), adsi_end_download(), adsi_get_cpeid(), adsi_get_cpeinfo(), adsi_load(), adsi_print(), adsi_prog(), ael_yy_scan_bytes(), aelsub_exec(), agi_exec_full(), allocate_tdata_buffer(), alsa_read(), ami_outbound_registration_task(), ami_registrations_aor(), ami_subscription_detail(), analog_ss_thread(), announce_to_dial(), anti_injection(), ao2_container_unregister(), app_exec(), append_history_va(), apply_outgoing(), assign_uuid(), ast_agi_send(), ast_app_separate_args(), ast_ari_callback(), ast_audiosocket_init(), ast_audiosocket_send_frame(), ast_callerid_merge(), ast_compile_ael2(), ast_devstate_changed(), ast_dns_test_generate_result(), ast_dns_test_write_domain(), ast_eid_to_str(), ast_el_read_char(), ast_fax_caps_to_str(), ast_fileexists(), ast_generate_random_string(), ast_http_get_contents(), ast_http_get_json(), ast_http_get_post_vars(), ast_http_header_parse(), ast_http_send(), ast_inet_ntoa(), ast_iostream_discard(), ast_iostream_printf(), ast_json_timeval(), ast_log_backtrace(), ast_openstream_full(), ast_openvstream(), ast_parse_arg(), ast_presence_state_changed(), ast_print_group(), ast_read_image(), ast_recvchar(), ast_recvtext(), ast_remotecontrol(), ast_rtp_instance_get_quality(), ast_say_digits_full(), ast_say_number_full_zh(), ast_set_default_eid(), ast_sip_contact_to_str(), ast_sip_create_ami_event(), ast_sip_format_contact_ami(), ast_slinfactory_read(), ast_sorcery_objectset_json_create(), ast_state2str(), ast_statsd_log_full_va(), ast_statsd_log_string_va(), ast_str_buffer(), ast_str_get_encoded_str(), ast_str_reset(), ast_str_size(), ast_str_strlen(), ast_str_thread_get(), ast_str_trim_blanks(), ast_str_update(), ast_stream_create_resolved(), ast_term_color(), ast_test_debug(), AST_TEST_DEFINE(), ast_threadstorage_get(), ast_translate_number_ka(), ast_udptl_read(), ast_udptl_write(), AST_VECTOR(), ast_vector_string_split(), ast_writefile(), ast_xmldoc_printable(), ast_yy_scan_bytes(), asterisk_daemon(), astman_append(), astman_append_json(), astman_send_error_va(), astman_send_list_complete(), astman_send_list_complete_start(), astman_send_list_complete_start_common(), astman_send_response_full(), audiohook_read_frame_single(), auth_exec(), bucket_copy(), build_callid_pvt(), build_callid_registry(), build_peer(), build_regex(), build_user(), caldav_request(), callerid_feed(), callerid_feed_jp(), cb_events(), cdr_read(), chan_pjsip_new(), check_auth(), check_header(), check_password(), cli_console_sendtext(), cli_show_subscription_common(), compile_script(), complete_skinny_debug(), conf_run(), config_parse_variables(), config_text_file_load(), console_sendtext(), cops_getmsg(), cops_sendmsg(), copy(), corosync_show_members(), cpg_deliver_cb(), create_followme_number(), csv_log(), csv_quote(), custom_devstate_callback(), custom_presence_callback(), dahdi_chan_conf_default(), dahdi_sendtext(), dahdi_setoption(), dahdi_sig2str(), deliver_file(), destroy_mysql(), dialgroup_refreshdb(), dialog_associations_hash(), display_single_entry(), do_monitor(), do_monitor_headset(), do_monitor_phone(), do_notify(), dtls_handler(), dtmf_info_incoming_request(), dump_prov_flags(), dundi_flags2str(), dundi_hint2str(), enc_ie_facility(), end_bridge_callback(), epoch_to_string(), evaluate_like(), event2str(), exchangecal_request(), export_aoc_vars(), fax_generator_generate(), fetch_google_access_token(), fill_bridgepeer_buf(), filter(), flip_buf_bits(), 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_message_ap(), func_read_header(), function_db_delete_write(), function_ooh323_write(), g723_samples(), gen_prios(), generate_naptr_record(), generate_random_string(), generate_srv_record(), generate_uri(), get_line(), get_local_address(), get_mapping_weight(), get_single_field_as_var_list(), get_token(), get_transport_list(), handle_bchan(), handle_cdr_pgsql_status(), handle_clear_alarms(), handle_cli_cdr_mysql_status(), handle_cli_config_reload(), handle_cli_indication_show(), handle_cli_misdn_show_port(), handle_cli_misdn_show_stacks(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_realtime_pgsql_status(), handle_commandmatchesarray(), handle_common_options(), handle_dbget(), handle_input(), handle_jack_audio(), handle_minivm_show_stats(), handle_msg_cb(), handle_recvtext(), handle_request_info(), handle_request_notify(), handle_request_subscribe(), handle_select_codec(), handle_show_calendar(), handle_show_hint(), handle_show_hints(), handle_show_settings(), handle_speechrecognize(), handle_t38_options(), has_destination_cb(), header_identify_match_check(), headers_to_vars(), hfp_parse_clip(), http_callback(), iax_provflags2str(), iax_str2flags(), iCBSearch(), isodate(), jb_debug_output(), jb_error_output(), jb_warning_output(), keypad_cfg_read(), linear_generator(), load_config(), log_action(), logger_print_normal(), loopback_parse(), loopback_subst(), main(), manager_bchannel_activate(), manager_bchannel_deactivate(), manager_log(), manager_park(), message_template_parse_filebody(), milliwatt_generate(), misdn_digit_end(), misdn_facility_ie_handler(), misdn_lib_destroy(), misdn_lib_send_tone(), misdn_lib_tx2misdn_frm(), misdn_tx_jitter(), moh_generate(), my_distinctive_ring(), my_get_callerid(), my_on_hook(), nominal_sync_run(), openssl_error_string(), parse_name_andor_addr(), pbx_builtin_background(), pcm_write(), pgsql_log(), phase_e_handler(), pjsip_acf_channel_read(), pjsip_acf_parse_uri_read(), poll_mailbox(), powiedz(), print_group(), print_named_groups(), printdigest(), process_description_file(), process_message(), process_output(), process_text_line(), proto2str(), publish_to_corosync(), queue_set_param(), quote(), read_config(), read_environment(), read_mf_digits(), read_sf_digits(), readmimefile(), readStdin(), realtime_common(), realtime_ldap_status(), realtime_multi_mysql(), realtime_mysql(), receive_message(), reload_config(), reload_module(), remove_excess_lws(), rfc3326_add_reason_header(), rfc3326_use_reason_header(), rfcomm_write_full(), rotate_file(), run_agi(), rx_data_to_ast_msg(), say_date_generic(), say_enumeration_full(), say_number_full(), scan_thread(), search_directory_sub(), select_item_menu(), send_cluster_notify(), send_identify_ami_event(), send_rasterisk_connect_commands(), set(), set_bridge_peer_vars_multiparty(), set_channel_variables(), set_duration_var(), set_full_cmd(), set_insecure_flags(), show_dialplan_helper(), silence_generator_generate(), sip_call(), sip_cli_notify(), sip_endpoints_aors_ami(), sip_parse_register_line(), sip_publication_respond(), sip_report_security_event(), sip_route_list(), sip_subscribe_mwi(), sip_to_pjsip(), skinny_call(), sla_state(), sla_stop_ringing_trunk(), sms_generate(), sms_log(), sms_writefile(), socket_read(), softmix_mixing_loop(), spandsp_fax_read(), sqlite3_escape_column_op(), sqlite3_escape_string_helper(), ssl_error_to_string(), stack_destroy(), stasis_device_state_cb(), store_mysql(), store_pgsql(), store_tone_zone_ring_cadence(), stream_monitor(), string_tolower(), string_toupper(), strip_control_and_high(), synths_(), system_exec_helper(), tdd_feed(), te_lib_destroy(), test_cli_generate_results(), test_jb_debug_output(), test_jb_error_output(), test_jb_warn_output(), tls_method_to_str(), transmit_fake_auth_response(), transmit_request_with_auth(), transport_bind_handler(), transport_create(), transport_read(), try_load_key(), tzload(), unshift_push(), update2_mysql(), update_mysql(), update_to_uri(), vm_allocate_dh(), vm_change_password_shell(), vm_check_password_shell(), vm_play_folder_name_gr(), xml_copy_escape(), xml_encode_str(), xmpp_client_authenticate_digest(), and xmpp_client_receive().
int command_desc |
Definition at line 80 of file eagi_proxy.c.
Referenced by finalize(), main(), and readStdin().
pthread_mutex_t command_mutex |
Definition at line 96 of file eagi_proxy.c.
Referenced by main(), and readStdin().
char connected =1 |
Definition at line 82 of file eagi_proxy.c.
Referenced by agent_login_channel_config(), connectedline_write(), handle_request_invite(), handle_request_update(), handle_response_invite(), launch_monitor_thread(), main(), read_full(), read_some(), readSignal(), readStdin(), sip_call(), and write_amap().
char* end |
Definition at line 73 of file eagi_proxy.c.
Referenced by __ast_play_and_record(), _build_port_config(), _extension_match_core(), aco_process_config(), ari_originate_dial(), ast_audiosocket_connect(), ast_bridge_transfer_attended(), ast_sip_pubsub_generate_body_content(), ast_str_to_imax(), ast_str_to_umax(), ast_term_init(), AST_TEST_DEFINE(), ast_xml_escape(), ast_xmldoc_printable(), async_callback(), caldav_add_event(), caldav_get_events_between(), calendar_query_exec(), common_exec(), control_streamfile(), copy_via_headers(), create_local_sdp(), dahdi_create_channel_range(), dahdi_create_channels(), 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_table_cb(), find_unused_payload_in_range(), get_dial_bridge(), get_ewscal_ids_for(), get_range(), get_rdnis(), get_rpid(), h264_encap(), handle_cli_dialplan_add_extension(), handle_incoming_sdp(), headers_to_vars(), hp100_(), icalendar_add_event(), is_media_state_valid(), jb_debug_output(), jingle_outgoing_hook(), jingle_send_error_response(), jingle_send_session_info(), jingle_send_session_terminate(), keypad_cfg_read(), load_module(), main(), make_components(), misdn_cfg_update_ptp(), mock_tcp_loop(), mpeg4_encap(), new_invite(), off_nominal_async_callback(), osp_convert_outin(), ospfinished_exec(), parsedoublearg(), parsefreq(), parsetime(), parsevolarg(), parsevolume(), pbx_load_config(), publish_local_bridge_message(), rtp_ioqueue_thread_get_or_create(), safe_scan_int(), set_config(), sip_outbound_publish_callback(), sip_session_refresh(), sip_websocket_callback(), strreplace(), tds_log(), tone_detect(), transmit_invite(), two_bridge_attended_transfer(), update_caldav(), update_exchangecal(), update_header(), verify_mock_cdr_record(), websocket_echo_callback(), write_buf(), xmldoc_parse_specialtags(), and xmpp_client_service_discovery_get_hook().
pthread_t signal_thread |
Definition at line 97 of file eagi_proxy.c.
Referenced by main().
int speech_desc |
Definition at line 81 of file eagi_proxy.c.
Referenced by finalize(), main(), and readSignal().
pthread_t stdin_thread |
Definition at line 97 of file eagi_proxy.c.
Referenced by main().
char* winbuf |
Definition at line 72 of file eagi_proxy.c.
Referenced by finalize(), main(), and write_buf().
char window[WINSIZE] |
Definition at line 69 of file eagi_proxy.c.
Referenced by readSignal(), SimpleAnalysis(), and smb_pitch_shift().