From: Richard Mudgett Date: Wed, 23 May 2012 23:08:14 +0000 (+0000) Subject: Fix WaitExten(x,m(musicclass)) string termination. X-Git-Tag: 1.8.14.0-rc1~3^2~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c88ad5e919e4c4c39a074157ac84b04acb6f33be;p=thirdparty%2Fasterisk.git Fix WaitExten(x,m(musicclass)) string termination. 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@367469 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index 73ea124cec..5f892686db 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -9675,7 +9675,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) {