Fix up the AGI doc dump CLI command and update the AGI commands tex file to not
[asterisk/asterisk.git] / res / res_indications.c
index a4d8ae2..7397218 100644 (file)
@@ -85,7 +85,7 @@ char *playtones_desc=
  */
 static int handle_add_indication(int fd, int argc, char *argv[])
 {
-       struct tone_zone *tz;
+       struct ind_tone_zone *tz;
        int created_country = 0;
        if (argc != 5) return RESULT_SHOWUSAGE;
 
@@ -100,7 +100,7 @@ static int handle_add_indication(int fd, int argc, char *argv[])
                ast_copy_string(tz->country,argv[2],sizeof(tz->country));
                if (ast_register_indication_country(tz)) {
                        ast_log(LOG_WARNING, "Unable to register new country\n");
-                       free(tz);
+                       ast_free(tz);
                        return -1;
                }
                created_country = 1;
@@ -119,7 +119,7 @@ static int handle_add_indication(int fd, int argc, char *argv[])
  */
 static int handle_remove_indication(int fd, int argc, char *argv[])
 {
-       struct tone_zone *tz;
+       struct ind_tone_zone *tz;
        if (argc != 3 && argc != 4) return RESULT_SHOWUSAGE;
 
        if (argc == 3) {
@@ -148,7 +148,7 @@ static int handle_remove_indication(int fd, int argc, char *argv[])
  */
 static int handle_show_indications(int fd, int argc, char *argv[])
 {
-       struct tone_zone *tz = NULL;
+       struct ind_tone_zone *tz = NULL;
        char buf[256];
        int found_country = 0;
 
@@ -166,7 +166,7 @@ static int handle_show_indications(int fd, int argc, char *argv[])
                for (i=2; i<argc; i++) {
                        if (strcasecmp(tz->country,argv[i])==0 &&
                            !tz->alias[0]) {
-                               struct tone_zone_sound* ts;
+                               struct ind_tone_zone_sound* ts;
                                if (!found_country) {
                                        found_country = 1;
                                        ast_cli(fd,"Country Indication      PlayList\n"
@@ -196,7 +196,7 @@ static int handle_show_indications(int fd, int argc, char *argv[])
  */
 static int handle_playtones(struct ast_channel *chan, void *data)
 {
-       struct tone_zone_sound *ts;
+       struct ind_tone_zone_sound *ts;
        int res;
 
        if (!data || !((char*)data)[0]) {
@@ -231,7 +231,7 @@ static int ind_load_module(void)
        struct ast_variable *v;
        char *cxt;
        char *c;
-       struct tone_zone *tones;
+       struct ind_tone_zone *tones;
        const char *country = NULL;
 
        /* that the following cast is needed, is yuk! */
@@ -284,7 +284,7 @@ static int ind_load_module(void)
                                c = countries;
                                country = strsep(&c,",");
                                while (country) {
-                                       struct tone_zone* azone;
+                                       struct ind_tone_zone* azone;
                                        if (!(azone = ast_calloc(1, sizeof(*azone)))) {
                                                ast_config_destroy(cfg);
                                                return -1;
@@ -293,14 +293,14 @@ static int ind_load_module(void)
                                        ast_copy_string(azone->alias, cxt, sizeof(azone->alias));
                                        if (ast_register_indication_country(azone)) {
                                                ast_log(LOG_WARNING, "Unable to register indication alias at line %d.\n",v->lineno);
-                                               free(tones);
+                                               ast_free(tones);
                                        }
                                        /* next item */
                                        country = strsep(&c,",");
                                }
                        } else {
                                /* add tone to country */
-                               struct tone_zone_sound *ps,*ts;
+                               struct ind_tone_zone_sound *ps,*ts;
                                for (ps=NULL,ts=tones->tones; ts; ps=ts, ts=ts->next) {
                                        if (strcasecmp(v->name,ts->name)==0) {
                                                /* already there */
@@ -314,8 +314,8 @@ static int ind_load_module(void)
                                        return -1;
                                }
                                ts->next = NULL;
-                               ts->name = strdup(v->name);
-                               ts->data = strdup(v->value);
+                               ts->name = ast_strdup(v->name);
+                               ts->data = ast_strdup(v->value);
                                if (ps)
                                        ps->next = ts;
                                else
@@ -326,9 +326,9 @@ out:                        v = v->next;
                if (tones->description[0] || tones->alias[0] || tones->tones) {
                        if (ast_register_indication_country(tones)) {
                                ast_log(LOG_WARNING, "Unable to register indication at line %d.\n",v->lineno);
-                               free(tones);
+                               ast_free(tones);
                        }
-               } else free(tones);
+               } else ast_free(tones);
 
                cxt = ast_category_browse(cfg, cxt);
        }
@@ -394,7 +394,7 @@ static int reload(void)
        return ind_load_module();
 }
 
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Indications Resource",
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Region-specific tones",
                .load = load_module,
                .unload = unload_module,
                .reload = reload,