Merge a large set of updates to the Asterisk indications API.

This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

Review: http://reviewboard.digium.com/r/149/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2009-02-17 20:41:24 +00:00
parent 4ac9617be5
commit 4ec301360c
21 changed files with 1328 additions and 883 deletions

View File

@@ -75,21 +75,24 @@ static AST_RWLIST_HEAD_STATIC(groups, ast_group_info);
*/
int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout)
{
struct tone_zone_sound *ts;
struct ast_tone_zone_sound *ts;
int res = 0, x = 0;
if (maxlen > size)
maxlen = size;
if (!timeout && chan->pbx)
if (!timeout && chan->pbx) {
timeout = chan->pbx->dtimeoutms / 1000.0;
else if (!timeout)
} else if (!timeout) {
timeout = 5;
}
if ((ts = ast_get_indication_tone(chan->zone, "dial")) && ts->data[0])
if ((ts = ast_get_indication_tone(chan->zone, "dial"))) {
res = ast_playtones_start(chan, 0, ts->data, 0);
else
ts = ast_tone_zone_sound_unref(ts);
} else {
ast_log(LOG_NOTICE, "Huh....? no dial for indications?\n");
}
for (x = strlen(collect); x < maxlen; ) {
res = ast_waitfordigit(chan, timeout);