[asterisk-dev] [Code Review] 4010: General option to musiconhold.conf, to make applications MOH override channels musicclass.
wdoekes
reviewboard at asterisk.org
Wed Sep 24 07:02:18 CDT 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4010/#review13381
-----------------------------------------------------------
Almost what I meant.
- The code could use some coding guidelines love.
- And I mistakenly asked you to rename the variable to something that doesn't make sense.
/trunk/configs/samples/musiconhold.conf.sample
<https://reviewboard.asterisk.org/r/4010/#comment23879>
Ok then. I stand corrected. I thought I was looking at queues.conf when I asked you to rename this, but you were right from the start.
Sorry for the confusion :)
How about inverting it and renaming it to `preferchannelclass`, with description "Prefer the musicclass as defined by CHANNEL(musicclass) over a class set by an application (e.g. a musicclass set on a queue). Defaults to yes."
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23872>
Put 'int i;' on a separate line.
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23873>
Add lots of spaces.
const char *classes[4] = {NULL, NULL, interpclass, "default"};
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23878>
Add WS after `if`.
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23877>
Remove this line (and red blob).
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23874>
Update this.
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23875>
There actually is a macro to get 4:
#define ARRAY_LEN(a) (size_t) (sizeof(a) / sizeof(0[a]))
Use ARRAY_LEN(classes). You don't even need the `4' in `const char *classes[4]`.
Also: clean up whitespace, and prefer ++i over i++.
/trunk/res/res_musiconhold.c
<https://reviewboard.asterisk.org/r/4010/#comment23876>
Always use {}. Add space after `if`.
- wdoekes
On Sept. 23, 2014, 9:58 a.m., Kristian Høgh wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4010/
> -----------------------------------------------------------
>
> (Updated Sept. 23, 2014, 9:58 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-24276
> https://issues.asterisk.org/jira/browse/ASTERISK-24276
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> General option to musiconhold.conf, to make applications MOH override channels musicclass.
> Defaults to no, as it is current behavior.
>
>
> We use a single trunk for multiple users. The default musicclass from sip.conf is therefore the same for all calls.
> The trunk is connected to a kamailio server, where all in- and outgoing calls are send/received.
> Each customer (identified by custom headers) can choose a musicclass for MOH, which we apply to the channel.
> When a user dials an extension, which point to a queue, we want the user to receive the queue music.
> But we still want the user to keep the preferred musicclass, if the call is put on hold later.
> Therefore we cant unset musicclass before calling the queue.
> Company A prefer musicclass heavy-metal.
> That musicclass is therefore applied to incoming calls.
> The customer service need to calm people down. Therefore they use other music as queue music.
>
>
> Diffs
> -----
>
> /trunk/res/res_musiconhold.c 423782
> /trunk/configs/samples/musiconhold.conf.sample 423782
>
> Diff: https://reviewboard.asterisk.org/r/4010/diff/
>
>
> Testing
> -------
>
> Whithout this patch or new option appoverridechannel=no or no appoverridechannel set in musiconhold.conf:
> - The queue "myqueue", has musicclass=queueclass
> - Set(CHANNEL(musiconhold)=mohclass) followed by Queue(myqueue), makes caller hear "mohclass" while waiting for agent to answer.
>
> Whith appoverridechannel=yes in musiconhold.conf:
> - The queue "myqueue", has musicclass=queueclass
> - Set(CHANNEL(musiconhold)=myclass) followed by Queue(myqueue), makes caller hear "queueclass" while waiting for agent to answer.
>
>
> Thanks,
>
> Kristian Høgh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140924/01324f2f/attachment-0001.html>
More information about the asterisk-dev
mailing list