Here's the table for the database: CREATE TABLE IF NOT EXISTS `meetme` ( `confno` int(5) NOT NULL default '0', `username` varchar(64) default NULL, `domain` varchar(128) default NULL, `pin` varchar(20) default NULL, `adminpin` varchar(20) default NULL, `members` int(4) NOT NULL default '0', `starttime` datetime default NULL, `endtime` datetime default NULL, `musiconhold` tinyint(1) NOT NULL default '1', `record2` tinyint(1) default NULL, `unique` varchar(10) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Here's my extension for conferences that are schedule: _3XXXXX => { Answer(); Set(CHANNEL(musicclass)=default2); Wait(2); CallTime="${STRFTIME(${EPOCH},,%F %T)}"; NoOp(Call time ${CallTime}); MYSQL(Connect connid localhost asterisk DATABASEPASS asterisk); MYSQL(Query resultid ${connid} SELECT confno from asterisk.meetme where `confno`=${EXTEN:1} AND `starttime` <= "${CallTime}" AND `endtime` >= "${CallTime}";); MYSQL(Fetch fetchid ${resultid} stuff); MYSQL(Query resultid ${connid} SELECT `record2`,`unique`,`pin` from asterisk.meetme where `confno`=${EXTEN:1} AND `starttime` <= "${CallTime}" AND `endtime` >= "${CallTime}";); MYSQL(Fetch fetchrow ${resultid} record2 unique2 pin); MYSQL(Clear ${resultid}); MYSQL(Disconnect ${connid}); Set(GLOBAL(FILEPATH)=/var/www/darkvoip/html/conf-record); Set(GLOBAL(MEETME_RECORDINGFILE)=${FILEPATH}/${stuff}-${unique2}); if (${stuff} = ${EXTEN:1}) //Does the conference ID you got from the database match the extension? { NoOp(Start time: ${starttime} End time: ${endtime}); if (${record2}=1) //If record2 is set to 1 in the database, that means to record... { if (${pin}) //If there is a pin in the database, authenticate as app_meetme won't. { Authenticate(${pin}); } Playback(this-call-may-be-monitored-or-recorded); NoOp(File: ${MEETME_RECORDINGFILE}); MeetMe(${EXTEN:1},rMcCsd); Hangup(); } else{ if (${pin}) //If there is a pin in the database, authenticate as app_meetme won't. { Authenticate(${pin}); } MeetMe(${EXTEN:1},McCsd,); //It isn't completely necessary to do it this way if you're not recording, but might as well make all of the code similar Hangup(); } } else{ Playback(invalidconfyo); Hangup(); }