[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] _get_mohbyname spam
From:       Walter Doekes <walter+asterisk-dev () osso ! nl>
Date:       2016-02-22 12:48:31
Message-ID: 56CB039F.3070001 () osso ! nl
[Download RAW message or body]

> > It is possible to revisit ticket ASTERISK-25444, basically RealTime MoH
> > causes a lot of messages to be displayed on queues due to the way an
> > error message is being used.

> > For example:
> > 
> > [2016-02-22 09:20:42] WARNING[7562][C-000034c5]: res_musiconhold.c:884
> > _get_mohbyname: Music on Hold class 'default' not found in memory.
> > Verify your configuration.

I did run into this, I think that could be fixed by something like:

> diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
> index 9172473..a8ae862 100644
> --- a/res/res_musiconhold.c
> +++ b/res/res_musiconhold.c
> @@ -1374,26 +1374,26 @@ static int local_ast_moh_start(struct ast_channel *chan, \
>                 const char *mclass, con
> * 4) The default class.
> */
> if (!ast_strlen_zero(ast_channel_musicclass(chan))) {
> -               mohclass = get_mohbyname(ast_channel_musicclass(chan), 1, 0);
> +               mohclass = get_mohbyname(ast_channel_musicclass(chan), \
> !realtime_possible, 0); if (!mohclass && realtime_possible) {
> var = ast_load_realtime("musiconhold", "name", ast_channel_musicclass(chan), \
> SENTINEL); }
> }
> if (!mohclass && !var && !ast_strlen_zero(mclass)) {
> -               mohclass = get_mohbyname(mclass, 1, 0);
> +               mohclass = get_mohbyname(mclass, !realtime_possible, 0);
> if (!mohclass && realtime_possible) {
> var = ast_load_realtime("musiconhold", "name", mclass, SENTINEL);
> }
> }
> if (!mohclass && !var && !ast_strlen_zero(interpclass)) {
> -               mohclass = get_mohbyname(interpclass, 1, 0);
> +               mohclass = get_mohbyname(interpclass, !realtime_possible, 0);
> if (!mohclass && realtime_possible) {
> var = ast_load_realtime("musiconhold", "name", interpclass, SENTINEL);
> }
> }
> 
> if (!mohclass && !var) {
> -               mohclass = get_mohbyname("default", 1, 0);
> +               mohclass = get_mohbyname("default", !realtime_possible, 0);
> if (!mohclass && realtime_possible) {
> var = ast_load_realtime("musiconhold", "name", "default", SENTINEL);
> }

Although I don't believe I actually tested it.

Cheers,
Walter

(note to self, GRID-3153)

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic