[asterisk-commits] file: trunk r53750 - in /trunk: ./ apps/app_dial.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Feb 9 12:39:27 MST 2007


Author: file
Date: Fri Feb  9 13:39:26 2007
New Revision: 53750

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53750
Log:
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)

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_dial.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=53750&r1=53749&r2=53750
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Fri Feb  9 13:39:26 2007
@@ -937,8 +937,11 @@
 	   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 @@
 		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);



More information about the asterisk-commits mailing list