From: Mark Spencer Date: Thu, 3 Feb 2005 05:31:01 +0000 (+0000) Subject: Show last tx/rx command in sip show channels (bug #3499) X-Git-Tag: 1.2.0-beta1~1264 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a678344264d2f97faf082c4f8d84092cb98816ab;p=thirdparty%2Fasterisk.git Show last tx/rx command in sip show channels (bug #3499) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4957 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 3f8c6c6c0b..d168e2846d 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -6178,8 +6178,8 @@ static int sip_show_subscriptions(int fd, int argc, char *argv[]) static int __sip_show_channels(int fd, int argc, char *argv[], int subscriptions) { #define FORMAT3 "%-15.15s %-10.10s %-21.21s %-15.15s\n" -#define FORMAT2 "%-15.15s %-10.10s %-11.11s %-11.11s %s\n" -#define FORMAT "%-15.15s %-10.10s %-11.11s %5.5d/%5.5d %-6.6s%s\n" +#define FORMAT2 "%-15.15s %-10.10s %-11.11s %-11.11s %s %s\n" +#define FORMAT "%-15.15s %-10.10s %-11.11s %5.5d/%5.5d %-6.6s%s %s\n" struct sip_pvt *cur; char iabuf[INET_ADDRSTRLEN]; int numchans = 0; @@ -6188,7 +6188,7 @@ static int __sip_show_channels(int fd, int argc, char *argv[], int subscriptions ast_mutex_lock(&iflock); cur = iflist; if (!subscriptions) - ast_cli(fd, FORMAT2, "Peer", "User/ANR", "Call ID", "Seq (Tx/Rx)", "Format"); + ast_cli(fd, FORMAT2, "Peer", "User/ANR", "Call ID", "Seq (Tx/Rx)", "Format", "Last Msg"); else ast_cli(fd, FORMAT3, "Peer", "User", "Call ID", "URI"); while (cur) { @@ -6197,7 +6197,9 @@ static int __sip_show_channels(int fd, int argc, char *argv[], int subscriptions ast_strlen_zero(cur->username) ? ( ast_strlen_zero(cur->cid_num) ? "(None)" : cur->cid_num ) : cur->username, cur->callid, cur->ocseq, cur->icseq, - ast_getformatname(cur->owner ? cur->owner->nativeformats : 0), ast_test_flag(cur, SIP_NEEDDESTROY) ? "(d)" : "" ); + ast_getformatname(cur->owner ? cur->owner->nativeformats : 0), + ast_test_flag(cur, SIP_NEEDDESTROY) ? "(d)" : "", + cur->lastmsg ); numchans++; } if (cur->subscribed && subscriptions) {