[asterisk-dev] Query about Meetme logic for playing Enter sound

Tony Mountifield tony at softins.co.uk
Thu Mar 31 05:19:42 CDT 2011


I've just been investigating why my non-marked participants in a Meetme
conference were not causing the kerching Enter sound, but marked users
were. I've found some logic that I think is wrong, unless I'm mis-
understanding its intent. It has been the same since at least 1.2:

if (!ast_test_flag64(confflags, CONFFLAG_WAITMARKED) ||
    (ast_test_flag64(confflags, CONFFLAG_MARKEDUSER) && (conf->markedusers >= 1))) {
        conf_play(chan, conf, ENTER);
}

So, the first part is fine - play the sound if the w flag (wait for leader)
is not set. But the second part looks wrong. Firstly, if MARKEDUSER is set
for the current call, the conf->markedusers is bound to be at least 1, so
the (conf->markedusers >= 1) would be pointless. What this does is, if the
w flag is set, only play the sound if the A flag is set too. This is surely
wrong.

If I understand the intent, it should be to suppress the Enter sound for
non-marked calls that need to wait for a marked user because there are
no marked users yet, but to always play the sound otherwise. So I think
the test for MARKEDUSER is unnecessary and the logic should be as follows:

if (!ast_test_flag64(confflags, CONFFLAG_WAITMARKED) || (conf->markedusers > 0)) {
        conf_play(chan, conf, ENTER);
}

(I prefer x>0 over x>=1 for integers, but either would work)

I've made this change locally and it appears to fix the issue.

Have I understood this correctly?

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list