Index: channels/chan_iax2.c =================================================================== --- channels/chan_iax2.c (revision 63476) +++ channels/chan_iax2.c (working copy) @@ -4217,7 +4217,7 @@ char name[256]; int registeredonly=0; char *term = manager ? "\r\n" : "\n"; - + char idtext[256] = ""; switch (argc) { case 6: if (!strcasecmp(argv[3], "registered")) @@ -4252,9 +4252,7 @@ } - if (s) - astman_append(s, FORMAT2, "Name/Username", "Host", " ", "Mask", "Port", " ", "Status", term); - else + if (!s) ast_cli(fd, FORMAT2, "Name/Username", "Host", " ", "Mask", "Port", " ", "Status", term); AST_LIST_LOCK(&peers); @@ -4292,12 +4290,21 @@ peer->encmethods ? "(E)" : " ", status, term); if (s) - astman_append(s, FORMAT, name, - peer->addr.sin_addr.s_addr ? ast_inet_ntoa( peer->addr.sin_addr) : "(Unspecified)", - ast_test_flag(peer, IAX_DYNAMIC) ? "(D)" : "(S)", - nm, - ntohs(peer->addr.sin_port), ast_test_flag(peer, IAX_TRUNK) ? "(T)" : " ", - peer->encmethods ? "(E)" : " ", status, term); + astman_append(s, + "Event: PeerEntry\r\n%s" + "Channeltype: IAX2\r\n" + "ObjectName: %s\r\n" + "IPaddress: %s\r\n" + "IPport: %d\r\n" + "Dynamic: %s\r\n" + "Status: %s\r\n\r\n", + idtext, + name, + peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "-none-", + ntohs(peer->addr.sin_port), + ast_test_flag(peer, IAX_DYNAMIC) ? "yes" : "no", + status); + else ast_cli(fd, FORMAT, name, peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)", @@ -4309,9 +4316,7 @@ } AST_LIST_UNLOCK(&peers); - if (s) - astman_append(s,"%d iax2 peers [%d online, %d offline, %d unmonitored]%s", total_peers, online_peers, offline_peers, unmonitored_peers, term); - else + if (!s) ast_cli(fd,"%d iax2 peers [%d online, %d offline, %d unmonitored]%s", total_peers, online_peers, offline_peers, unmonitored_peers, term); if (havepattern) @@ -4416,14 +4421,13 @@ static int manager_iax2_show_peers(struct mansession *s, const struct message *m) { char *a[] = { "iax2", "show", "users" }; - int ret; const char *id = astman_get_header(m,"ActionID"); + char idtext[256] = ""; if (!ast_strlen_zero(id)) - astman_append(s, "ActionID: %s\r\n",id); - ret = __iax2_show_peers(1, -1, s, 3, a ); - astman_append(s, "\r\n\r\n" ); - return ret; + snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id); + astman_send_ack(s, m, "Peer status list will follow"); + return __iax2_show_peers(1, -1, s, 3, a ); } /* /JDG */ static char *regstate2str(int regstate) Index: UPGRADE.txt =================================================================== --- UPGRADE.txt (revision 63476) +++ UPGRADE.txt (working copy) @@ -72,3 +72,8 @@ user has not configured the automon feature, the normal "415 Unsupported media type" is returned, and nothing is done. +Manager: + +* The IAXpeers command output has been changed to more closely resemble the + output of the SIPpeers command. +