. */ global $db; global $amp_conf; if (! function_exists("out")) { function out($text) { echo $text."
"; } } if (! function_exists("outn")) { function outn($text) { echo $text; } } $sql = <<< END CREATE TABLE IF NOT EXISTS `sipsettings` ( `keyword` VARCHAR (50) NOT NULL default '', `data` VARCHAR (255) NOT NULL default '', `seq` TINYINT (1), `type` TINYINT (1) NOT NULL default '0', PRIMARY KEY (`keyword`,`seq`,`type`) ) END; outn(_("checking for sipsettings table..")); $tsql = "SELECT * FROM `sipsettings` limit 1"; $check = $db->getRow($tsql, DB_FETCHMODE_ASSOC); if(DB::IsError($check)) { out(_("none, creating table")); // table does not exist, create it sql($sql); outn(_("populating default codecs..")); $sip_settings = array( array('ulaw' ,'1', '0'), array('alaw' ,'1', '1'), array('slin' ,'' , '2'), array('g726' ,'' , '3'), array('gsm' ,'1', '4'), array('g729' ,'' , '5'), array('ilbc' ,'' , '6'), array('g723' ,'' , '7'), array('g726aal2','' , '8'), array('adpcm' ,'' , '9'), array('lpc10' ,'' ,'10'), array('speex' ,'' ,'11'), array('g722' ,'' ,'12'), ); // Now insert minimal codec rows $compiled = $db->prepare("INSERT INTO sipsettings (keyword, data, seq, type) values (?,?,?,'1')"); $result = $db->executeMultiple($compiled,$sip_settings); if(DB::IsError($result)) { out(_("fatal error occurred populating defaults, check module")); } else { out(_("ulaw, alaw, gsm added")); } } else { out(_("already exists")); }