<!-- this profile serves local user -->

<profile name="internal">
  <aliases>
    <alias name="internal"/>
  </aliases>
  
  <gateways>
    <X-PRE-PROCESS cmd="include" data="internal/*.xml"/>
  </gateways>
  
  <domains>
    <domain name="all" alias="true" parse="false"/> 
  </domains>
  
  <settings>
	
	<param name="context" value="default"/>
		
	<!-- SIP listen port for this profile -->
    <param name="sip-port" value="5060"/>
	
	<!-- local IP address for this profile -->
    <param name="rtp-ip" value="$${local_ip_v4}"/>
    <param name="sip-ip" value="$${local_ip_v4}"/>
	
	<!-- external IP address serving remote NATted users, usually it is public IP adress for DMZ -->
	<!-- 
	<param name="ext-rtp-ip" value="auto-nat"/>
    <param name="ext-sip-ip" value="auto-nat"/> -->
	
	<!-- the IP addresses or IP address segments of remote unauthorized SIP UA, e.g. MS Mediation Server -->
    <param name="apply-inbound-acl" value="172.28.0.0/16"/>
	<!-- <param name="apply-inbound-acl" value="172.28.0.0/16"/> -->
	<!-- <param name="apply-inbound-acl" value="192.168.200.0/24"/> -->
	
	<!-- if RTP bypass SIP Server -->
	<!-- to use IP-PBX supplementary services, e.g. call pickup, transfer etc. must set this to false -->
    <param name="inbound-bypass-media" value="false"/>

	<!-- if act as RTP transparent proxy without transcoding which allows unknown VoIP coder -->
	<!-- to use IP-PBX supplementary services, e.g. call pickup, transfer etc. must set this to false -->
    <param name="inbound-proxy-media" value="true"/>
	
	<!-- enable NAT traversal -->
    <param name="NDLB-received-in-nat-reg-contact" value="true"/>
    <param name="NDLB-force-rport" value="true"/>
	
	<!-- in case freeswitch using pure public IP address(not DMZ), uncomment this to resolve no voice for inter-extenions call  -->
    <!-- <param name="NDLB-sendrecv-in-session" value="true"/> -->
	
	<!-- no need set this for common case -->
	<!-- <param name="disable-rtp-auto-adjust" value="false"/> -->
	
	<!-- ***************************************************************		 -->
	<!-- do not change below parameters if not necessary -->
    <param name="user-agent-string" value="freeswitch"/>
    <param name="debug" value="0"/>
	<param name="sip-trace" value="no"/>
    <param name="watchdog-enabled" value="no"/>
    <param name="watchdog-step-timeout" value="30000"/>
    <param name="watchdog-event-timeout" value="30000"/>

    <param name="log-auth-failures" value="true"/>
    <param name="forward-unsolicited-mwi-notify" value="false"/>
	
	<!-- DTMF type: info, rfc2833, none -->
	<!-- <param name="dtmf-type" value="rfc2833"/> -->
	<param name="rfc2833-pt" value="101"/>
    <param name="dtmf-duration" value="2000"/>
	
    <param name="dialplan" value="XML"/>

	 <param name="inbound-codec-prefs" value="PCMA,PCMU,G722,GSM"/>
    <param name="outbound-codec-prefs" value="PCMA,PCMU,G722,GSM"/>
	
    <param name="rtp-timer-name" value="soft"/>
		
    <param name="hold-music" value="$${hold_music}"/>
    <param name="apply-nat-acl" value="nat.auto"/>
	
    <!--
	This defines your local network, by default we detect your local network
	and create this localnet.auto ACL for this.
    -->
    <param name="local-network-acl" value="localnet.auto"/>
    <!--<param name="apply-register-acl" value="domains"/>-->

    <param name="record-path" value="$${recordings_dir}"/>
    <param name="record-template" value="${caller_id_number}.${target_domain}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
    
	<!--enable to use presence -->
    <param name="manage-presence" value="false"/>

    <param name="inbound-codec-negotiation" value="generous"/>

    <!-- TLS: disabled by default, set to "true" to enable -->
    <param name="tls" value="$${internal_ssl_enable}"/>
    <!-- additional bind parameters for TLS -->
    <param name="tls-bind-params" value="transport=tls"/>
    <!-- Port to listen on for TLS requests. (5061 will be used if unspecified) -->
    <param name="tls-sip-port" value="$${internal_tls_port}"/>
    <!-- Location of the agent.pem and cafile.pem ssl certificates (needed for TLS server) -->
    <param name="tls-cert-dir" value="$${internal_ssl_dir}"/>
    <!-- TLS version ("sslv23" (default), "tlsv1"). NOTE: Phones may not work with TLSv1 -->
    <param name="tls-version" value="$${sip_tls_version}"/>
     
    <!--TTL for nonce in sip auth-->
    <param name="nonce-ttl" value="600"/>
		
    <param name="auth-calls" value="$${internal_auth_calls}"/>
    <!-- Force the user and auth-user to match. -->
    <param name="inbound-reg-force-matching-username" value="true"/>
    <!-- on authed calls, authenticate *all* the packets not just invite -->
    <param name="auth-all-packets" value="false"/>
    
    <!-- rtp inactivity timeout -->
    <param name="rtp-timeout-sec" value="300"/>
    <param name="rtp-hold-timeout-sec" value="1800"/>

    <!--all inbound reg will look in this domain for the users -->
    <param name="force-register-domain" value="$${domain}"/>
    <!--force the domain in subscriptions to this value -->
    <param name="force-subscription-domain" value="$${domain}"/>
    <!--all inbound reg will stored in the db using this domain -->
    <param name="force-register-db-domain" value="$${domain}"/>

    <param name="challenge-realm" value="auto_from"/>
	
	<param name="send-message-query-on-register" value="false"/>
	
	<!-- <param name="all-reg-options-ping" value="true"/> -->
     
  </settings>
</profile>

