Summary: | ASTERISK-14083: [patch] Moh class set in the dialplan is ignored with realtime moh | ||
Reporter: | Alex Hermann (alexh) | Labels: | |
Date Opened: | 2009-05-07 10:32:25 | Date Closed: | 2009-09-24 09:18:19 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Resources/res_musiconhold |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) 15051.patch | |
Description: | Prerequisites: moh class "mohrt" exists in realtime musiconhold moh class "default" exists in musiconhold.conf sip.conf's mohinterpret=default When the musiconhold class is set in the dialplan via "Set(CHANNEL(musicclass)=mohrt" the specified class is never used as the default class is found first. ****** ADDITIONAL INFORMATION ****** The below code fragment in the function "local_ast_moh_start()" is the culprit. The code should check chan->musicclass first in memory, then in realtime The, only if _both_ failed, mclass and interpclass should be checked (also memory first, realtime directly after). if (!ast_strlen_zero(chan->musicclass)) { mohclass = get_mohbyname(chan->musicclass, 1); } if (!mohclass && !ast_strlen_zero(mclass)) { mohclass = get_mohbyname(mclass, 1); } if (!mohclass && !ast_strlen_zero(interpclass)) { mohclass = get_mohbyname(interpclass, 1); } /* Here the default class is found, even though chan->musicclass has a realtime class set and the following code is never executed */ /* If no moh class found in memory, then check RT */ if (!mohclass && ast_check_realtime("musiconhold")) { struct ast_variable *var = NULL, *tmp = NULL; if (!ast_strlen_zero(chan->musicclass)) { var = ast_load_realtime("musiconhold", "name", chan->musicclass, SENTINEL); } | ||
Comments: | By: Mark Michelson (mmichelson) 2009-06-08 15:08:04 I have uploaded 15051.patch for testing. Please let me know if it fixes your problem. Thanks! By: Alex Hermann (alexh) 2009-06-12 06:39:54 Patch applied to 1.6.1.0-rc2 seems to work. Can't reproduce the problem anymore with the patch attached. Thanks. By: Digium Subversion (svnbot) 2009-07-27 15:11:51 Repository: asterisk Revision: 209197 U trunk/res/res_musiconhold.c ------------------------------------------------------------------------ r209197 | mmichelson | 2009-07-27 15:11:51 -0500 (Mon, 27 Jul 2009) | 9 lines Honor channel's music class when using realtime music on hold. (closes issue ASTERISK-14083) Reported by: alexh Patches: 15051.patch uploaded by mmichelson (license 60) Tested by: alexh ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=209197 By: Digium Subversion (svnbot) 2009-07-27 15:16:37 Repository: asterisk Revision: 209198 _U branches/1.6.0/ U branches/1.6.0/res/res_musiconhold.c ------------------------------------------------------------------------ r209198 | mmichelson | 2009-07-27 15:16:37 -0500 (Mon, 27 Jul 2009) | 15 lines Merged revisions 209197 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r209197 | mmichelson | 2009-07-27 15:11:42 -0500 (Mon, 27 Jul 2009) | 9 lines Honor channel's music class when using realtime music on hold. (closes issue ASTERISK-14083) Reported by: alexh Patches: 15051.patch uploaded by mmichelson (license 60) Tested by: alexh ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=209198 By: Digium Subversion (svnbot) 2009-07-27 15:17:15 Repository: asterisk Revision: 209199 _U branches/1.6.1/ U branches/1.6.1/res/res_musiconhold.c ------------------------------------------------------------------------ r209199 | mmichelson | 2009-07-27 15:17:15 -0500 (Mon, 27 Jul 2009) | 15 lines Merged revisions 209197 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r209197 | mmichelson | 2009-07-27 15:11:42 -0500 (Mon, 27 Jul 2009) | 9 lines Honor channel's music class when using realtime music on hold. (closes issue ASTERISK-14083) Reported by: alexh Patches: 15051.patch uploaded by mmichelson (license 60) Tested by: alexh ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=209199 By: Digium Subversion (svnbot) 2009-07-27 15:23:49 Repository: asterisk Revision: 209222 _U branches/1.6.2/ U branches/1.6.2/res/res_musiconhold.c ------------------------------------------------------------------------ r209222 | mmichelson | 2009-07-27 15:23:49 -0500 (Mon, 27 Jul 2009) | 15 lines Merged revisions 209197 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ........ r209197 | mmichelson | 2009-07-27 15:11:42 -0500 (Mon, 27 Jul 2009) | 9 lines Honor channel's music class when using realtime music on hold. (closes issue ASTERISK-14083) Reported by: alexh Patches: 15051.patch uploaded by mmichelson (license 60) Tested by: alexh ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=209222 |