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

List:       asterisk-dev
Subject:    [asterisk-dev] Query about Meetme logic for playing Enter sound
From:       tony () softins ! co ! uk (Tony Mountifield)
Date:       2011-03-31 10:19:42
Message-ID: in1kfu$dl5$1 () softins ! clara ! co ! uk
[Download RAW message or body]

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@softins.co.uk - http://www.softins.co.uk
Play: tony@mountifield.org - http://tony.mountifield.org

--
_____________________________________________________________________
-- 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