• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1138
  • Last Modified:

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!
0
midstar
Asked:
midstar
1 Solution
 
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now