]>
git.defcon.no Git - hermes/blob - api/lib/domain_functions.php
2 require_once('config.php');
3 require_once('lib/common_functions.php');
4 require_once('lib/db_functions.php');
9 $query = sprintf("SELECT domain FROM %s",
10 $config['kamailio_domain_table']);
12 $result = sql_dbquery( $config['kamailio_db'], $query);
13 if ( ! $result ) return -1;
16 while ( $row = mysql_fetch_row($result) ) { array_push($domains, $row[0]); }
20 function set_servers ( $domain, $registrar, $r_port, $proxy, $p_port, $prov_url )
26 $prev_servers = get_servers( $domain );
29 $query = sprintf("UPDATE %s SET
30 registrar = '%s', r_port = %d,
31 proxy = '%s', p_port = %d,
34 $config['provision_servers_table'],
35 sql_clean($registrar),
45 $query = sprintf("INSERT INTO %s
46 (domain, registrar, r_port, proxy, p_port, prov_url)
47 VALUES ('%s', '%s', %d, '%s', %d, '%s')",
48 $config['provision_servers_table'],
50 sql_clean($registrar),
58 return sql_dbexec( $config['provision_db'], $query );