Index: pbx/pbx_dundi.c =================================================================== --- pbx/pbx_dundi.c (revision 253492) +++ pbx/pbx_dundi.c (working copy) @@ -2604,6 +2604,7 @@ ast_cli(a->fd, "Peer: %s\n", ast_eid_to_str(eid_str, sizeof(eid_str), &peer->eid)); ast_cli(a->fd, "Model: %s\n", model2str(peer->model)); ast_cli(a->fd, "Host: %s\n", peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : ""); + ast_cli(a->fd, "Port: %d\n", ntohs(peer->addr.sin_port)); ast_cli(a->fd, "Dynamic: %s\n", peer->dynamic ? "yes" : "no"); ast_cli(a->fd, "Reg: %s\n", peer->registerid < 0 ? "No" : "Yes"); ast_cli(a->fd, "In Key: %s\n", ast_strlen_zero(peer->inkey) ? "" : peer->inkey); @@ -2635,8 +2636,8 @@ static char *dundi_show_peers(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) { -#define FORMAT2 "%-20.20s %-15.15s %-10.10s %-8.8s %-15.15s\n" -#define FORMAT "%-20.20s %-15.15s %s %-10.10s %-8.8s %-15.15s\n" +#define FORMAT2 "%-20.20s %-15.15s %-6.6s %-10.10s %-8.8s %-15.15s\n" +#define FORMAT "%-20.20s %-15.15s %s %-6d %-10.10s %-8.8s %-15.15s\n" struct dundi_peer *peer; int registeredonly=0; char avgms[20]; @@ -2666,7 +2667,7 @@ return CLI_SHOWUSAGE; } AST_LIST_LOCK(&peers); - ast_cli(a->fd, FORMAT2, "EID", "Host", "Model", "AvgTime", "Status"); + ast_cli(a->fd, FORMAT2, "EID", "Host", "Port", "Model", "AvgTime", "Status"); AST_LIST_TRAVERSE(&peers, peer, list) { char status[20]; int print_line = -1; @@ -2701,7 +2702,7 @@ strcpy(avgms, "Unavail"); snprintf(srch, sizeof(srch), FORMAT, ast_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)", - peer->dynamic ? "(D)" : "(S)", model2str(peer->model), avgms, status); + peer->dynamic ? "(D)" : "(S)", ntohs(peer->addr.sin_port), model2str(peer->model), avgms, status); if (a->argc == 5) { if (!strcasecmp(a->argv[3],"include") && strstr(srch,a->argv[4])) { @@ -2718,7 +2719,7 @@ if (print_line) { ast_cli(a->fd, FORMAT, ast_eid_to_str(eid_str, sizeof(eid_str), &peer->eid), peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)", - peer->dynamic ? "(D)" : "(S)", model2str(peer->model), avgms, status); + peer->dynamic ? "(D)" : "(S)", ntohs(peer->addr.sin_port), model2str(peer->model), avgms, status); } } ast_cli(a->fd, "%d dundi peers [%d online, %d offline, %d unmonitored]\n", total_peers, online_peers, offline_peers, unmonitored_peers); @@ -4408,6 +4409,8 @@ ast_copy_string(peer->inkey, v->value, sizeof(peer->inkey)); } else if (!strcasecmp(v->name, "outkey")) { ast_copy_string(peer->outkey, v->value, sizeof(peer->outkey)); + } else if (!strcasecmp(v->name, "port")) { + peer->addr.sin_port = htons(atoi(v->value)); } else if (!strcasecmp(v->name, "host")) { if (!strcasecmp(v->value, "dynamic")) { peer->dynamic = 1; Index: configs/dundi.conf.sample =================================================================== --- configs/dundi.conf.sample (revision 253492) +++ configs/dundi.conf.sample (working copy) @@ -163,6 +163,8 @@ ; ; host - What their host is ; +; port - The port where their host is listening (default: 4520) +; ; order - What search order to use. May be 'primary', 'secondary', ; 'tertiary' or 'quartiary'. In large systems, it is beneficial ; to only query one up-stream host in order to maximize caching