sms: Make the max_pending tunable via a vty runtime setting

Make it possible to change the max pending via the vty. This
can be useful to play with the performance of the queue.
This commit is contained in:
Holger Hans Peter Freyther 2010-12-25 14:25:12 +01:00
parent 7a0e166fb0
commit 3c6f6c25a6
3 changed files with 21 additions and 0 deletions

View File

@ -10,5 +10,6 @@ int sms_queue_trigger(struct gsm_sms_queue *);
/* vty helper functions */
int sms_queue_stats(struct gsm_sms_queue *, struct vty* vty);
int sms_queue_set_max_pending(struct gsm_sms_queue *, int max);
#endif

View File

@ -407,3 +407,11 @@ int sms_queue_stats(struct gsm_sms_queue *smsq, struct vty *vty)
pending->subscr->id, VTY_NEWLINE);
return 0;
}
int sms_queue_set_max_pending(struct gsm_sms_queue *smsq, int max_pending)
{
LOGP(DSMS, LOGL_NOTICE, "SMSqueue old max: %d new: %d\n",
smsq->max_pending, max_pending);
smsq->max_pending = max_pending;
return 0;
}

View File

@ -656,6 +656,17 @@ DEFUN(smsqueue_trigger,
return CMD_SUCCESS;
}
DEFUN(smsqueue_max,
smsqueue_max_cmd,
"sms-queue max-pending <1-500>",
"SMS Queue\n" "SMS to attempt to deliver at the same time\n")
{
struct gsm_network *net = gsmnet_from_vty(vty);
sms_queue_set_max_pending(net->sms_queue, atoi(argv[0]));
return CMD_SUCCESS;
}
int bsc_vty_init_extra(void)
{
register_signal_handler(SS_SCALL, scall_cbfn, NULL);
@ -680,6 +691,7 @@ int bsc_vty_init_extra(void)
install_element(ENABLE_NODE, &ena_subscr_a3a8_cmd);
install_element(ENABLE_NODE, &subscriber_purge_cmd);
install_element(ENABLE_NODE, &smsqueue_trigger_cmd);
install_element(ENABLE_NODE, &smsqueue_max_cmd);
return 0;
}