rename the structs struct tone_zone_sound and struct tone_zone

defined in indications.h to ind_tone_zone_sound and ind_tone_zone,
to avoid conflicts with the structs with the same names
defined in tonezone.h

Hope i haven't missed any instance.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Luigi Rizzo
2006-12-25 06:38:09 +00:00
parent b93f1f3e37
commit 09f75aa6dc
12 changed files with 50 additions and 50 deletions

View File

@@ -99,7 +99,7 @@ static char *descrip =
static void play_dialtone(struct ast_channel *chan, char *mailbox) static void play_dialtone(struct ast_channel *chan, char *mailbox)
{ {
const struct tone_zone_sound *ts = NULL; const struct ind_tone_zone_sound *ts = NULL;
if(ast_app_has_voicemail(mailbox, NULL)) if(ast_app_has_voicemail(mailbox, NULL))
ts = ast_get_indication_tone(chan->zone, "dialrecall"); ts = ast_get_indication_tone(chan->zone, "dialrecall");
else else

View File

@@ -93,7 +93,7 @@ static int read_exec(struct ast_channel *chan, void *data)
int tries = 1, to = 0, x = 0; int tries = 1, to = 0, x = 0;
double tosec; double tosec;
char *argcopy = NULL; char *argcopy = NULL;
struct tone_zone_sound *ts; struct ind_tone_zone_sound *ts;
struct ast_flags flags = {0}; struct ast_flags flags = {0};
AST_DECLARE_APP_ARGS(arglist, AST_DECLARE_APP_ARGS(arglist,

View File

@@ -205,7 +205,7 @@ struct chan_list {
int other_pid; int other_pid;
struct chan_list *other_ch; struct chan_list *other_ch;
const struct tone_zone_sound *ts; const struct ind_tone_zone_sound *ts;
int overlap_dial; int overlap_dial;
int overlap_dial_task; int overlap_dial_task;
@@ -2775,7 +2775,7 @@ static enum ast_bridge_result misdn_bridge (struct ast_channel *c0,
static int dialtone_indicate(struct chan_list *cl) static int dialtone_indicate(struct chan_list *cl)
{ {
const struct tone_zone_sound *ts= NULL; const struct ind_tone_zone_sound *ts= NULL;
struct ast_channel *ast=cl->ast; struct ast_channel *ast=cl->ast;

View File

@@ -27,7 +27,7 @@
#define PROGRAM "zones2indication" #define PROGRAM "zones2indication"
void print_tone_zone_sound(struct tone_zone *zone_data, const char* name, void print_tone_zone_sound(struct ind_tone_zone *zone_data, const char* name,
int toneid) { int toneid) {
int i; int i;
for (i=0; i<ZT_TONE_MAX; i++) { for (i=0; i<ZT_TONE_MAX; i++) {
@@ -38,7 +38,7 @@ void print_tone_zone_sound(struct tone_zone *zone_data, const char* name,
} }
} }
void print_indications(struct tone_zone *zone_data) { void print_indications(struct ind_tone_zone *zone_data) {
int i; int i;
printf ( printf (

View File

@@ -111,7 +111,7 @@ static int func_channel_write(struct ast_channel *chan, char *function,
else if (!strcasecmp(data, "musicclass")) else if (!strcasecmp(data, "musicclass"))
locked_string_field_set(chan, musicclass, value); locked_string_field_set(chan, musicclass, value);
else if (!strcasecmp(data, "tonezone")) { else if (!strcasecmp(data, "tonezone")) {
struct tone_zone *new_zone; struct ind_tone_zone *new_zone;
if (!(new_zone = ast_get_indication_zone(value))) { if (!(new_zone = ast_get_indication_zone(value))) {
ast_log(LOG_ERROR, "Unknown country code '%s' for tonezone. Check indications.conf for available country codes.\n", value); ast_log(LOG_ERROR, "Unknown country code '%s' for tonezone. Check indications.conf for available country codes.\n", value);
ret = -1; ret = -1;

View File

@@ -442,7 +442,7 @@ struct ast_channel {
struct ast_cdr *cdr; /*!< Call Detail Record */ struct ast_cdr *cdr; /*!< Call Detail Record */
enum ast_channel_adsicpe adsicpe; /*!< Whether or not ADSI is detected on CPE */ enum ast_channel_adsicpe adsicpe; /*!< Whether or not ADSI is detected on CPE */
struct tone_zone *zone; /*!< Tone zone as set in indications.conf or struct ind_tone_zone *zone; /*!< Tone zone as set in indications.conf or
in the CHANNEL dialplan function */ in the CHANNEL dialplan function */
struct ast_channel_monitor *monitor; /*!< Channel monitoring */ struct ast_channel_monitor *monitor; /*!< Channel monitoring */

View File

@@ -34,8 +34,8 @@
#include "asterisk/lock.h" #include "asterisk/lock.h"
struct tone_zone_sound { struct ind_tone_zone_sound {
struct tone_zone_sound *next; /* next element */ struct ind_tone_zone_sound *next; /* next element */
const char *name; /* Identifing name */ const char *name; /* Identifing name */
const char *data; /* Actual zone description */ const char *data; /* Actual zone description */
/* Description is a series of tones of the format: /* Description is a series of tones of the format:
@@ -45,33 +45,33 @@ struct tone_zone_sound {
specified in milliseconds */ specified in milliseconds */
}; };
struct tone_zone { struct ind_tone_zone {
AST_RWLIST_ENTRY(tone_zone) list; AST_RWLIST_ENTRY(ind_tone_zone) list;
char country[5]; /* Country code */ char country[5]; /* Country code */
char alias[5]; /* is this an alias? */ char alias[5]; /* is this an alias? */
char description[40]; /* Description */ char description[40]; /* Description */
int nrringcadence; /* # registered ringcadence elements */ int nrringcadence; /* # registered ringcadence elements */
int *ringcadence; /* Ring cadence */ int *ringcadence; /* Ring cadence */
struct tone_zone_sound *tones; /* The known tones for this zone */ struct ind_tone_zone_sound *tones; /* The known tones for this zone */
}; };
/* set the default tone country */ /* set the default tone country */
int ast_set_indication_country(const char *country); int ast_set_indication_country(const char *country);
/* locate tone_zone, given the country. if country == NULL, use the default country */ /* locate tone_zone, given the country. if country == NULL, use the default country */
struct tone_zone *ast_get_indication_zone(const char *country); struct ind_tone_zone *ast_get_indication_zone(const char *country);
/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */ /* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication); struct ind_tone_zone_sound *ast_get_indication_tone(const struct ind_tone_zone *zone, const char *indication);
/* add a new country, if country exists, it will be replaced. */ /* add a new country, if country exists, it will be replaced. */
int ast_register_indication_country(struct tone_zone *country); int ast_register_indication_country(struct ind_tone_zone *country);
/* remove an existing country and all its indications, country must exist */ /* remove an existing country and all its indications, country must exist */
int ast_unregister_indication_country(const char *country); int ast_unregister_indication_country(const char *country);
/* add a new indication to a tone_zone. tone_zone must exist. if the indication already /* add a new indication to a tone_zone. tone_zone must exist. if the indication already
* exists, it will be replaced. */ * exists, it will be replaced. */
int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist); int ast_register_indication(struct ind_tone_zone *zone, const char *indication, const char *tonelist);
/* remove an existing tone_zone's indication. tone_zone must exist */ /* remove an existing tone_zone's indication. tone_zone must exist */
int ast_unregister_indication(struct tone_zone *zone, const char *indication); int ast_unregister_indication(struct ind_tone_zone *zone, const char *indication);
/* Start a tone-list going */ /* Start a tone-list going */
int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible); int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible);
@@ -79,10 +79,10 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist,
void ast_playtones_stop(struct ast_channel *chan); void ast_playtones_stop(struct ast_channel *chan);
/* support for walking through a list of indications */ /* support for walking through a list of indications */
struct tone_zone *ast_walk_indications(const struct tone_zone *cur); struct ind_tone_zone *ast_walk_indications(const struct ind_tone_zone *cur);
#if 0 #if 0
extern struct tone_zone *tone_zones; extern struct ind_tone_zone *tone_zones;
extern ast_mutex_t tzlock; extern ast_mutex_t tzlock;
#endif #endif

View File

@@ -62,7 +62,7 @@ of 'maxlen' or 'size' minus the original strlen() of collect digits.
*/ */
int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout) 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 ind_tone_zone_sound *ts;
int res=0, x=0; int res=0, x=0;
if (maxlen > size) if (maxlen > size)

View File

@@ -2301,7 +2301,7 @@ int ast_indicate_data(struct ast_channel *chan, int condition, const void *data,
if (condition < 0) if (condition < 0)
ast_playtones_stop(chan); ast_playtones_stop(chan);
else { else {
const struct tone_zone_sound *ts = NULL; const struct ind_tone_zone_sound *ts = NULL;
switch (condition) { switch (condition) {
case AST_CONTROL_RINGING: case AST_CONTROL_RINGING:
ts = ast_get_indication_tone(chan->zone, "ring"); ts = ast_get_indication_tone(chan->zone, "ring");

View File

@@ -337,12 +337,12 @@ void ast_playtones_stop(struct ast_channel *chan)
/*--------------------------------------------*/ /*--------------------------------------------*/
static AST_RWLIST_HEAD_STATIC(tone_zones, tone_zone); static AST_RWLIST_HEAD_STATIC(tone_zones, ind_tone_zone);
static struct tone_zone *current_tonezone; static struct ind_tone_zone *current_tonezone;
struct tone_zone *ast_walk_indications(const struct tone_zone *cur) struct ind_tone_zone *ast_walk_indications(const struct ind_tone_zone *cur)
{ {
struct tone_zone *tz = NULL; struct ind_tone_zone *tz = NULL;
AST_RWLIST_RDLOCK(&tone_zones); AST_RWLIST_RDLOCK(&tone_zones);
/* If cur is not NULL, then we have to iterate through - otherwise just return the first entry */ /* If cur is not NULL, then we have to iterate through - otherwise just return the first entry */
@@ -363,7 +363,7 @@ struct tone_zone *ast_walk_indications(const struct tone_zone *cur)
/* Set global indication country */ /* Set global indication country */
int ast_set_indication_country(const char *country) int ast_set_indication_country(const char *country)
{ {
struct tone_zone *zone = NULL; struct ind_tone_zone *zone = NULL;
/* If no country is specified or we are unable to find the zone, then return not found */ /* If no country is specified or we are unable to find the zone, then return not found */
if (!country || !(zone = ast_get_indication_zone(country))) if (!country || !(zone = ast_get_indication_zone(country)))
@@ -382,9 +382,9 @@ int ast_set_indication_country(const char *country)
} }
/* locate tone_zone, given the country. if country == NULL, use the default country */ /* locate tone_zone, given the country. if country == NULL, use the default country */
struct tone_zone *ast_get_indication_zone(const char *country) struct ind_tone_zone *ast_get_indication_zone(const char *country)
{ {
struct tone_zone *tz = NULL; struct ind_tone_zone *tz = NULL;
int alias_loop = 0; int alias_loop = 0;
AST_RWLIST_RDLOCK(&tone_zones); AST_RWLIST_RDLOCK(&tone_zones);
@@ -418,9 +418,9 @@ struct tone_zone *ast_get_indication_zone(const char *country)
} }
/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */ /* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication) struct ind_tone_zone_sound *ast_get_indication_tone(const struct ind_tone_zone *zone, const char *indication)
{ {
struct tone_zone_sound *ts = NULL; struct ind_tone_zone_sound *ts = NULL;
AST_RWLIST_RDLOCK(&tone_zones); AST_RWLIST_RDLOCK(&tone_zones);
@@ -447,10 +447,10 @@ struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, co
} }
/* helper function to delete a tone_zone in its entirety */ /* helper function to delete a tone_zone in its entirety */
static inline void free_zone(struct tone_zone* zone) static inline void free_zone(struct ind_tone_zone* zone)
{ {
while (zone->tones) { while (zone->tones) {
struct tone_zone_sound *tmp = zone->tones->next; struct ind_tone_zone_sound *tmp = zone->tones->next;
free((void*)zone->tones->name); free((void*)zone->tones->name);
free((void*)zone->tones->data); free((void*)zone->tones->data);
free(zone->tones); free(zone->tones);
@@ -466,9 +466,9 @@ static inline void free_zone(struct tone_zone* zone)
/*--------------------------------------------*/ /*--------------------------------------------*/
/* add a new country, if country exists, it will be replaced. */ /* add a new country, if country exists, it will be replaced. */
int ast_register_indication_country(struct tone_zone *zone) int ast_register_indication_country(struct ind_tone_zone *zone)
{ {
struct tone_zone *tz = NULL; struct ind_tone_zone *tz = NULL;
AST_RWLIST_WRLOCK(&tone_zones); AST_RWLIST_WRLOCK(&tone_zones);
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&tone_zones, tz, list) { AST_RWLIST_TRAVERSE_SAFE_BEGIN(&tone_zones, tz, list) {
@@ -502,7 +502,7 @@ int ast_register_indication_country(struct tone_zone *zone)
* Also, all countries which are an alias for the specified country are removed. */ * Also, all countries which are an alias for the specified country are removed. */
int ast_unregister_indication_country(const char *country) int ast_unregister_indication_country(const char *country)
{ {
struct tone_zone *tz = NULL; struct ind_tone_zone *tz = NULL;
int res = -1; int res = -1;
AST_RWLIST_WRLOCK(&tone_zones); AST_RWLIST_WRLOCK(&tone_zones);
@@ -529,9 +529,9 @@ int ast_unregister_indication_country(const char *country)
/* add a new indication to a tone_zone. tone_zone must exist. if the indication already /* add a new indication to a tone_zone. tone_zone must exist. if the indication already
* exists, it will be replaced. */ * exists, it will be replaced. */
int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist) int ast_register_indication(struct ind_tone_zone *zone, const char *indication, const char *tonelist)
{ {
struct tone_zone_sound *ts, *ps; struct ind_tone_zone_sound *ts, *ps;
/* is it an alias? stop */ /* is it an alias? stop */
if (zone->alias[0]) if (zone->alias[0])
@@ -567,9 +567,9 @@ int ast_register_indication(struct tone_zone *zone, const char *indication, cons
} }
/* remove an existing country's indication. Both country and indication must exist */ /* remove an existing country's indication. Both country and indication must exist */
int ast_unregister_indication(struct tone_zone *zone, const char *indication) int ast_unregister_indication(struct ind_tone_zone *zone, const char *indication)
{ {
struct tone_zone_sound *ts,*ps = NULL, *tmp; struct ind_tone_zone_sound *ts,*ps = NULL, *tmp;
int res = -1; int res = -1;
/* is it an alias? stop */ /* is it an alias? stop */

View File

@@ -85,7 +85,7 @@ char *playtones_desc=
*/ */
static int handle_add_indication(int fd, int argc, char *argv[]) static int handle_add_indication(int fd, int argc, char *argv[])
{ {
struct tone_zone *tz; struct ind_tone_zone *tz;
int created_country = 0; int created_country = 0;
if (argc != 5) return RESULT_SHOWUSAGE; if (argc != 5) return RESULT_SHOWUSAGE;
@@ -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[]) 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 && argc != 4) return RESULT_SHOWUSAGE;
if (argc == 3) { 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[]) 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]; char buf[256];
int found_country = 0; 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++) { for (i=2; i<argc; i++) {
if (strcasecmp(tz->country,argv[i])==0 && if (strcasecmp(tz->country,argv[i])==0 &&
!tz->alias[0]) { !tz->alias[0]) {
struct tone_zone_sound* ts; struct ind_tone_zone_sound* ts;
if (!found_country) { if (!found_country) {
found_country = 1; found_country = 1;
ast_cli(fd,"Country Indication PlayList\n" 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) static int handle_playtones(struct ast_channel *chan, void *data)
{ {
struct tone_zone_sound *ts; struct ind_tone_zone_sound *ts;
int res; int res;
if (!data || !((char*)data)[0]) { if (!data || !((char*)data)[0]) {
@@ -231,7 +231,7 @@ static int ind_load_module(void)
struct ast_variable *v; struct ast_variable *v;
char *cxt; char *cxt;
char *c; char *c;
struct tone_zone *tones; struct ind_tone_zone *tones;
const char *country = NULL; const char *country = NULL;
/* that the following cast is needed, is yuk! */ /* that the following cast is needed, is yuk! */
@@ -284,7 +284,7 @@ static int ind_load_module(void)
c = countries; c = countries;
country = strsep(&c,","); country = strsep(&c,",");
while (country) { while (country) {
struct tone_zone* azone; struct ind_tone_zone* azone;
if (!(azone = ast_calloc(1, sizeof(*azone)))) { if (!(azone = ast_calloc(1, sizeof(*azone)))) {
ast_config_destroy(cfg); ast_config_destroy(cfg);
return -1; return -1;
@@ -300,7 +300,7 @@ static int ind_load_module(void)
} }
} else { } else {
/* add tone to country */ /* 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) { for (ps=NULL,ts=tones->tones; ts; ps=ts, ts=ts->next) {
if (strcasecmp(v->name,ts->name)==0) { if (strcasecmp(v->name,ts->name)==0) {
/* already there */ /* already there */

View File

@@ -622,7 +622,7 @@ static u_char *ast_var_indications(struct variable *vp, oid *name, size_t *lengt
int exact, size_t *var_len, WriteMethod **write_method) int exact, size_t *var_len, WriteMethod **write_method)
{ {
static unsigned long long_ret; static unsigned long long_ret;
struct tone_zone *tz = NULL; struct ind_tone_zone *tz = NULL;
if (header_generic(vp, name, length, exact, var_len, write_method)) if (header_generic(vp, name, length, exact, var_len, write_method))
return NULL; return NULL;
@@ -652,7 +652,7 @@ static u_char *ast_var_indications_table(struct variable *vp, oid *name, size_t
int exact, size_t *var_len, WriteMethod **write_method) int exact, size_t *var_len, WriteMethod **write_method)
{ {
static unsigned long long_ret; static unsigned long long_ret;
struct tone_zone *tz = NULL; struct ind_tone_zone *tz = NULL;
int i; int i;
if (header_simple_table(vp, name, length, exact, var_len, write_method, -1)) if (header_simple_table(vp, name, length, exact, var_len, write_method, -1))