Asterisk - The Open Source Telephony Project GIT-master-3dae2cf
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdarg.h>
#include <errno.h>
#include <assert.h>
#include "frame.h"
Go to the source code of this file.
Functions | |
void | argerror (char *s) |
void | argerrornum (char *s, Errornum code) |
void | argerrortxt (char *s, char *message) |
int | chat (const char *format,...) |
void | checknoargs (int argcount, char *args[]) |
double | double2db (double value) |
int | error (const char *format,...) |
void | fatalerror (const char *format,...) |
void | fatalperror (const char *string) |
int | findoption (int argcount, char *args[], char *s) |
int | getremainingfilelength (FILE *anyin, long *result) |
int | inform (const char *format,...) |
int | isoptionchar (char coal) |
void | makewavheader (void) |
char * | mallocconcat (char *one, char *two) |
char * | malloccopy (char *string) |
int | myexit (int value) |
void | parseargs (int argcount, char *args[], int fileswitch) |
int | parsedoublearg (int argcount, char *args[], char *string, double *result) |
char * | parsefilearg (int argcount, char *args[]) |
int | parsefreq (char *string, double *result) |
int | parseintarg (int argcount, char *args[], char *string, int *result) |
int | parseswitch (char *found, char *wanted) |
int | parseswitcharg (int argcount, char *args[], char *string) |
int | parsetime (char *string, int *result) |
int | parsetimearg (int argcount, char *args[], char *string, int *result) |
int | parsevolarg (int argcount, char *args[], char *string, double *result) |
int | parsevolume (char *s, double *result) |
void | readawaysamples (FILE *input, size_t size) |
void | readpkheader (FILE *anyin) |
void | readwavheader (FILE *anyin) |
int | say (const char *format,...) |
void | startstopwatch (void) |
static void | statistics (void) |
int | workloop (FILE *theinfile, FILE *theoutfile, int(*work)(short *buffer, int length)) |
Variables | |
unsigned short | channels |
FILE * | in |
char * | infilename |
int | iswav |
FILE * | out |
char * | outfilename |
int | samplefrequency |
unsigned short | samplewidth |
static char * | standardusage |
static char * | standardversion = "frame version 1.3, June 13th 2001" |
time_t | stopwatch |
static int | test_usage |
char * | usage = "" |
int | verboselevel |
char * | version = "" |
int | wavout |
void argerror | ( | char * | s | ) |
void argerrornum | ( | char * | s, |
Errornum | code | ||
) |
Definition at line 635 of file utils/frame.c.
References error(), fatalerror(), ME_HEADERONTEXTFILE, ME_NODOUBLE, ME_NOINFILE, ME_NOINT, ME_NOIOFILE, ME_NOOUTFILE, ME_NOSTDIN, ME_NOSTDIO, ME_NOSTDOUT, ME_NOSWITCH, ME_NOTENOUGHFILES, ME_NOTIME, ME_NOVOL, ME_THISCANTHAPPEN, ME_TOOMANYFILES, and NULL.
Referenced by main(), parseargs(), parsedoublearg(), parsefreq(), parseintarg(), parseswitch(), parseswitcharg(), parsetime(), parsetimearg(), and parsevolarg().
void argerrortxt | ( | char * | s, |
char * | message | ||
) |
Definition at line 704 of file utils/frame.c.
References error(), fatalerror(), and NULL.
Referenced by main(), and parseargs().
int chat | ( | const char * | format, |
... | |||
) |
Definition at line 971 of file utils/frame.c.
References result, and verboselevel.
Referenced by makewavheader(), myexit(), and readwavheader().
void checknoargs | ( | int | argcount, |
char * | args[] | ||
) |
Definition at line 717 of file utils/frame.c.
References args, error(), and fatalerror().
Referenced by main().
double double2db | ( | double | value | ) |
int error | ( | const char * | format, |
... | |||
) |
Definition at line 999 of file utils/frame.c.
References result.
Referenced by __ast_pbx_run(), __rtp_recvfrom(), acl_handler(), acl_handler_fn(), aco_info_init(), aco_process_ast_config(), add_calltoken_ignore(), append_ha_core(), append_string(), apply_general_options(), argerror(), argerrornum(), argerrortxt(), ast_append_acl(), ast_append_ha(), ast_append_ha_with_port(), ast_ari_get_docs(), ast_channel_internal_errno_set(), ast_iostream_printf(), ast_json_load_buf(), ast_json_load_file(), ast_json_load_new_file(), ast_json_load_str(), ast_json_load_string(), ast_json_vpack(), ast_odbc_find_table(), ast_parse_arg(), ast_tcptls_client_create(), ast_tcptls_server_start(), AST_TEST_DEFINE(), astman_send_error(), authenticate(), auto_unload_resource(), build_callno_limits(), build_expression_queue(), checknoargs(), cli_show_monitors(), conf_load_config(), confbridge_cfg_alloc(), copy_error(), deliver_file(), endpoint_acl_handler(), evaluate_history_entry(), event_session_allocation_error_handler(), exec(), fax_gateway_attach(), fax_gateway_detect_t38(), fax_gateway_framehook(), fax_gateway_start(), fetch_access_token(), fetch_google_access_token(), generic_fax_exec(), handle_cli_agi_show(), handle_cli_queue_test(), handle_parse_error(), handler_wait_for_message(), http_callback(), iax2_hangup(), iax2_write(), ip_identify_match_handler(), ip_identify_match_host_lookup(), jingle_outgoing_hook(), jingle_send_error_response(), load_config(), load_module(), load_or_reload_lua_stuff(), load_pjsip(), logged_dlclose(), lua_get_state(), message_template_build(), minivm_accmess_exec(), named_acl_config_alloc(), ogg_speex_open(), parse_error(), persistence_generator_data_str2struct(), pjsip_enable_logger_host(), pubsub_on_rx_mwi_notify_request(), receivefax_exec(), refer_progress_alloc(), send_packet(), sendfax_exec(), setup_filestack(), skel_config_alloc(), sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_id(), sorcery_astdb_retrieve_prefix(), sorcery_astdb_retrieve_regex(), sub_persistence_recreate(), t30_phase_e_handler(), test_config_alloc(), transport_localnet_handler(), unbound_config_alloc(), update2_ldap(), user_event_wait_for_events(), verification_apply(), verify_user_event_fields(), wait_for_channel_callback(), wait_for_device_state_updates(), write_cdr(), write_cel(), xmpp_component_register_get_hook(), xmpp_config_alloc(), and xmpp_pubsub_handle_error().
void fatalerror | ( | const char * | format, |
... | |||
) |
Definition at line 1010 of file utils/frame.c.
References myexit().
Referenced by argerror(), argerrornum(), argerrortxt(), checknoargs(), main(), and parseargs().
void fatalperror | ( | const char * | string | ) |
Definition at line 1020 of file utils/frame.c.
References myexit().
Referenced by main(), parsefilearg(), readawaysamples(), and workloop().
int findoption | ( | int | argcount, |
char * | args[], | ||
char * | s | ||
) |
Definition at line 900 of file utils/frame.c.
References args, isoptionchar(), and test_usage.
Referenced by parsedoublearg(), parseintarg(), parseswitcharg(), parsetimearg(), and parsevolarg().
int getremainingfilelength | ( | FILE * | anyin, |
long * | result | ||
) |
Definition at line 58 of file utils/frame.c.
References FALSE, result, samplewidth, and TRUE.
int inform | ( | const char * | format, |
... | |||
) |
Definition at line 985 of file utils/frame.c.
References result, and verboselevel.
Referenced by main(), parseargs(), and statistics().
int isoptionchar | ( | char | coal | ) |
Definition at line 319 of file utils/frame.c.
Referenced by findoption(), and parsefilearg().
void makewavheader | ( | void | ) |
Definition at line 219 of file utils/frame.c.
References channels, chat(), out, and samplefrequency.
Referenced by main(), myexit(), and parseargs().
char * mallocconcat | ( | char * | one, |
char * | two | ||
) |
Definition at line 1049 of file utils/frame.c.
char * malloccopy | ( | char * | string | ) |
int myexit | ( | int | value | ) |
Definition at line 922 of file utils/frame.c.
References chat(), makewavheader(), value, and wavout.
Referenced by fatalerror(), fatalperror(), and main().
void parseargs | ( | int | argcount, |
char * | args[], | ||
int | fileswitch | ||
) |
Definition at line 744 of file utils/frame.c.
References argerrornum(), argerrortxt(), args, channels, DEFAULTFREQ, errno, FALSE, fatalerror(), in, infilename, inform(), makewavheader(), ME_HEADERONTEXTFILE, ME_NOINFILE, ME_NOIOFILE, ME_NOOUTFILE, ME_NOSTDIN, ME_TOOMANYFILES, NULL, out, outfilename, parsefilearg(), parseintarg(), parseswitcharg(), readwavheader(), samplefrequency, samplewidth, standardusage, standardversion, test_usage, usage, verboselevel, version, and wavout.
Referenced by main().
int parsedoublearg | ( | int | argcount, |
char * | args[], | ||
char * | string, | ||
double * | result | ||
) |
Definition at line 505 of file utils/frame.c.
References argerrornum(), args, end, FALSE, findoption(), ME_NODOUBLE, result, say(), and TRUE.
char * parsefilearg | ( | int | argcount, |
char * | args[] | ||
) |
Definition at line 419 of file utils/frame.c.
References args, fatalperror(), isoptionchar(), malloc(), NULL, and result.
Referenced by main(), and parseargs().
int parsefreq | ( | char * | string, |
double * | result | ||
) |
Definition at line 393 of file utils/frame.c.
References argerrornum(), end, FALSE, ME_THISCANTHAPPEN, NULL, result, samplefrequency, and TRUE.
int parseintarg | ( | int | argcount, |
char * | args[], | ||
char * | string, | ||
int * | result | ||
) |
Definition at line 471 of file utils/frame.c.
References argerrornum(), args, c, FALSE, findoption(), ME_NOINT, result, say(), and TRUE.
Referenced by parseargs().
int parseswitch | ( | char * | found, |
char * | wanted | ||
) |
Definition at line 445 of file utils/frame.c.
References argerrornum(), FALSE, ME_NOSWITCH, and TRUE.
int parseswitcharg | ( | int | argcount, |
char * | args[], | ||
char * | string | ||
) |
Definition at line 457 of file utils/frame.c.
References argerrornum(), args, FALSE, findoption(), ME_NOSWITCH, and TRUE.
Referenced by parseargs().
int parsetime | ( | char * | string, |
int * | result | ||
) |
Definition at line 352 of file utils/frame.c.
References argerrornum(), end, FALSE, ME_THISCANTHAPPEN, NULL, result, samplefrequency, and TRUE.
Referenced by parsetimearg().
int parsetimearg | ( | int | argcount, |
char * | args[], | ||
char * | string, | ||
int * | result | ||
) |
Definition at line 332 of file utils/frame.c.
References argerrornum(), args, FALSE, findoption(), ME_NOTIME, parsetime(), result, and TRUE.
int parsevolarg | ( | int | argcount, |
char * | args[], | ||
char * | string, | ||
double * | result | ||
) |
Definition at line 539 of file utils/frame.c.
References argerrornum(), args, end, FALSE, findoption(), ME_NOVOL, result, say(), and TRUE.
int parsevolume | ( | char * | s, |
double * | result | ||
) |
Definition at line 590 of file utils/frame.c.
void readawaysamples | ( | FILE * | input, |
size_t | size | ||
) |
Definition at line 1069 of file utils/frame.c.
References BUFFSIZE, fatalperror(), free(), input(), malloc(), and NULL.
void readpkheader | ( | FILE * | anyin | ) |
Definition at line 76 of file utils/frame.c.
void readwavheader | ( | FILE * | anyin | ) |
Definition at line 126 of file utils/frame.c.
References channels, chat(), FALSE, iswav, samplefrequency, str, and TRUE.
Referenced by main(), and parseargs().
int say | ( | const char * | format, |
... | |||
) |
Definition at line 1026 of file utils/frame.c.
References result.
Referenced by parsedoublearg(), parseintarg(), parsevolarg(), and parsevolume().
void startstopwatch | ( | void | ) |
Definition at line 307 of file utils/frame.c.
References NULL, statistics(), and stopwatch.
Referenced by main().
|
static |
Definition at line 287 of file utils/frame.c.
References inform(), NULL, and stopwatch.
Referenced by internal_stasis_subscribe(), publish_msg(), rtp_instance_parse_transport_wide_cc(), rtp_transport_wide_cc_feedback_produce(), startstopwatch(), and subscription_invoke().
int workloop | ( | FILE * | theinfile, |
FILE * | theoutfile, | ||
int(*)(short *buffer, int length) | work | ||
) |
Definition at line 943 of file utils/frame.c.
References BUFFSIZE, FALSE, fatalperror(), malloc(), NULL, and TRUE.
unsigned short channels |
Definition at line 30 of file utils/frame.c.
Referenced by makewavheader(), parseargs(), and readwavheader().
FILE* in |
Definition at line 33 of file utils/frame.c.
Referenced by __rtp_recvfrom(), AbsQuantW(), ast_aes_decrypt(), ast_aes_encrypt(), AST_TEST_DEFINE(), bwexpand(), do_forward(), enhancerInterface(), evp_cipher_aes_decrypt(), evp_cipher_aes_encrypt(), evp_pkey_decrypt(), evp_pkey_encrypt(), evp_pkey_sign(), evp_pkey_verify(), fast_originate(), filterL(), filterM(), filterS(), gainquant(), ibpdfilter(), ibpfilter(), json_escape(), MD5Transform(), parseargs(), publish_dial_end_event(), readmimefile(), resampler_basic_direct_single(), resampler_basic_interpolate_single(), speex_resampler_process_float(), speex_resampler_process_int(), speex_resampler_process_interleaved_float(), speex_resampler_process_interleaved_int(), wait_for_answer(), and xml_translate().
char* infilename |
Definition at line 34 of file utils/frame.c.
Referenced by parseargs().
int iswav |
Definition at line 32 of file utils/frame.c.
Referenced by main(), and readwavheader().
FILE * out |
Definition at line 33 of file utils/frame.c.
Referenced by __ast_frdup(), __ast_frisolate(), __queues_show(), AbsQuantW(), acf_escape(), action_agents(), agent_handle_show_specific(), agent_show_requested(), ast_aes_decrypt(), ast_aes_encrypt(), ast_db_get_allocated(), ast_escape_quoted(), ast_escape_semicolons(), ast_fax_caps_to_str(), ast_http_create_response(), ast_http_send(), ast_manager_build_bridge_state_string_prefix(), ast_manager_build_channel_state_string_prefix(), ast_sip_retrieve_auths(), ast_sip_str_to_security_mechanism(), AST_TEST_DEFINE(), ast_translate(), ast_uri_encode(), ast_var_channels_table(), attended_transfer_to_json(), auth_http_callback(), blind_transfer_to_json(), bwexpand(), contact_add_security_headers_to_status(), custom_log(), dahdi_create_channel_range(), dahdi_digit_begin(), dahdi_digit_end(), dial_exec_full(), enhancerInterface(), evp_cipher_aes_decrypt(), evp_cipher_aes_encrypt(), evp_pkey_decrypt(), evp_pkey_encrypt(), function_realtime_read(), function_realtime_readdestroy(), generic_http_callback(), handle_show_translation_table(), httpstatus_callback(), insert_user_in_contact_uri(), interpolate(), isslavenative(), json_escape(), main(), makewavheader(), manager_build_parked_call_string(), multi_user_event_to_json(), parseargs(), print_queue(), print_uptimestr(), process_output(), process_token(), record_exec(), refer_client_on_evsub_state(), refer_on_tx_request(), resampler_basic_direct_single(), resampler_basic_interpolate_single(), resampler_basic_zero(), rfc3329_incoming_response(), sendmail(), set_security_requirements(), speex_resampler_magic(), speex_resampler_process_float(), speex_resampler_process_int(), speex_resampler_process_interleaved_float(), speex_resampler_process_interleaved_int(), speex_resampler_process_native(), StateConstructW(), try_calling(), unquote(), vm_execmain(), xml_copy_escape(), and xml_translate().
char * outfilename |
Definition at line 34 of file utils/frame.c.
Referenced by main(), and parseargs().
int samplefrequency |
Definition at line 28 of file utils/frame.c.
Referenced by makewavheader(), parseargs(), parsefreq(), parsetime(), and readwavheader().
unsigned short samplewidth |
Definition at line 29 of file utils/frame.c.
Referenced by getremainingfilelength(), and parseargs().
|
static |
Definition at line 41 of file utils/frame.c.
Referenced by parseargs().
|
static |
Definition at line 40 of file utils/frame.c.
Referenced by parseargs().
time_t stopwatch |
Definition at line 27 of file utils/frame.c.
Referenced by startstopwatch(), and statistics().
|
static |
Definition at line 38 of file utils/frame.c.
Referenced by findoption(), and parseargs().
char* usage = "" |
Definition at line 37 of file utils/frame.c.
Referenced by main(), parseargs(), and pbx_builtin_execiftime().
int verboselevel |
Definition at line 35 of file utils/frame.c.
Referenced by chat(), inform(), and parseargs().
char* version = "" |
Definition at line 36 of file utils/frame.c.
Referenced by parseargs().
int wavout |
Definition at line 31 of file utils/frame.c.
Referenced by main(), myexit(), and parseargs().