How to set/determine a MeetMe conference participant's user number

Hi,

I'm writing a conferencing application in Asterisk with the PHP-AGI library, and I would like the conference administrator to be able to kick a user out of the conference.  I know that this can be done with MeetMeAdmin like this:

   MeetMeAdmin confnum|k|usernum

I assign my own user number to each user, but the MeetMe conference assigns it's own user numbers. I can see these numbers from the CLI interface by typing "MeetMe list " followed by the conference number, but I don't have a way of mapping these identifiers to my own.

What would be great is if there was some way for my application to specify the user number when the user is added to the conference. But if this is not possible, any advice on how to determine which user is which would be appreciated.

Thanks!
LVL 1
midstarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

midstarAuthor Commented:
OK. I finally figured out how to do this; by changing the app_meetme.c source code.
I tried every other way I could think of, but nothing else worked.


In case anybody is interested, here's what I did:

1) In my AGI code, I create an asterisk variable named USERMAP and set it to MY application's identifier for the user right before they enter the conference.

2) I created a /var/lib/asterisk/conf/ directory on the asterisk box

3) In app_meetme.conf, directly under this existing section of code:

        if (AST_LIST_EMPTY(&conf->userlist))
                user->user_no = 1;
        else
                user->user_no = AST_LIST_LAST(&conf->userlist)->user_no + 1;

I added the following:

        sprintf(fname,"/var/lib/asterisk/conf/%s.usr", pbx_builtin_getvar_helper(chan, "USERMAP"));
        afile = fopen(fname,"wt");
        fprintf(afile, "user = %d\n",user->user_no);
        fclose(afile);

So every time a user enters a conference, it writes a file to the /var/lib/asterisk/conf/ directory.
The filename will be MY app-specific user id, and the file contents will be the Asterisk conference ID for that user.

4) I compiled the app_meetme module by going to /usr/local/src/ast*/ and type "make apps"

5) After it's build I copied  app_meetme.so to the /usr/lib/asterisk/modules/ directory.

6) I restarted asterisk

7) In my AGI code, when I want to map my application's user id (say 22222 for example) to the meetme conference id,  I open /var/lib/asterisk/conf/22222.usr, and read the meetme conference id from inside the file.

Yes, I know it's far from elegant. But at least it works.  If you find a better way, please let me know.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IP Telephony

From novice to tech pro — start learning today.