aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2014-01-16 18:54:04 +0400
committerIvan Kluchnikov <kluchnikovi@gmail.com>2014-01-16 18:54:04 +0400
commitc4823ecdd106a03acb58608b354ed3d550cf476b (patch)
tree1c4e9c6550acf52f9d7b43b32ce3b649dad58734
parent30328749b94f922220f500babbd228d5da529c86 (diff)
nitb: Fix smsqueue ctrl command
-rw-r--r--openbsc/include/openbsc/sms_queue.h3
-rw-r--r--openbsc/src/libmsc/sms_queue.c11
-rw-r--r--openbsc/src/osmo-nitb/ctrl_commands.c3
3 files changed, 9 insertions, 8 deletions
diff --git a/openbsc/include/openbsc/sms_queue.h b/openbsc/include/openbsc/sms_queue.h
index c15d7371d..8bb540dda 100644
--- a/openbsc/include/openbsc/sms_queue.h
+++ b/openbsc/include/openbsc/sms_queue.h
@@ -4,12 +4,13 @@
struct gsm_network;
struct gsm_sms_queue;
struct vty;
+struct ctrl_cmd;
int sms_queue_start(struct gsm_network *, int in_flight);
int sms_queue_trigger(struct gsm_sms_queue *);
/* Ctrl interface helper function */
-int sms_queue_pending_stat(struct gsm_sms_queue *smsq, char* reply);
+int sms_queue_pending_stat(struct gsm_network *net, struct ctrl_cmd *cmd);
/* vty helper functions */
int sms_queue_stats(struct gsm_sms_queue *, struct vty* vty);
diff --git a/openbsc/src/libmsc/sms_queue.c b/openbsc/src/libmsc/sms_queue.c
index 8ff3af9d5..d08dc3465 100644
--- a/openbsc/src/libmsc/sms_queue.c
+++ b/openbsc/src/libmsc/sms_queue.c
@@ -36,6 +36,7 @@
#include <openbsc/gsm_04_11.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/signal.h>
+#include <openbsc/control_cmd.h>
#include <osmocom/core/talloc.h>
@@ -455,12 +456,12 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
}
/* Ctrl interface helper function */
-int sms_queue_pending_stat(struct gsm_sms_queue *smsq, char* reply)
+int sms_queue_pending_stat(struct gsm_network *net, struct ctrl_cmd *cmd)
{
- reply = talloc_asprintf_append(reply, "smsqueue.max_pending,%u\n",
- smsq->max_pending);
- reply = talloc_asprintf_append(reply, "smsqueue.pending,%u\n",
- smsq->pending);
+ cmd->reply = talloc_asprintf_append(cmd->reply, "smsqueue.max_pending,%u\n",
+ net->sms_queue->max_pending);
+ cmd->reply = talloc_asprintf_append(cmd->reply, "smsqueue.pending,%u\n",
+ net->sms_queue->pending);
return 0;
}
diff --git a/openbsc/src/osmo-nitb/ctrl_commands.c b/openbsc/src/osmo-nitb/ctrl_commands.c
index f8fd6e976..3637669fd 100644
--- a/openbsc/src/osmo-nitb/ctrl_commands.c
+++ b/openbsc/src/osmo-nitb/ctrl_commands.c
@@ -404,12 +404,11 @@ CTRL_HELPER_SET_STATUS(net_smsqueue);
static int get_net_smsqueue(struct ctrl_cmd *cmd, void *data)
{
struct gsm_network *net = cmd->node;
- struct gsm_sms_queue *smsq = net->sms_queue;
if (!strcmp(cmd->variable,"smsqueue"))
cmd->reply = talloc_strdup(cmd, "\n");
- sms_queue_pending_stat(smsq, cmd->reply);
+ sms_queue_pending_stat(net, cmd);
if (!cmd->reply) {
cmd->reply = "OOM";