Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.374 diff -u -r1.374 chan_sip.c --- channels/chan_sip.c 8 May 2004 14:45:49 -0000 1.374 +++ channels/chan_sip.c 8 May 2004 20:13:36 -0000 @@ -4741,6 +4741,25 @@ } } +/*--- print_group: Print call group and pickup group ---*/ +static void print_group(int fd, unsigned int group) +{ + unsigned int i; + int first=1; + + for (i=0; i<=31; i++) { /* Max group is 31 */ + if (group & (1 << i)) { + if (!first) { + ast_cli(fd, ", "); + } else { + first=0; + } + ast_cli(fd, "%u", i); + } + } + ast_cli(fd, " (%u)\n", group); +} + /*--- sip_show_peer: Show one peer in detail ---*/ static int sip_show_peer(int fd, int argc, char *argv[]) { @@ -4761,8 +4780,10 @@ ast_cli(fd, " Language : %s\n", peer->language); ast_cli(fd, " FromUser : %s\n", peer->fromuser); ast_cli(fd, " FromDomain : %s\n", peer->fromdomain); - ast_cli(fd, " Callgroup : %d (bitfield, decimal)\n", peer->callgroup); - ast_cli(fd, " Pickupgroup : %d (bitfield, decimal)\n", peer->pickupgroup); + ast_cli(fd, " Callgroup : "); + print_group(fd, peer->callgroup); + ast_cli(fd, " Pickupgroup : "); + print_group(fd, peer->pickupgroup); ast_cli(fd, " Mailbox : %s\n", peer->mailbox); ast_cli(fd, " LastMsgsSent : %d\n", peer->lastmsgssent); ast_cli(fd, " Dynamic : %s\n", (peer->dynamic?"Yes":"No"));