There is no valid case not to use transfer (or even execute_extension) in this scenario. Create a new file: conf/dialplan/check_pin.xml:<br><br><span style="font-family:courier new,monospace"><font size="1"><include><br>
<context name="utility"><br> <extension name="Check PIN"><br> <condition field="destination_number" expression="^check_pin$"/><br> <condition field="${pin}" expression="^1234$"><br>
<action application="transfer" data ="3000 XML local" /><br> <anti-action application="hangup" data="Login Failed"/><br> </condition><br> </extension><br>
</context><br></include><br></font></span><br>Then just do this in your original extension that has the read app (note I changed the name of the extension for clarity):<br><br><span style="font-family:courier new,monospace"><font size="1"><extension name="Get PIN from caller"><br>
<condition field="destination_number" expression="^111$" break="never"><br>
<action application="answer"/><br>
<action application="sleep" data="1000"/><br>
<action application="read" data="4 4 $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav pin 10000 #,*"/><br> <action application="log" data="INFO user entered '${pin}'"/><br>
<action application="transfer" data="check_pin XML utility"/> <br></font></span><div id=":1o0"><span style="font-family:courier new,monospace"><font size="1"> </condition><br>
</extension></font></span></div><br>That's all there is to it. If this method seems weird, or unusual, or abstract then too bad! :) It's a great way to keep things relatively simple while ensuring a level of security.<br>
<br>-MC<br><br><div class="gmail_quote">On Wed, Sep 19, 2012 at 8:46 AM, Emrah <span dir="ltr"><<a href="mailto:lists@kavun.ch" target="_blank">lists@kavun.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Naming an extension won't help for my transfer purpose.<br>
What I think I will do is use the same 1 extension idea, but verify the existance of ${pin} before executing the read instruction.<br>
This way if ${pin} exists, it will execute one set of instructions, if it doesn't, it will execute the read app. Following the read app would just be an action to transfer the user to the same context and destination_number.<br>
<br>
I hope what I tried to explain makes sense.<br>
<div class="HOEnZb"><div class="h5">On Sep 19, 2012, at 10:40 AM, Ken Rice <<a href="mailto:krice@freeswitch.org">krice@freeswitch.org</a>> wrote:<br>
<br>
> You can call an extension whatever you want... It doesn't have to be a<br>
> number... But using the separate context allows you to keep the destination<br>
> number field in the CDR something same like that actual destination<br>
> number...<br>
><br>
><br>
> On 9/19/12 7:25 AM, "Emrah" <<a href="mailto:lists@kavun.ch">lists@kavun.ch</a>> wrote:<br>
><br>
>> Is there a way to address an extension without assigning it to a<br>
>> destination_number? I don't want the extension to be reachable directly and<br>
>> would gladly avoid creating a dedicated context.<br>
>> Can I transfer a call to an extension that doesn't have a destination_number?<br>
>><br>
>> Best,<br>
>> Emrah<br>
>> On Sep 19, 2012, at 7:10 AM, Emrah <<a href="mailto:lists@kavun.ch">lists@kavun.ch</a>> wrote:<br>
>><br>
>>> Easy indeed, but I wanted to avoid it thinking there was some other<br>
>>> alternative.<br>
>>> Thanks for your quick response, will use it.<br>
>>><br>
>>> Cheers,<br>
>>> Emrah<br>
>>> On Sep 19, 2012, at 12:50 AM, Ken Rice <<a href="mailto:krice@freeswitch.org">krice@freeswitch.org</a>> wrote:<br>
>>><br>
>>>> This is easy to handle... Do it as 2 different extensions and after you<br>
>>>> collect the PIN, use the transfer application to transfer the call to a pin<br>
>>>> validating extension... Problem fixed with a very simple solution<br>
>>>><br>
>>>> On 9/18/12 11:42 PM, "Emrah" <<a href="mailto:lists@kavun.ch">lists@kavun.ch</a>> wrote:<br>
>>>><br>
>>>>> Please bypass the inline="true"Š A fantasy of mine.<br>
>>>>> On Sep 19, 2012, at 12:32 AM, Emrah <<a href="mailto:lists@kavun.ch">lists@kavun.ch</a>> wrote:<br>
>>>>><br>
>>>>>> Hi all,<br>
>>>>>><br>
>>>>>> My example below cannot work because FS does not store the value of ${pin}<br>
>>>>>> until the call goes into execution state. While keeping it simple, what<br>
>>>>>> would<br>
>>>>>> be your take on this? Is there a way to instruct FS to start executing at<br>
>>>>>> some point and discovering the dialplan along the way?<br>
>>>>>><br>
>>>>>> <extension name="pin test"><br>
>>>>>> <condition field="destination_number" expression="^111$" break="never"><br>
>>>>>> <action application="answer"/><br>
>>>>>> <action application="sleep" data="1000"/><br>
>>>>>> <action application="read" data="4 4<br>
>>>>>> $${base_dir}/sounds/en/us/callie/conference/8000/conf-pin.wav pin 10000<br>
>>>>>> #,*"<br>
>>>>>> inline="true" /><br>
>>>>>> </condition><br>
>>>>>> <condition field="${pin}" expression="^1234$"><br>
>>>>>> <action application="transfer" data ="3000 XML local" /><br>
>>>>>> </condition><br>
>>>>>> <condition field="${pin}" expression="^\d{4}$"><br>
>>>>>> <action application="hangup" /><br>
>>>>>> </condition><br>
>>>>>> </extension><br>
>>>>>><br>
>>>>>> Thanks and all the best, as always.<br>
>>>>>> Emrah<br>
>>>>><br>
>>>>><br>
>>>>> _________________________________________________________________________<br>
>>>>> Professional FreeSWITCH Consulting Services:<br>
>>>>> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
>>>>> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
>>>>><br>
>>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
>>>>> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
>>>>><br>
>>>>> Official FreeSWITCH Sites<br>
>>>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>>>> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
>>>>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
>>>>><br>
>>>>> FreeSWITCH-users mailing list<br>
>>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>>><br>
>>>> --<br>
>>>> Ken<br>
>>>> <a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>
>>>> <a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
>>>> <a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br>
>>>> <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
>>>><br>
>>>><br>
>>>><br>
>>>> _________________________________________________________________________<br>
>>>> Professional FreeSWITCH Consulting Services:<br>
>>>> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
>>>> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
>>>><br>
>>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
>>>> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
>>>><br>
>>>> Official FreeSWITCH Sites<br>
>>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>>> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
>>>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
>>>><br>
>>>> FreeSWITCH-users mailing list<br>
>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>>><br>
>><br>
>><br>
>> _________________________________________________________________________<br>
>> Professional FreeSWITCH Consulting Services:<br>
>> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
>> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
>><br>
>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
>> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
>><br>
>> Official FreeSWITCH Sites<br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
>> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
>> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
>><br>
>> FreeSWITCH-users mailing list<br>
>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
> --<br>
> Ken<br>
> <a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br>
> <a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
> <a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br>
> <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
><br>
><br>
><br>
> _________________________________________________________________________<br>
> Professional FreeSWITCH Consulting Services:<br>
> <a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
> <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
><br>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
> <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
><br>
> Official FreeSWITCH Sites<br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
> <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
> <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
><br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Michael S Collins<br>Twitter: @mercutioviz<br><a href="http://www.FreeSWITCH.org" target="_blank">http://www.FreeSWITCH.org</a><br><a href="http://www.ClueCon.com" target="_blank">http://www.ClueCon.com</a><br>
<a href="http://www.OSTAG.org" target="_blank">http://www.OSTAG.org</a><br><br><br>