aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index e868601bd..0a468f443 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -2553,6 +2553,9 @@ static int handle_noop(struct ast_channel *chan, AGI *agi, int arg, const char *
static int handle_setmusic(struct ast_channel *chan, AGI *agi, int argc, const char * const argv[])
{
+ if (argc < 3) {
+ return RESULT_SHOWUSAGE;
+ }
if (!strncasecmp(argv[2], "on", 2))
ast_moh_start(chan, argc > 3 ? argv[3] : NULL, NULL);
else if (!strncasecmp(argv[2], "off", 3))