[Home]

Summary:ASTERISK-14417: [patch] If function MEETME_INFO() is run on a conference with no participants, return is not numeric
Reporter:Jim Van Meggelen (jimvanm)Labels:
Date Opened:2009-07-05 19:39:02Date Closed:2009-11-10 16:22:41.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Functions/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) meetmeinfopatch.diff.txt
Description:-- Executing [s@your_conference:3] Set("IAX2/6477236631-6754", "ANYBODYTHERE=(Error: conference (550001) not found") in new stack

I only tested with keyword 'parties'.




****** ADDITIONAL INFORMATION ******

Instead of returning "Error: conference (550001) not found", should probably get something more along the lines of (for each keyword):
lock - if conference doesn't exist, would it make sense to have this return '0'?
parties - if conference doesn't exist, return '0' would be correct
activity - if the conference doesn't exist, then this should probably return '0'
dynamic - not sure what the best return here would be if the conference doesn't exist

Anyhow, the main thing is that it's passing back an error that's mighty nasty in terms of having to parse it. Something simpler would probably be better.

Some of this seems to have come up with bug 0011691.
Comments:By: David Brooks (dbrooks) 2009-07-14 13:56:34

JimVanM,

If the conference doesn't exist, then answering 'false' would seem a bit misleading, I would think.

The patch I just uploaded returns -1  instead of 1 or 0, and outputs an ast_log error message identical to the returned error message.

By: Jim Van Meggelen (jimvanm) 2009-07-14 16:59:23

I am not asking if the conference exists, I am asking how many people there are in the conference. If there are no participants in the conference room, the the response that would seem most logical would be '0', as in "there are '0' people in this conference room.

There are not '-1' people in the conference room, nor is there anything wrong, so I do not understand how this solution resolves the issue.

By: David Brooks (dbrooks) 2009-07-14 18:05:19

I guess I'm confused then. Are you saying your conference is active, even without anyone in it? I'm not aware of a way to have a conference exist without any participants.

From what I understand, if there are 0 participants, a MeetMe conference gets freed from memory. I will look into it further though.

By: Jim Van Meggelen (jimvanm) 2009-07-14 18:28:08

I'm sure you're right, but just because this function is run on a conference that is not in memory does not mean it's not a valid conference from a configuration standpoint.

Asking for the status of a conference that is valid in the dialplan (i.e. people can phone into it during the normal course of events), and then getting an error because nobody is in that conference at that time, limits the usefulness of this function. When I ask "how many people are in this conference", the current function will either return a value greater than 0, or an error. But '0', as in "there is nobody in this conference" is not actually an error; it is a potentially very useful bit of information. I appreciate on a technical level why the error happens, I just don't think that such an error is of any use to this function. The result is only logical if you fail to consider how the function might be used.

By: Leif Madsen (lmadsen) 2009-07-14 19:33:17

I have to agree with Jim here. When you are asking how many parties are in the conference room, and there is no one in the conference room, then the number of parties in this conference is zero.

Regardless of whether the conference exists or not doesn't matter -- it has been configured (in meetme.conf I presume), and the number of parties currently participating in the conference is zero people.

I'm not 100% sure what the other options are, but I'll take a wild guess, and say what I think it should return:

* lock -- conference is locked?   0 (false), not locked. 1 (true), locked.
* parties -- number of active parties?  returns 0 if no parties, or number of parties (greater than 0)
* activity -- audio detected in conference? returns 0 (false) if no audio detected, or 1 (true) if audio detected
* dynamic -- conference is dynamic? returns 0 (false), conference not dynamic, 1 (true) conference is dynamic, null if conference does not exist

My opinion anyways.

By: David Brooks (dbrooks) 2009-07-15 11:46:20

Ah, I see now what you are asking. That makes sense.

Unfortunately, the request is a little complicated. MEETME_INFO() can only request information about active conference calls.

When MeetMe() is called, Asterisk goes to meetme.conf to retrieve conference configuration. It does this for every call to MeetMe(), so the conference doesn't exist in memory at all until someone calls it.

So obtaining information on conferences with dynamic extensions and options is simply impossible. Obtaining information on statically configured conferences is possible only if the file is parsed, assuming the file isn't altered afterward.

By: Jim Van Meggelen (jimvanm) 2009-07-15 12:16:11

