aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/sms_queue.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-25 14:08:00 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-12-26 09:40:03 +0100
commit81c0e2582fd0688ccf479e67c6a6be488dcc3fd6 (patch)
tree49c277bafeb809df2368ebefba363229d6065fcb /openbsc/src/sms_queue.c
parent17164061a631de73378b677cd4a267351af22dbe (diff)
sms: Provide some simple vty command for the state of the SMS queue
Diffstat (limited to 'openbsc/src/sms_queue.c')
-rw-r--r--openbsc/src/sms_queue.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/sms_queue.c b/openbsc/src/sms_queue.c
index f6d09cf76..ee4398751 100644
--- a/openbsc/src/sms_queue.c
+++ b/openbsc/src/sms_queue.c
@@ -40,6 +40,8 @@
#include <osmocore/talloc.h>
+#include <osmocom/vty/vty.h>
+
/*
* One pending SMS that we wait for.
*/
@@ -391,3 +393,17 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
return 0;
}
+
+/* VTY helper functions */
+int sms_queue_stats(struct gsm_sms_queue *smsq, struct vty *vty)
+{
+ struct gsm_sms_pending *pending;
+
+ vty_out(vty, "SMSqueue with max_pending: %d pending: %d%s",
+ smsq->max_pending, smsq->pending, VTY_NEWLINE);
+
+ llist_for_each_entry(pending, &smsq->pending_sms, entry)
+ vty_out(vty, " SMS Pending for Subscriber: %llu%s\n",
+ pending->subscr->id, VTY_NEWLINE);
+ return 0;
+}