Asterisk - The Open Source Telephony Project
18.5.0
|
Tone Indication Support. More...
Go to the source code of this file.
Data Structures | |
struct | ast_tone_zone |
A set of tones for a given locale. More... | |
struct | ast_tone_zone_part |
A description of a part of a tone. More... | |
struct | ast_tone_zone_sound |
Description of a tone. More... | |
Macros | |
#define | ast_tone_zone_lock(tz) ao2_lock(tz) |
Lock an ast_tone_zone. More... | |
#define | ast_tone_zone_trylock(tz) ao2_trylock(tz) |
Trylock an ast_tone_zone. More... | |
#define | ast_tone_zone_unlock(tz) ao2_unlock(tz) |
Unlock an ast_tone_zone. More... | |
#define | MAX_TONEZONE_COUNTRY 16 |
Functions | |
struct ast_tone_zone_sound * | ast_get_indication_tone (const struct ast_tone_zone *zone, const char *indication) |
Locate a tone zone sound. More... | |
struct ast_tone_zone * | ast_get_indication_zone (const char *country) |
locate ast_tone_zone More... | |
int | ast_playtones_start (struct ast_channel *chan, int vol, const char *tonelist, int interruptible) |
Start playing a list of tones on a channel. More... | |
void | ast_playtones_stop (struct ast_channel *chan) |
Stop playing tones on a channel. More... | |
int | ast_tone_zone_count (void) |
Get the number of registered tone zones. More... | |
struct ao2_iterator | ast_tone_zone_iterator_init (void) |
Get an iterator for the available tone zones. More... | |
int | ast_tone_zone_part_parse (const char *s, struct ast_tone_zone_part *tone_data) |
Parse a tone part. More... | |
static struct ast_tone_zone * | ast_tone_zone_ref (struct ast_tone_zone *tz) |
Increase the reference count on an ast_tone_zone. More... | |
static struct ast_tone_zone_sound * | ast_tone_zone_sound_ref (struct ast_tone_zone_sound *ts) |
Increase the reference count on an ast_tone_zone_sound. More... | |
static struct ast_tone_zone_sound * | ast_tone_zone_sound_unref (struct ast_tone_zone_sound *ts) |
Release a reference to an ast_tone_zone_sound. More... | |
static struct ast_tone_zone * | ast_tone_zone_unref (struct ast_tone_zone *tz) |
Release a reference to an ast_tone_zone. More... | |
Tone Indication Support.
Definition in file indications.h.
Lock an ast_tone_zone.
Definition at line 188 of file indications.h.
Referenced by ast_get_indication_tone(), ast_unregister_indication(), ast_var_indications_table(), complete_indications(), handle_cli_indication_add(), handle_cli_indication_show(), is_valid_tone_zone(), parse_tone_zone(), prune_tone_zone(), reset_tone_zone(), and tone_zone_mark().
#define ast_tone_zone_trylock | ( | tz | ) | ao2_trylock(tz) |
Trylock an ast_tone_zone.
Definition at line 198 of file indications.h.
#define ast_tone_zone_unlock | ( | tz | ) | ao2_unlock(tz) |
Unlock an ast_tone_zone.
Definition at line 193 of file indications.h.
Referenced by ast_get_indication_tone(), ast_unregister_indication(), ast_var_indications_table(), complete_indications(), handle_cli_indication_add(), handle_cli_indication_show(), is_valid_tone_zone(), parse_tone_zone(), prune_tone_zone(), reset_tone_zone(), and tone_zone_mark().
#define MAX_TONEZONE_COUNTRY 16 |
Definition at line 64 of file indications.h.
struct ast_tone_zone_sound* ast_get_indication_tone | ( | const struct ast_tone_zone * | zone, |
const char * | indication | ||
) |
Locate a tone zone sound.
zone | Zone to look in for a sound, if NULL, the default will be used |
indication | Sound to look for, such as "busy" |
Definition at line 455 of file indications.c.
References ao2_lock, ao2_unlock, AST_LIST_TRAVERSE, ast_tone_zone_lock, ast_tone_zone_ref(), ast_tone_zone_sound_ref(), ast_tone_zone_unlock, ast_tone_zone_unref(), ast_tone_zone_sound::name, NULL, and ast_tone_zone::tones.
Referenced by ast_app_dtget(), ast_control_tone(), dial_handle_playtones(), dialtone_indicate(), handle_playtones(), in_band_indication(), indicate_data_internal(), pbx_builtin_waitexten(), play_dialtone(), read_exec(), readexten_exec(), and send_dial_tone().
struct ast_tone_zone* ast_get_indication_zone | ( | const char * | country | ) |
locate ast_tone_zone
country | country to find. If NULL is provided, get the default. |
locate ast_tone_zone
Definition at line 433 of file indications.c.
References ao2_find, ao2_lock, ao2_unlock, ast_copy_string(), ast_strlen_zero, ast_tone_zone_ref(), ast_tone_zone::country, ast_tone_zone::nrringcadence, NULL, OBJ_POINTER, and tz.
Referenced by ast_control_tone(), ast_set_indication_country(), ast_var_indications(), build_device(), build_peer(), chan_pjsip_new(), func_channel_write_real(), handle_cli_indication_add(), handle_cli_indication_remove(), reload_config(), and sip_new().
int ast_playtones_start | ( | struct ast_channel * | chan, |
int | vol, | ||
const char * | tonelist, | ||
int | interruptible | ||
) |
Start playing a list of tones on a channel.
chan | the channel to play tones on |
vol | volume |
tonelist | the list of tones to play, comma separated |
interruptible | whether or not this tone can be interrupted |
0 | success |
non-zero | failure |
Definition at line 302 of file indications.c.
References ast_activate_generator(), ast_free, ast_log, ast_realloc, ast_strdupa, ast_strip(), ast_strlen_zero, ast_tone_zone_part_parse(), cos, playtones_item::duration, playtones_item::fac1, playtones_item::fac2, ast_tone_zone_part::freq1, ast_tone_zone_part::freq2, playtones_item::init_v2_1, playtones_item::init_v2_2, playtones_item::init_v3_1, playtones_item::init_v3_2, playtones_def::interruptible, playtones_def::items, LOG_ERROR, M_PI, midi_tohz, ast_tone_zone_part::midinote, playtones_item::modulate, ast_tone_zone_part::modulate, playtones_def::nitems, NULL, playtones_def::reppos, strsep(), ast_tone_zone_part::time, and playtones_def::vol.
Referenced by ast_app_dtget(), ast_control_tone(), ast_senddigit_begin(), ast_senddigit_mf_begin(), control_tone_frame_response(), dial_handle_playtones(), dialtone_indicate(), handle_playtones(), in_band_indication(), indicate_data_internal(), mf_stream(), milliwatt_exec(), pbx_builtin_waitexten(), play_dialtone(), playtone(), read_exec(), readexten_exec(), receivefax_t38_init(), send_digit_to_chan(), send_tone_burst(), and sendfax_t38_init().
void ast_playtones_stop | ( | struct ast_channel * | chan | ) |
Stop playing tones on a channel.
chan | the channel to stop tones on |
Definition at line 393 of file indications.c.
References ast_deactivate_generator().
Referenced by ast_app_dtget(), ast_senddigit_end(), ast_senddigit_mf_end(), control_tone_frame_response(), disa_exec(), handle_stopplaytones(), indicate_data_internal(), pbx_builtin_waitexten(), playtone(), read_exec(), readexten_exec(), receivefax_t38_init(), send_tone_burst(), sendfax_t38_init(), stop_indicate(), and unistim_indicate().
int ast_tone_zone_count | ( | void | ) |
Get the number of registered tone zones.
Definition at line 398 of file indications.c.
References ao2_container_count().
struct ao2_iterator ast_tone_zone_iterator_init | ( | void | ) |
Get an iterator for the available tone zones.
Definition at line 403 of file indications.c.
References ao2_iterator_init().
Referenced by ast_var_indications(), ast_var_indications_table(), and handle_cli_indication_show().
int ast_tone_zone_part_parse | ( | const char * | s, |
struct ast_tone_zone_part * | tone_data | ||
) |
Parse a tone part.
s | The part of a tone to parse. This should be in the form described for the data part of ast_tone_zone_sound. '!' should be removed if present. |
tone_data | An output parameter that contains the result of the parsing. |
0 | success |
-1 | failure, and the contents of tone_data are undefined |
Definition at line 245 of file indications.c.
References ast_tone_zone_part::freq1, ast_tone_zone_part::freq2, ast_tone_zone_part::midinote, ast_tone_zone_part::modulate, and ast_tone_zone_part::time.
Referenced by ast_playtones_start(), and send_dial_tone().
|
static |
Increase the reference count on an ast_tone_zone.
Definition at line 216 of file indications.h.
Referenced by ast_get_indication_tone(), ast_get_indication_zone(), ast_register_indication_country(), ast_set_indication_country(), and func_channel_write_real().
|
static |
Increase the reference count on an ast_tone_zone_sound.
Definition at line 238 of file indications.h.
References ao2_ref.
Referenced by ast_get_indication_tone().
|
static |
Release a reference to an ast_tone_zone_sound.
Definition at line 227 of file indications.h.
Referenced by ast_app_dtget(), ast_control_tone(), ast_register_indication(), ast_tone_zone_destructor(), ast_unregister_indication(), dial_handle_playtones(), handle_playtones(), in_band_indication(), indicate_data_internal(), pbx_builtin_waitexten(), play_dialtone(), prune_tone_zone(), read_exec(), readexten_exec(), send_dial_tone(), and stop_indicate().
|
static |
Release a reference to an ast_tone_zone.
Definition at line 205 of file indications.h.
Referenced by ast_channel_destructor(), ast_control_tone(), ast_get_indication_tone(), ast_set_indication_country(), ast_unregister_indication_country(), ast_var_indications(), ast_var_indications_table(), build_device(), build_peer(), complete_country(), complete_indications(), delete_device(), func_channel_write_real(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_indication_show(), parse_tone_zone(), reload_config(), and unload_module().