if (country == NULL)
return 0; /* not a single country insight */
- if (ast_mutex_lock(&tzlock)) {
- ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
- return 0;
- }
+ ast_mutex_lock(&tzlock);
do {
for (tz=tone_zones; tz; tz=tz->next) {
if (strcasecmp(country,tz->country)==0) {
if (zone == NULL)
return 0; /* not a single country insight */
- if (ast_mutex_lock(&tzlock)) {
- ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
- return 0;
- }
+ ast_mutex_lock(&tzlock);
for (ts=zone->tones; ts; ts=ts->next) {
if (strcasecmp(indication,ts->name)==0) {
/* found indication! */
{
struct tone_zone *tz,*pz;
- if (ast_mutex_lock(&tzlock)) {
- ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
- return -1;
- }
+ ast_mutex_lock(&tzlock);
for (pz=NULL,tz=tone_zones; tz; pz=tz,tz=tz->next) {
if (strcasecmp(zone->country,tz->country)==0) {
/* tone_zone already there, replace */
struct tone_zone *tz, *pz = NULL, *tmp;
int res = -1;
- if (ast_mutex_lock(&tzlock)) {
- ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
- return -1;
- }
+ ast_mutex_lock(&tzlock);
tz = tone_zones;
while (tz) {
if (country==NULL ||
if (zone->alias[0])
return -1;
- if (ast_mutex_lock(&tzlock)) {
- ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
- return -2;
- }
+ ast_mutex_lock(&tzlock);
for (ps=NULL,ts=zone->tones; ts; ps=ts,ts=ts->next) {
if (strcasecmp(indication,ts->name)==0) {
/* indication already there, replace */
if (zone->alias[0])
return -1;
- if (ast_mutex_lock(&tzlock)) {
- ast_log(LOG_WARNING, "Unable to lock tone_zones list\n");
- return -1;
- }
+ ast_mutex_lock(&tzlock);
ts = zone->tones;
while (ts) {
if (strcasecmp(indication,ts->name)==0) {