[asterisk-commits] mnicholson: trunk r271762 - in /trunk: ./ configs/ pbx/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 22 09:55:02 CDT 2010
Author: mnicholson
Date: Tue Jun 22 09:54:58 2010
New Revision: 271762
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=271762
Log:
Merged revisions 271761 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r271761 | mnicholson | 2010-06-22 09:49:36 -0500 (Tue, 22 Jun 2010) | 9 lines
Allow users to specify a port for dundi peers.
(closes issue #17056)
Reported by: klaus3000
Patches:
dundi-peerport-patch-trunk.txt uploaded by klaus3000 (license 65)
Tested by: klaus3000
........
Modified:
trunk/ (props changed)
trunk/configs/dundi.conf.sample
trunk/pbx/pbx_dundi.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/configs/dundi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/trunk/configs/dundi.conf.sample?view=diff&rev=271762&r1=271761&r2=271762
==============================================================================
--- trunk/configs/dundi.conf.sample (original)
+++ trunk/configs/dundi.conf.sample Tue Jun 22 09:54:58 2010
@@ -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
Modified: trunk/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/trunk/pbx/pbx_dundi.c?view=diff&rev=271762&r1=271761&r2=271762
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Tue Jun 22 09:54:58 2010
@@ -2605,6 +2605,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) : "<Unspecified>");
+ 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) ? "<None>" : peer->inkey);
@@ -2636,8 +2637,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];
@@ -2667,7 +2668,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;
@@ -2702,7 +2703,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])) {
@@ -2719,7 +2720,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);
@@ -4409,6 +4410,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;
More information about the asterisk-commits
mailing list