|
|
|
@ -416,12 +416,12 @@ struct ao2_iterator ast_tone_zone_iterator_init(void)
|
|
|
|
|
return ao2_iterator_init(ast_tone_zones, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set global indication country */
|
|
|
|
|
/*! \brief Set global indication country
|
|
|
|
|
If no country is specified or we are unable to find the zone, then return not found */
|
|
|
|
|
static int ast_set_indication_country(const char *country)
|
|
|
|
|
{
|
|
|
|
|
struct ast_tone_zone *zone = NULL;
|
|
|
|
|
|
|
|
|
|
/* If no country is specified or we are unable to find the zone, then return not found */
|
|
|
|
|
if (ast_strlen_zero(country) || !(zone = ast_get_indication_zone(country))) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
@ -440,7 +440,7 @@ static int ast_set_indication_country(const char *country)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* locate ast_tone_zone, given the country. if country == NULL, use the default country */
|
|
|
|
|
/*! \brief locate ast_tone_zone, given the country. if country == NULL, use the default country */
|
|
|
|
|
struct ast_tone_zone *ast_get_indication_zone(const char *country)
|
|
|
|
|
{
|
|
|
|
|
struct ast_tone_zone *tz = NULL;
|
|
|
|
@ -530,7 +530,7 @@ static void ast_tone_zone_destructor(void *obj)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* add a new country, if country exists, it will be replaced. */
|
|
|
|
|
/*! \brief add a new country, if country exists, it will be replaced. */
|
|
|
|
|
static int ast_register_indication_country(struct ast_tone_zone *zone)
|
|
|
|
|
{
|
|
|
|
|
ao2_lock(ast_tone_zones);
|
|
|
|
@ -546,7 +546,7 @@ static int ast_register_indication_country(struct ast_tone_zone *zone)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* remove an existing country and all its indications, country must exist. */
|
|
|
|
|
/*! \brief remove an existing country and all its indications, country must exist. */
|
|
|
|
|
static int ast_unregister_indication_country(const char *country)
|
|
|
|
|
{
|
|
|
|
|
struct ast_tone_zone *tz = NULL;
|
|
|
|
@ -610,7 +610,7 @@ static int ast_register_indication(struct ast_tone_zone *zone, const char *indic
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* remove an existing country's indication. Both country and indication must exist */
|
|
|
|
|
/*! \brief remove an existing country's indication. Both country and indication must exist */
|
|
|
|
|
static int ast_unregister_indication(struct ast_tone_zone *zone, const char *indication)
|
|
|
|
|
{
|
|
|
|
|
struct ast_tone_zone_sound *ts;
|
|
|
|
@ -895,7 +895,8 @@ static int is_valid_tone_zone(struct ast_tone_zone *zone)
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
/*!\brief
|
|
|
|
|
*
|
|
|
|
|
* \note This is called with the tone zone locked.
|
|
|
|
|
*/
|
|
|
|
|
static void store_tone_zone_ring_cadence(struct ast_tone_zone *zone, const char *val)
|
|
|
|
@ -994,7 +995,7 @@ static int parse_tone_zone(struct ast_config *cfg, const char *country)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
/*! \brief
|
|
|
|
|
* Mark the zone and its tones before parsing configuration. We will use this
|
|
|
|
|
* to know what to remove after configuration is parsed.
|
|
|
|
|
*/
|
|
|
|
@ -1016,7 +1017,7 @@ static int tone_zone_mark(void *obj, void *arg, int flags)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
/*! \brief
|
|
|
|
|
* Prune tones no longer in the configuration, and have the tone zone unlinked
|
|
|
|
|
* if it is no longer in the configuration at all.
|
|
|
|
|
*/
|
|
|
|
|