]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix WaitExten(x,m(musicclass)) string termination.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 23 May 2012 23:16:49 +0000 (23:16 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 23 May 2012 23:16:49 +0000 (23:16 +0000)
The AST_CONTROL_HOLD MOH class from the WaitExten application can now be
queued onto a channel, passed over local channels with the /m option, and
passed over IAX channels.
........

Merged revisions 367469 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@367470 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index 8da4bb0161fc23205152525d70a4e6deee1b2f4d..52238e9e8f361e540500f6de6af1fa7c5834f6ef 100644 (file)
@@ -9834,7 +9834,8 @@ static int pbx_builtin_waitexten(struct ast_channel *chan, const char *data)
        if (ast_test_flag(&flags, WAITEXTEN_MOH) && !opts[0] ) {
                ast_log(LOG_WARNING, "The 'm' option has been specified for WaitExten without a class.\n"); 
        } else if (ast_test_flag(&flags, WAITEXTEN_MOH)) {
-               ast_indicate_data(chan, AST_CONTROL_HOLD, S_OR(opts[0], NULL), strlen(opts[0]));
+               ast_indicate_data(chan, AST_CONTROL_HOLD, S_OR(opts[0], NULL),
+                       !ast_strlen_zero(opts[0]) ? strlen(opts[0]) + 1 : 0);
        } else if (ast_test_flag(&flags, WAITEXTEN_DIALTONE)) {
                struct ast_tone_zone_sound *ts = ast_get_indication_tone(chan->zone, "dial");
                if (ts) {