-<?php
-require_once('config.php');
-require_once('lib/common_functions.php');
-require_once('lib/db_functions.php');
-require_once('lib/check_email.php');
-
-$config = get_config();
-
-function is_kamailio_domain ( $domain )
-{
- global $config;
- $query = sprintf("SELECT id FROM %s WHERE domain = '%s'",
- $config['kamailio_domain_table'],
- sql_clean( $domain )
- );
- $domain = sql_dbquery_single( $config['kamailio_db'], $query );
- if ( !$domain ) return false;
- return $domain['id'];
-
-}
-
-function get_servers( $domain )
-{
- global $config;
- $query = sprintf("SELECT registrar, r_port, proxy, p_port FROM %s WHERE domain = '%s'",
- $config['provision_servers_table'],
- sql_clean( $domain ));
- $servers = sql_dbquery_single( $config['provision_db'], $query );
- return $servers;
-}
-
-function verify_sipadress( $address ) //TODO: Improve/expand on the test!
-{
- return check_email_address($address); // A SIP address follows the requirements for email addresses...
- // Except that it permits the use of :portnumber notation!
- // TODO: Fix this so it allows :NNNN syntax for portnumbers...
-}
-
-function split_sipaddress ( $address )
-{
- if ( !verify_sipadress( $address ) ) return null;
- $data = split('@', $address);
- if ( count( $data ) != 2 ) return null;
- return $data;
-}
-
-function clean_mac ( $input )
-{
- $mac = strtolower( preg_replace('/:/', '', $input) );
- if ( ! preg_match( '/^[a-f0-9]{1,}$/', $mac ) ) return null;
- if (strlen( $mac ) != 12 ) return null;
- return $mac;
-}
-?>