[asterisk-users] MeetMe Conferencing - Announce your own join/leave to yourself and other conference members

Darren Sessions darren.sessions at me.com
Mon Jan 11 11:05:59 CST 2010


Hi all,

I'm trying to get the MeetMe system to take a caller and announce to them they've joined the conference in addition to the other members of the conference assuming previous members of the conference >= 1.

I can see where the meetme.c app actually processes it using the ast_pthread_create_background(&conf->announcethread, NULL, announce_thread, conf); function. The problem is that it's passing the conf data and not the chan data so it filters out the new caller to the conference and announces the caller's name to the rest of the conference with the announce_thread function. Without the chan data available, it makes quick and dirty hacks even impossible without more insight into the structure of the app ( i was thinking of just adding a seperate ast_streamfile / ast_waitstream with the chan variable using an if current->announcetype == CONF_HASJOIN or something like that).

Unless I'm missing a way to pass the Asterisk API function ast_pthread_create_background more than one argument and then modify the announce_thread to accommodate it, I'm at a bit of a loss on a good way of doing this without making Asterisk seg fault.

The second idea I had was to use a simple conf-background.agi (below) and do it that way while altering how meetme is called from the actual separate conferencing agi app. This method does work for announcing the user but the separate channels refuse to mix audio afterwards (and I have tried every trick in the book I can think of with this one down to EAGI stuff). If I take the 'b' option off of the MeetMe call in the AGI script, the audio passes perfectly. Additionally, attempts at using the manager interface to unlock, unmute, etc. the conference have no effect. Aside from the audio (obviously a big deal), the script runs as designed (DTMF detection, etc.).

Any ideas or help would be appreciated.

Many thanks,

- Darren


POI:

Asterisk 1.6.1.6
app_meetme.c - line 1601 (the announce_thread function)
app_meetme.c - line 1817 (the conf_run function)


-- snip --

#!/usr/bin/perl -w

use strict;
use warnings;

use lib '/var/lib/asterisk/agi-bin';

use DBI;
use Asterisk::AGI;

our ($AGI,%v,%ast);

$AGI = new Asterisk::AGI;
%ast = $AGI->ReadParse();

$v{chan} = $ast{channel};
$v{lang} = $AGI->get_variable('CHANNEL(language)');
$v{conf} = $AGI->get_variable('conference_call');

$v{dbh} = <sanitized>

($v{q},$v{r}) = undef;
$v{q} = "SELECT members FROM <sanitized> WHERE confno = '".$v{conf}."'";
$AGI->verbose($v{q});
$v{q} = $v{dbh}->prepare($v{q});
if (!$v{q}->execute) {
 exit;
}
$v{r} = $v{q}->fetchrow_hashref();
$v{q}->finish();
$v{dbh}->disconnect;

if ($v{r}{members} > 1) {
 $AGI->stream_file("/var/spool/asterisk/meetme/meetme-username-".$v{conf}."-".$v{r}{members});
}

while (!$v{loop}) {
 exit if (!$AGI->channel_status($v{chan})); 
 $v{rc} = $AGI->wait_for_digit('60000');
}

exit;



More information about the asterisk-users mailing list