<br><br><div class="gmail_quote">On Mon, Mar 8, 2010 at 2:33 PM, Aloysius Lloyd <span dir="ltr"><<a href="mailto:lloyd.aloysius@gmail.com">lloyd.aloysius@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All,<div><br></div><div>I would like to setup follow me dialplan for individual extensions. Some extensions need a follow-me and some not. If the the follow-me not reach any live person the call should go to the FreeSWTICH voicemail.I have the extensions range from 201 -209. Also I am using the following Default dial plan to call between extensions.</div>
<div><br></div><div><div><extension name="Local_Extension"></div><div> <condition field="destination_number" expression="^(20[0-9])$"></div><div><span style="white-space: pre;">        </span><action application="set" data="dialed_extension=$1"/></div>
<div><span style="white-space: pre;">        </span><action application="export" data="dialed_extension=$1"/></div><div><span style="white-space: pre;">        </span><!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> --></div>
<div><span style="white-space: pre;">        </span><action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/></div><div><span style="white-space: pre;">        </span><action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/></div>
<div><span style="white-space: pre;">        </span><action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/></div><div><span style="white-space: pre;">        </span><action application="set" data="ringback=${us-ring}"/></div>
<div><span style="white-space: pre;">        </span><action application="set" data="transfer_ringback=$${hold_music}"/></div><div><span style="white-space: pre;">        </span><action application="set" data="call_timeout=30"/></div>
<div><span style="white-space: pre;">        </span><!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> --></div><div><span style="white-space: pre;">        </span><action application="set" data="hangup_after_bridge=true"/></div>
<div><span style="white-space: pre;">        </span><!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> --></div>
<div><span style="white-space: pre;">        </span><action application="set" data="continue_on_fail=true"/></div><div><span style="white-space: pre;">        </span><action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/></div>
<div><span style="white-space: pre;">        </span><action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/></div><div><span style="white-space: pre;">        </span><action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/></div>
<div><span style="white-space: pre;">        </span><!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>--></div>
<div><span style="white-space: pre;">        </span><action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/></div><div><span style="white-space: pre;">        </span><action application="bridge" data="user/${dialed_extension}@${domain_name},${followme}"/></div>
<div><span style="white-space: pre;">        </span><action application="answer"/></div><div><span style="white-space: pre;">        </span><action application="sleep" data="1000"/></div>
<div><span style="white-space: pre;">        </span><action application="voicemail" data="default ${domain_name} ${dialed_extension}"/></div><div> </condition></div><div>
</extension></div></div><div><br></div><div>I use the wiki samples to make a follow me dial plan for extension 201. Here is the dial plan.</div><div><br></div><div><div><extension name="201_followme"></div>
<div> <condition field="destination_number" expression="201"></div><div> <action application="set" data="hangup_after_bridge=true"/></div><div> <action application="set" data="continue_on_fail=true"/></div>
<div> <action application="set" data="ignore_early_media=true"/></div><div> <action application="set" data="call_timeout=10"/></div><div> <action application="bridge" data="sofia/$${domain}/201"/></div>
<div> <action application="set" data="call_timeout=13"/></div><div> <action application="bridge" data="sofia/gateway/voicepulse/14161235555" /></div><div> <action application="answer"/></div>
<div> <action application="sleep" data="1000"/></div><div> <action application="voicemail" data="default $${domain} 201"/></div><div> </condition></div><div>
</extension></div>
<div><br></div></div><div><br></div><div>Call to extension 201 , there are two dialplan matching the request. Either Local_Extension or follwme_201. Which order freeswtich select?</div></blockquote><div><br>It will match whichever one comes first in the file. You could, for example, put this 201 extension above the Local_Extension. You could also put a custom chan var in the user directory for those who need the follow-me. Then you could have two conditions, both of which need to match:<br>
<br><extension name="Local, follow me"><br> <condition field="${followme}" expression="^yes$"/><br> <condition field="destination_number expression="^(20\d)$"><br>
<!-- followme stuff here --><br> ...<br> </condition> <br></extension><br><br><extension name="Local No follow me"><br>
<condition field="${followme}" expression="^$"/><br>
<condition field="destination_number expression="^(20\d)$"><br>
<!-- normal local extension stuff here --><br>
...<br>
</condition> <br>
</extension><br>
<div><br></div>Then in the user setup in the directory add the followme variable only to those who need it. You can also add a variable for the followme phone number if you want. Inside the <variables> node just add whatever you want:<br>
<br> <variable name="followme" value="yes"/><br> <variable name="followme_number" value="14161235555"/><br>Or even<br> <variable name="followme_dialstring" value="sofia/gateway/voicepulse/14161235555"/><br>
<br>Then you could use ${followme_number} in your bridge like this:<br> <action application="bridge" data="sofia/gateway/<div>voicepulse/${followme_number}" /></div> <br>Or ${followme_dialstring} like this:<br>
<action application="bridge" data="${followme_dialstring}" /><br><br>Make sense? :) <br><br>Give it a try and report back your success/failure/questions/comments/etc.<br>-MC<br></div></div><br>