| Asterisk - The Open Source Telephony Project GIT-master-27fb039
    | 
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. | |
| struct ast_tone_zone * | ast_get_indication_zone (const char *country) | 
| locate ast_tone_zone | |
| int | ast_playtones_start (struct ast_channel *chan, int vol, const char *tonelist, int interruptible) | 
| Start playing a list of tones on a channel. | |
| void | ast_playtones_stop (struct ast_channel *chan) | 
| Stop playing tones on a channel. | |
| int | ast_tone_zone_count (void) | 
| Get the number of registered tone zones. | |
| struct ao2_iterator | ast_tone_zone_iterator_init (void) | 
| Get an iterator for the available tone zones. | |
| int | ast_tone_zone_part_parse (const char *s, struct ast_tone_zone_part *tone_data) | 
| Parse a tone part. | |
| static struct ast_tone_zone * | ast_tone_zone_ref (struct ast_tone_zone *tz) | 
| Increase the reference count on an ast_tone_zone. | |
| 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. | |
| 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. | |
| static struct ast_tone_zone * | ast_tone_zone_unref (struct ast_tone_zone *tz) | 
| Release a reference to an ast_tone_zone. | |
Tone Indication Support.
Definition in file indications.h.
Lock an ast_tone_zone.
Definition at line 188 of file indications.h.
| #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.
| #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 461 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_zones, default_tone_zone, ast_tone_zone_sound::name, NULL, and ast_tone_zone::tones.
Referenced by ast_app_dtget(), ast_control_tone(), dial_handle_playtones(), 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 439 of file indications.c.
References ao2_find, ao2_lock, ao2_unlock, ast_copy_string(), ast_strlen_zero(), ast_tone_zone_ref(), ast_tone_zones, country, ast_tone_zone::country, default_tone_zone, ast_tone_zone::nrringcadence, NULL, OBJ_POINTER, and tz.
Referenced by ast_control_tone(), ast_set_indication_country(), ast_var_indications(), build_device(), chan_pjsip_new(), 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 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, d, ast_tone_zone_part::freq1, ast_tone_zone_part::freq2, playtones_def::interruptible, LOG_ERROR, M_PI, midi_tohz, ast_tone_zone_part::midinote, ast_tone_zone_part::modulate, NULL, playtones, 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(), 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_tone_burst(), sendfax_t38_init(), and sf_stream().
| 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(), 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(), and ast_tone_zones.
| 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(), and ast_tone_zones.
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().
| 
 | inlinestatic | 
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(), func_channel_write_real(), and handle_cli_indication_show().
| 
 | inlinestatic | 
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().
| 
 | inlinestatic | 
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(), and send_dial_tone().
| 
 | inlinestatic | 
Release a reference to an ast_tone_zone.
Definition at line 205 of file indications.h.
References ao2_ref, NULL, and tz.
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(), 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(), and unload_module().