<?php 
	header('Content-type: application/xml');
	
	include_once('../../../bootloader.php');

	//query db for token.
	$dbAdapter = Zend_Registry::get('dbAdapter');
	$configGlobal = Zend_Registry::get('config')->global;
	echo '<?xml version="1.0" encoding="UTF-8"?>';
	$siteBaseUrl = substr($_SERVER["SCRIPT_NAME"],0,strrpos($_SERVER["SCRIPT_NAME"],'/')) . DIRECTORY_SEPARATOR;
	if( array_key_exists('SIPgwAddress', $configGlobal) && strlen($configGlobal['SIPgwAddress']) > 2 )
		$SIPgwAddress = $configGlobal['SIPgwAddress'];
	else
		$SIPgwAddress = $_SERVER['SERVER_ADDR'];
		
	$serverAddress = $SIPgwAddress;
?>
<flashphoner>
	<rtmp_server>rtmp://<?php echo $serverAddress ?>:1935</rtmp_server>
	<register_required>true</register_required>
	<application>phone_app</application>
	<video_width>320</video_width>
	<video_height>240</video_height>
	<buffer_time>0</buffer_time>
	<check_validation_callee>false</check_validation_callee>
	<use_enhanced_mic>true</use_enhanced_mic>
	<ring_sound></ring_sound>
	<ring_in_sound><?php echo $siteBaseUrl ?>../../../sounds/simpleringing1.mp3</ring_in_sound>
	<ring_out_sound></ring_out_sound>
	<busy_sound></busy_sound>
	<register_sound><?php echo $siteBaseUrl ?>../../../sounds/simplelogintone.mp3</register_sound>
	<finish_sound><?php echo $siteBaseUrl ?>../../../sounds/simplehangup.mp3</finish_sound>
	<use_auto_gain_control>false</use_auto_gain_control>
	<dtmf_level>0.2</dtmf_level>
	<security_allow_deny_remember>true</security_allow_deny_remember>
	<keep_alive_interval>10000</keep_alive_interval>
	<keep_alive_timeout>5000</keep_alive_timeout>
	<keep_alive>true</keep_alive>
</flashphoner>
