summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2008-03-26 19:29:26 +0000
committerJoshua Colp <jcolp@digium.com>2008-03-26 19:29:26 +0000
commit438361c0b823bea453f866d50764b6ef6307eec2 (patch)
treebf872abe7fc7f6fbff45b5ddf0286574d11ebe3d
parent5278d1d62b1afebd3872bddea7105b13bc54923d (diff)
Add expiry value to the sip show subscriptions CLI command.
(closes issue #12025) Reported by: agx git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111083 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a66ccc6b5..fc176db02 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13146,8 +13146,9 @@ struct __show_chan_arg {
int numchans; /* return value */
};
-#define FORMAT3 "%-15.15s %-10.10s %-15.15s %-15.15s %-13.13s %-15.15s %-10.10s\n"
-#define FORMAT2 "%-15.15s %-10.10s %-15.15s %-15.15s %-7.7s %-15.15s\n"
+#define FORMAT4 "%-15.15s %-10.10s %-15.15s %-15.15s %-13.13s %-15.15s %-10.10s %-6.6d\n"
+#define FORMAT3 "%-15.15s %-10.10s %-15.15s %-15.15s %-13.13s %-15.15s %-10.10s %-6.6s\n"
+#define FORMAT2 "%-15.15s %-10.10s %-15.15s %-15.15s %-7.7s %-15.15s %-6.6s\n"
#define FORMAT "%-15.15s %-10.10s %-15.15s %-15.15s %-3.3s %-3.3s %-15.15s %-10.10s\n"
/*! \brief callback for show channel|subscription */
@@ -13178,14 +13179,15 @@ static int show_channels_cb(void *__cur, void *__arg, int flags)
struct ast_str *mailbox_str = ast_str_alloca(512);
if (cur->subscribed == MWI_NOTIFICATION && cur->relatedpeer)
peer_mailboxes_to_str(&mailbox_str, cur->relatedpeer);
- ast_cli(arg->fd, FORMAT3, ast_inet_ntoa(dst->sin_addr),
+ ast_cli(arg->fd, FORMAT4, ast_inet_ntoa(dst->sin_addr),
S_OR(cur->username, S_OR(cur->cid_num, "(None)")),
cur->callid,
/* the 'complete' exten/context is hidden in the refer_to field for subscriptions */
cur->subscribed == MWI_NOTIFICATION ? "--" : cur->subscribeuri,
cur->subscribed == MWI_NOTIFICATION ? "<none>" : ast_extension_state2str(cur->laststate),
subscription_type2str(cur->subscribed),
- cur->subscribed == MWI_NOTIFICATION ? S_OR(mailbox_str->str, "<none>") : "<none>"
+ cur->subscribed == MWI_NOTIFICATION ? S_OR(mailbox_str->str, "<none>") : "<none>",
+ cur->expiry
);
arg->numchans++;
}
@@ -13218,9 +13220,9 @@ static char *sip_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_
return CLI_SHOWUSAGE;
arg.subscriptions = !strcasecmp(a->argv[e->args - 1], "subscriptions");
if (!arg.subscriptions)
- ast_cli(arg.fd, FORMAT2, "Peer", "User/ANR", "Call ID", "Format", "Hold", "Last Message");
+ ast_cli(arg.fd, FORMAT2, "Peer", "User/ANR", "Call ID", "Format", "Hold", "Last Message", "Expiry");
else
- ast_cli(arg.fd, FORMAT3, "Peer", "User", "Call ID", "Extension", "Last state", "Type", "Mailbox");
+ ast_cli(arg.fd, FORMAT3, "Peer", "User", "Call ID", "Extension", "Last state", "Type", "Mailbox", "Expiry");
/* iterate on the container and invoke the callback on each item */
dialoglist_lock();