Understood, but given that the reason people are using this function has to do with conferences as entities in the dialplan, and not with whether the relevant conference is in memory, I would think a simple solution would be that if the conference does not exist, then the return would be '0' in all cases except perhaps 'dynamic', where the return could be perhaps '-1' when the conference does not exist. Returning an error doesn't make sense because it is normal to not have a conference exist if there are no participants. There's nothing wrong, but the function needs to provide a useful response to the request.

From the coding perspective, I believe the logic should be fairly simple:

If the conference doesn't exist, then any request relating to that conference that returns either a boolean or a count, would simply return '0' with no error. "that conference does not exist, therefore it is not locked (0), there are zero participants (0), there isn't any audio detected (0), and there is no way to determine whether it's dynamic or not (since it doesn't exist) (0 or -1)".

Perhaps for correctness or backward compatibility you would want to return -1 if the conference does not exist, but in the case of 'parties', the most useful return should always be a positive integer (0 or greater). As you said yourself, "I'm not aware of a way to have a conference exist without any participants.", so if the conference doesn't exist, it is 100% correct to return '0' as a response to the 'parties' option.

I'm pretty sure that'll all be a lot easier to code, and the usefulness of the function is improved immensely.

What do you think?

By: David Brooks (dbrooks) 2009-07-15 13:05:23

That makes sense to me. "Conference not found" implies no participants, not locked, etc.

The patch now gives a '0' if the conference is not active. This goes for conferences that have been defined and not defined.

By: Jim Van Meggelen (jimvanm) 2009-07-21 12:24:01

That seems to work well.

Any chance of rolling that back into 1.6.0?

By: Leif Madsen (lmadsen) 2009-07-21 12:42:51

All bug fixes go into trunk, and then are merged back into any release branches it applies to (i.e. feature exists in 1.6.x releases).

By: Leif Madsen (lmadsen) 2009-07-21 12:43:44

That's all that was needed to make all arguments to that function return the appropriate number?

By: Jim Van Meggelen (jimvanm) 2009-07-21 13:12:48

Awesomeness.

Thanks much!

Jim

By: Digium Subversion (svnbot) 2009-11-05 15:29:53.000-0600

Repository: asterisk
Revision: 228191

U   trunk/apps/app_meetme.c

------------------------------------------------------------------------
r228191 | tilghman | 2009-11-05 15:29:53 -0600 (Thu, 05 Nov 2009) | 7 lines

MEETME_INFO should not return a literal error message to the dialplan.
(closes issue ASTERISK-14417)
Reported by: JimVanM
Patches:
      meetmeinfopatch.diff.txt uploaded by dbrooks (license 790)
Tested by: JimVanM

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228191

By: Digium Subversion (svnbot) 2009-11-05 15:31:45.000-0600

Repository: asterisk
Revision: 228193

_U  branches/1.6.1/
U   branches/1.6.1/apps/app_meetme.c

------------------------------------------------------------------------
r228193 | tilghman | 2009-11-05 15:31:45 -0600 (Thu, 05 Nov 2009) | 14 lines

Merged revisions 228191 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r228191 | tilghman | 2009-11-05 15:24:21 -0600 (Thu, 05 Nov 2009) | 7 lines
 
 MEETME_INFO should not return a literal error message to the dialplan.
 (closes issue ASTERISK-14417)
  Reported by: JimVanM
  Patches:
        meetmeinfopatch.diff.txt uploaded by dbrooks (license 790)
  Tested by: JimVanM
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228193

By: Digium Subversion (svnbot) 2009-11-05 15:32:33.000-0600

Repository: asterisk
Revision: 228194

_U  branches/1.6.2/
U   branches/1.6.2/apps/app_meetme.c

------------------------------------------------------------------------
r228194 | tilghman | 2009-11-05 15:32:33 -0600 (Thu, 05 Nov 2009) | 14 lines

Merged revisions 228191 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r228191 | tilghman | 2009-11-05 15:24:21 -0600 (Thu, 05 Nov 2009) | 7 lines
 
 MEETME_INFO should not return a literal error message to the dialplan.
 (closes issue ASTERISK-14417)
  Reported by: JimVanM
  Patches:
        meetmeinfopatch.diff.txt uploaded by dbrooks (license 790)
  Tested by: JimVanM
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=228194