summaryrefslogtreecommitdiff
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2007-02-09 19:39:26 +0000
committerJoshua Colp <jcolp@digium.com>2007-02-09 19:39:26 +0000
commit32cd307d6f1d7f55dbc045e5a2ab5cfb55e8c293 (patch)
tree66fc622aad33665c1dcdbbd9fd75dab5edb15b09 /apps/app_dial.c
parent655da6da05aae0e96b77b9d84d9a3a0fa92b9954 (diff)
Merged revisions 53749 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r53749 | file | 2007-02-09 14:33:31 -0500 (Fri, 09 Feb 2007) | 2 lines Temporarily change musicclass on channel to one specified in Dial so that the 'm' option functions properly. (issue #8969 reported by christianbee) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53750 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_dial.c')
-rw-r--r--apps/app_dial.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 4e4674e07..129b8ce31 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -937,8 +937,11 @@ static int do_privacy(struct ast_channel *chan, struct ast_channel *peer,
time and make the caller believe the peer hasn't picked up yet */
if (ast_test_flag(opts, OPT_MUSICBACK) && !ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
+ char *original_moh = ast_strdupa(chan->musicclass);
ast_indicate(chan, -1);
+ ast_string_field_set(chan, musicclass, opt_args[OPT_ARG_MUSICBACK]);
ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
+ ast_string_field_set(chan, musicclass, original_moh);
} else if (ast_test_flag(opts, OPT_RINGBACK)) {
ast_indicate(chan, AST_CONTROL_RINGING);
pa->sentringing++;
@@ -1443,7 +1446,14 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
strcpy(pa.status, "NOANSWER");
if (ast_test_flag(outgoing, OPT_MUSICBACK)) {
moh = 1;
- ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
+ if (!ast_strlen_zero(opt_args[OPT_ARG_MUSICBACK])) {
+ char *original_moh = ast_strdupa(chan->musicclass);
+ ast_string_field_set(chan, musicclass, opt_args[OPT_ARG_MUSICBACK]);
+ ast_moh_start(chan, opt_args[OPT_ARG_MUSICBACK], NULL);
+ ast_string_field_set(chan, musicclass, original_moh);
+ } else {
+ ast_moh_start(chan, NULL, NULL);
+ }
ast_indicate(chan, AST_CONTROL_PROGRESS);
} else if (ast_test_flag(outgoing, OPT_RINGBACK)) {
ast_indicate(chan, AST_CONTROL_RINGING);