if (havepattern)
regfree(®exbuf);
- ast_cli(fd, "%d active channel(s)\n", numchans);
+ ast_cli(fd, "%d active channel%s\n", numchans, (numchans != 1) ? "s" : "");
return RESULT_SUCCESS;
}
tries--;
if (option_verbose > 2) {
if (tries)
- ast_verbose(VERBOSE_PREFIX_3 "User entered nothing, %d chance(s) left\n", tries);
+ ast_verbose(VERBOSE_PREFIX_3 "User entered nothing, %d chance%s left\n", tries, (tries != 1) ? "s" : "");
else
ast_verbose(VERBOSE_PREFIX_3 "User entered nothing.\n");
}
return RESULT_SUCCESS;
}
- ast_cli(fd, "Updated %d RealTime record(s).\n", res);
+ ast_cli(fd, "Updated %d RealTime record%s.\n", res, (res != 1) ? "s" : "");
return RESULT_SUCCESS;
}
nextbatchtime = ast_sched_when(sched, cdr_sched);
ast_cli(fd, "CDR safe shut down: %s\n", batchsafeshutdown ? "enabled" : "disabled");
ast_cli(fd, "CDR batch threading model: %s\n", batchscheduleronly ? "scheduler only" : "scheduler plus separate threads");
- ast_cli(fd, "CDR current batch size: %d record(s)\n", cnt);
- ast_cli(fd, "CDR maximum batch size: %d record(s)\n", batchsize);
- ast_cli(fd, "CDR maximum batch time: %d second(s)\n", batchtime);
- ast_cli(fd, "CDR next scheduled batch processing time: %ld second(s)\n", nextbatchtime);
+ ast_cli(fd, "CDR current batch size: %d record%s\n", cnt, (cnt != 1) ? "s" : "");
+ ast_cli(fd, "CDR maximum batch size: %d record%s\n", batchsize, (batchsize != 1) ? "s" : "");
+ ast_cli(fd, "CDR maximum batch time: %d second%s\n", batchtime, (batchtime != 1) ? "s" : "");
+ ast_cli(fd, "CDR next scheduled batch processing time: %ld second%s\n", nextbatchtime, (nextbatchtime != 1) ? "s" : "");
}
AST_LIST_LOCK(&be_list);
AST_LIST_TRAVERSE(&be_list, beitem, list) {
}
ast_mutex_unlock(&iaxsl[x]);
}
- ast_cli(fd, "%d active IAX channel(s)\n", numchans);
+ ast_cli(fd, "%d active IAX channel%s\n", numchans, (numchans != 1) ? "s" : "");
return RESULT_SUCCESS;
#undef FORMAT
#undef FORMAT2
ast_cli(fd, " -------- LOCAL --------------------- -------- REMOTE --------------------\n");
ast_cli(fd, "Channel RTT Jit Del Lost %% Drop OOO Kpkts Jit Del Lost %% Drop OOO Kpkts\n");
numchans = ast_cli_netstats(fd, 1);
- ast_cli(fd, "%d active IAX channel(s)\n", numchans);
+ ast_cli(fd, "%d active IAX channel%s\n", numchans, (numchans != 1) ? "s" : "");
return RESULT_SUCCESS;
}
} else {
res = send_trunk(tpeer, &now);
if (iaxtrunkdebug)
- ast_verbose(" - Trunk peer (%s:%d) has %d call chunk(s) in transit, %d bytes backloged and has hit a high water mark of %d bytes\n", ast_inet_ntoa(iabuf, sizeof(iabuf), tpeer->addr.sin_addr), ntohs(tpeer->addr.sin_port), res, tpeer->trunkdatalen, tpeer->trunkdataalloc);
+ ast_verbose(" - Trunk peer (%s:%d) has %d call chunk%s in transit, %d bytes backloged and has hit a high water mark of %d bytes\n", ast_inet_ntoa(iabuf, sizeof(iabuf), tpeer->addr.sin_addr), ntohs(tpeer->addr.sin_port), res, (res != 1) ? "s" : "", tpeer->trunkdatalen, tpeer->trunkdataalloc);
}
totalcalls += res;
res = 0;
ast_mutex_unlock(&c->lock);
}
if(!concise) {
- ast_cli(fd, "%d active channel(s)\n", numchans);
+ ast_cli(fd, "%d active channel%s\n", numchans, (numchans!=1) ? "s" : "");
if (option_maxcalls)
- ast_cli(fd, "%d of %d max active call(s) (%5.2f%% of capacity)\n", ast_active_calls(), option_maxcalls, ((float)ast_active_calls() / (float)option_maxcalls) * 100.0);
+ ast_cli(fd, "%d of %d max active call%s (%5.2f%% of capacity)\n", ast_active_calls(), option_maxcalls, (ast_active_calls()!=1) ? "s" : "", ((float)ast_active_calls() / (float)option_maxcalls) * 100.0);
else
- ast_cli(fd, "%d active call(s)\n", ast_active_calls());
+ ast_cli(fd, "%d active call%s\n", ast_active_calls(), (ast_active_calls()!=1) ? "s" : "");
}
return RESULT_SUCCESS;
}
errors++;
}
if (errors) {
- ast_log(LOG_WARNING, "%d error(s) loading module %s, aborted\n", errors, fn);
+ ast_log(LOG_WARNING, "%d error%s loading module %s, aborted\n", errors, (errors != 1) ? "s" : "", fn);
dlclose(m->lib);
free(m);
ast_mutex_unlock(&modlock);
ast_log(LOG_NOTICE, "Call failed to go through, reason %d\n", reason);
if (o->retries >= o->maxretries + 1) {
/* Max retries exceeded */
- ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt(s)\n", o->tech, o->dest, o->retries - 1);
+ ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt%s\n", o->tech, o->dest, o->retries - 1, ((o->retries - 1) != 1) ? "s" : "");
unlink(o->fn);
} else {
/* Notate that the call is still active */
now += o->retrytime;
return now;
} else {
- ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt(s)\n", o->tech, o->dest, o->retries - 1);
+ ast_log(LOG_EVENT, "Queued call to %s/%s expired without completion after %d attempt%s\n", o->tech, o->dest, o->retries - 1, ((o->retries - 1) != 1) ? "s" : "");
free(o);
unlink(fn);
return 0;
cur = cur->next;
numparked++;
}
- ast_cli(fd, "%d parked call(s).\n",numparked);
+ ast_cli(fd, "%d parked call%s.\n", numparked, (numparked != 1) ? "s" : "");
ast_mutex_unlock(&parking_lock);