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... | |
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... | |
int | ast_tone_zone_data_add_structure (struct ast_data *tree, struct ast_tone_zone *zone) |
Add a tone_zone structure to the data tree specified. 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 187 of file indications.h.
Referenced by ast_get_indication_tone(), ast_tone_zone_data_add_structure(), 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 197 of file indications.h.
#define ast_tone_zone_unlock | ( | tz | ) | ao2_unlock(tz) |
Unlock an ast_tone_zone.
Definition at line 192 of file indications.h.
Referenced by ast_get_indication_tone(), ast_tone_zone_data_add_structure(), 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().
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 473 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_sound::name, and ast_tone_zone::tones.
Referenced by ast_app_dtget(), ast_indicate_data(), dial_handle_playtones(), dialtone_indicate(), handle_playtones(), in_band_indication(), pbx_builtin_waitexten(), play_dialtone(), read_exec(), readexten_exec(), and skinny_transfer().
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. |
Definition at line 451 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, OBJ_POINTER, and tz.
Referenced by ast_set_indication_country(), ast_var_indications(), build_device(), func_channel_write_real(), handle_cli_indication_add(), and handle_cli_indication_remove().
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 319 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, ast_tone_zone_part::midinote, playtones_item::modulate, ast_tone_zone_part::modulate, playtones_def::nitems, playtones_def::reppos, strsep(), ast_tone_zone_part::time, and playtones_def::vol.
Referenced by ast_app_dtget(), ast_indicate_data(), ast_senddigit_begin(), dial_handle_playtones(), dialtone_indicate(), handle_playtones(), in_band_indication(), milliwatt_exec(), pbx_builtin_waitexten(), play_dialtone(), playtone(), read_exec(), readexten_exec(), receivefax_t38_init(), send_digit_to_chan(), sendfax_t38_init(), and skinny_transfer().
void ast_playtones_stop | ( | struct ast_channel * | chan | ) |
Stop playing tones on a channel.
chan | the channel to stop tones on |
Definition at line 411 of file indications.c.
References ast_deactivate_generator().
Referenced by ast_app_dtget(), ast_indicate_data(), ast_senddigit_end(), disa_exec(), handle_stopplaytones(), pbx_builtin_waitexten(), playtone(), read_exec(), readexten_exec(), receivefax_t38_init(), sendfax_t38_init(), stop_indicate(), and unistim_indicate().
int ast_tone_zone_count | ( | void | ) |
Get the number of registered tone zones.
Definition at line 416 of file indications.c.
References ao2_container_count().
int ast_tone_zone_data_add_structure | ( | struct ast_data * | tree, |
struct ast_tone_zone * | zone | ||
) |
Add a tone_zone structure to the data tree specified.
<0 | on error. |
0 | on success. |
Definition at line 1127 of file indications.c.
References ast_data_add_node(), ast_data_add_structure, AST_LIST_EMPTY, AST_LIST_TRAVERSE, ast_tone_zone_lock, ast_tone_zone_unlock, ast_tone_zone_sound::entry, and ast_tone_zone::tones.
Referenced by ast_channel_data_add_structure().
struct ao2_iterator ast_tone_zone_iterator_init | ( | void | ) |
Get an iterator for the available tone zones.
Definition at line 421 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 262 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().
|
static |
Increase the reference count on an ast_tone_zone.
Definition at line 215 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 237 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 226 of file indications.h.
References ao2_ref.
Referenced by ast_app_dtget(), ast_indicate_data(), ast_register_indication(), ast_tone_zone_destructor(), ast_unregister_indication(), dial_handle_playtones(), handle_playtones(), in_band_indication(), pbx_builtin_waitexten(), play_dialtone(), prune_tone_zone(), read_exec(), readexten_exec(), skinny_transfer(), and stop_indicate().
|
static |
Release a reference to an ast_tone_zone.
Definition at line 204 of file indications.h.
References ao2_ref.
Referenced by ast_channel_destructor(), ast_set_indication_country(), ast_unregister_indication_country(), ast_var_indications(), ast_var_indications_table(), build_device(), complete_country(), complete_indications(), func_channel_write_real(), handle_cli_indication_add(), handle_cli_indication_remove(), handle_cli_indication_show(), indications_shutdown(), parse_tone_zone(), and reload_config().