<context name="{v_context}">
	<extension name="local_extension" number="[ext]" app_uuid="71cf1310-b6e3-415b-8745-3cbdc8e15212">
		<condition field="destination_number" expression="(^\d{2,7}$)">
			<!--<action application="pre_answer"/>-->
			<action application="set" data="dialed_extension=$1"/>
			<action application="export" data="dialed_extension=$1"/>
			<action application="limit_execute" data="hash ${domain_name} $1 ${limit_max} ${limit_destination}"/>
			<!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
			<action application="bind_meta_app" data="1 ab s execute_extension::dx XML ${context}"/>
			<action application="bind_meta_app" data="2 ab s record_session::$${recordings_dir}/archive/${strftime(%Y)}/${strftime(%b)}/${strftime(%d)}/${uuid}.wav"/>
			<action application="bind_meta_app" data="3 ab s execute_extension::cf XML ${context}"/>
			<action application="bind_meta_app" data="4 ab s execute_extension::att_xfer XML ${context}"/>
			<!--<action application="set" data="ringback=${ringback}"/>-->
			<action application="set" data="hangup_after_bridge=true"/>
			<!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
			<action application="set" data="continue_on_fail=true"/>
			<action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
			<action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
			<action application="set" data="called_party_call_group=${user_data(${dialed_extension}@${domain_name} var call_group)}"/>
			<!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
			<action application="hash" data="insert/${domain_name}-last_dial/${called_party_call_group}/${uuid}"/>
			<!-- standard method -->
			<action application="bridge" data="user/${destination_number}@${domain_name}"/>
			<!-- sofia contact -->
			<!--<action application="bridge" data="${sofia_contact(${dialed_extension}@${domain_name})}"/>-->
			<!-- number-alias / http://wiki.freeswitch.com/wiki/XML_User_Directory_Guide -->
			<!--<action application="bridge" data="user/${user_data(${destination_number}@${domain_name} attr id)}@${domain_name}"/> -->
			<action application="answer"/>
			<action application="sleep" data="1000"/>
			<!--<action application="voicemail" data="default ${domain_name} ${dialed_extension}"/>-->
			<action application="set" data="voicemail_action=save"/>
			<action application="set" data="voicemail_id=$1"/>
			<action application="set" data="voicemail_profile=default"/>
			<action application="lua" data="app.lua voicemail"/>
		</condition>
	</extension>
</context>