<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Example Per-phone Configuration File -->
<!-- $RCSfile: phone1.cfg,v $  $Revision: 1.121.4.5 $ -->

<phone1>
	<reg
		{foreach $lines as $row}reg.{$row.line_number}.displayName="{$row.user_id}" 
		reg.{$row.line_number}.address="{$row.user_id}" 
		reg.{$row.line_number}.label="{$row.user_id}" 
		reg.{$row.line_number}.type="private" 
		reg.{$row.line_number}.lcs="" 
		reg.{$row.line_number}.thirdPartyName="{$row.display_name}" 
		reg.{$row.line_number}.auth.userId="{$row.user_id}" 
		reg.{$row.line_number}.auth.password="{$row.password}" 
		reg.{$row.line_number}.lineKeys="{$line_key_value_{$row.line_number}}" 
		reg.{$row.line_number}.auth.optimizedInFailover="" 
		{if isset($row.outbound_proxy)}reg.{$row.line_number}.outboundProxy.address = "{$row.outbound_proxy}"
		{/if}
		{if isset($row.sip_port)}reg.{$row.line_number}.outboundProxy.port="{$row.sip_port}"{else}reg.{$row.line_number}.server.1.port="5060"
		{/if}
		{if $row.sip_transport == ''}reg.{$row.line_number}.outboundProxy.transport="TCPOnly"{/if}
		{if $row.sip_transport == 'tcp'}reg.{$row.line_number}.outboundProxy.transport="TCPOnly"{/if}
		{if $row.sip_transport == 'udp'}reg.{$row.line_number}.outboundProxy.transport="UDPOnly"{/if}
		{if $row.sip_transport == 'tls'}reg.{$row.line_number}.outboundProxy.transport="TLS" {/if}
		{if $row.sip_transport == 'dns srv'}reg.{$row.line_number}.outboundProxy.transport="DNSnaptr"{/if}
		reg.{$row.line_number}.server.1.address="{$row.server_address}"
		{if isset($row.sip_port)}reg.{$row.line_number}.server.1.port="{$row.sip_port}"{else}reg.{$row.line_number}.server.1.port="5060"
		{/if}
		{if $row.sip_transport == ''}reg.{$row.line_number}.server.1.transport="TCPOnly"{/if}
		{if $row.sip_transport == 'tcp'}reg.{$row.line_number}.server.1.transport="TCPOnly"{/if}
		{if $row.sip_transport == 'udp'}reg.{$row.line_number}.server.1.transport="UDPOnly"{/if}
		{if $row.sip_transport == 'tls'}reg.{$row.line_number}.server.1.transport="TLS" {/if}
		{if $row.sip_transport == 'dns srv'}reg.{$row.line_number}.server.1.transport="DNSnaptr"{/if}
		{if isset($row.sip_port)}reg.{$row.line_number}.server.1.expires="{$row.register_expires}"{else}reg.{$row.line_number}.server.1.expires="120"{/if}
		reg.{$row.line_number}.server.1.expires.overlap="" 
		reg.{$row.line_number}.server.1.register="" 
		reg.{$row.line_number}.server.1.retryTimeOut="" 
		reg.{$row.line_number}.server.1.retryMaxCount="" 
		reg.{$row.line_number}.server.1.expires.lineSeize="" 

		{/foreach}/>

	<attendant attendant.reg="1" attendant.ringType="ringer1" attendant.uri="">
		<attendant.behaviors>
			<attendant.behaviors.display>
			<attendant.behaviors.display.remoteCallerID 
				attendant.behaviors.display.remoteCallerID.automata="1" 
			  	attendant.behaviors.display.remoteCallerID.normal="1">
			</attendant.behaviors.display.remoteCallerID>
			<attendant.behaviors.display.spontaneousCallAppearances 
	  			attendant.behaviors.display.spontaneousCallAppearances.automata="0" 
	  			attendant.behaviors.display.spontaneousCallAppearances.normal="1">
			</attendant.behaviors.display.spontaneousCallAppearances>
			</attendant.behaviors.display>
		</attendant.behaviors>
		<attendant.resourceList 
			{foreach $keys as $row}{if $row.device_key_category == "line"}{if $row.device_key_type != "line"}attendant.resourceList.{$row.device_key_id}.address="{$row.device_key_value}"
			attendant.resourceList.{$row.device_key_id}.callAddress=""
			attendant.resourceList.{$row.device_key_id}.label="{$row.device_key_label}"
			attendant.resourceList.{$row.device_key_id}.proceedingIsRecipient="0" 
			attendant.resourceList.{$row.device_key_id}.type="{$row.device_key_type}"
			{/if}{/if}

			{/foreach}>
		</attendant.resourceList>
	</attendant>

	<msg msg.bypassInstantMessage="1"> 
		<mwi
			msg.mwi.1.subscribe="" 
			msg.mwi.1.callBackMode="contact" 
			msg.mwi.1.callBack="*97" 
			msg.mwi.2.subscribe="" 
			msg.mwi.2.callBackMode="disabled" 
			msg.mwi.2.callBack="" 
			msg.mwi.3.subscribe="" 
			msg.mwi.3.callBackMode="disabled" 
			msg.mwi.3.callBack="" 
			msg.mwi.4.subscribe="" 
			msg.mwi.4.callBackMode="disabled" 
			msg.mwi.4.callBack="" 
			msg.mwi.5.subscribe="" 
			msg.mwi.5.callBackMode="disabled" 
			msg.mwi.5.callBack="" 
			msg.mwi.6.subscribe="" 
			msg.mwi.6.callBackMode="disabled" 
			msg.mwi.6.callBack=""/> 
	</msg>
</phone1>