25#include <dahdi/tonezone.h>
28#define PROGRAM "zones2indication"
33 for (i=0; i<DAHDI_TONE_MAX; i++) {
34 if (zone_data->tones[i].toneid == toneid){
35 printf(
"%s = %s\n",
name, zone_data->tones[i].data);
46 "; Source: libtonezone.\n"
49 zone_data->country, zone_data->description
56 if (zone_data->ringcadence[i] == 0)
60 printf(
"%d",zone_data->ringcadence[i]);
77 struct tone_zone *zone_data = tone_zone_find_by_num(zone_num);
79 if (zone_data ==
NULL)
88 struct tone_zone *zone_data = tone_zone_find(
country);
90 if (zone_data ==
NULL)
110 PROGRAM ": print libtonezone data as Asterisk indications.conf\n"
113 " " PROGRAM " -a Print all countries\n"
114 " " PROGRAM " -c <code> Select country by two-letter country code\n"
115 " " PROGRAM " -n <num> Select country by its internal libtonezone number\n"
116 " " PROGRAM " -h Print this text.\n"
120int main(
int argc,
char* argv[]){
121 int country_code = -1;
122 int opt_print_all = 0;
126 while((opt = getopt(argc, argv,
"ac:hn:")) != -1) {
136 printf(
"number is %s.\n", optarg);
137 country_code = strtol(optarg, &endptr, 10);
int main(int argc, char *argv[])
void print_indications(struct ind_tone_zone *zone_data)
void print_tone_zone_sound(struct ind_tone_zone *zone_data, const char *name, int toneid)
int print_zone_by_id(int zone_num)
int print_zone_by_country(char *country)