Asterisk - The Open Source Telephony Project
21.4.1
|
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. | |
#define | ast_tone_zone_trylock(tz) ao2_trylock(tz) |
Trylock an ast_tone_zone. | |
#define | ast_tone_zone_unlock(tz) ao2_unlock(tz) |
Unlock an ast_tone_zone. | |
#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.
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 461 of file indications.c.
References 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, and ast_tone_zone::tones.
Referenced by ast_app_dtget(), ast_control_tone(), and indicate_data_internal().
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 439 of file indications.c.
References ast_copy_string(), ast_tone_zone_ref(), ast_tone_zone::country, ast_tone_zone::nrringcadence, and OBJ_POINTER.
Referenced by ast_control_tone(), ast_set_indication_country(), and chan_pjsip_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_realloc, ast_strdupa, ast_strip(), and ast_tone_zone_part_parse().
Referenced by ast_app_dtget(), ast_control_tone(), ast_senddigit_begin(), ast_senddigit_mf_begin(), indicate_data_internal(), and send_tone_burst().
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(), indicate_data_internal(), and send_tone_burst().
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().
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.
Referenced by ast_playtones_start().
|
static |
Increase the reference count on an ast_tone_zone.
Definition at line 216 of file indications.h.
References ao2_ref.
Referenced by ast_get_indication_tone(), ast_get_indication_zone(), ast_register_indication_country(), and ast_set_indication_country().
|
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.
References ao2_ref.
Referenced by ast_app_dtget(), ast_control_tone(), ast_register_indication(), ast_tone_zone_destructor(), ast_unregister_indication(), indicate_data_internal(), and prune_tone_zone().
|
static |
Release a reference to an ast_tone_zone.
Definition at line 205 of file indications.h.
References ao2_ref.
Referenced by ast_channel_destructor(), ast_control_tone(), ast_get_indication_tone(), ast_set_indication_country(), and ast_unregister_indication_country().