The FS dialplan is not run like a script interpreter like it is in asterisk.

when the dialplan is parsed only variables that are already set before the
call hit the dialplan are available for the regex
it makes 1 giant pass into all the extensions and for all the things that
match, the actions are appended to the list of instructions
no variables are passed or actually set, all of the xml is parsed, then the
call goes to the execute state where the variables are expanded.
if you need to have a subsequent action be based on variables set from the
dialplan, you need to transfer or execute exten in the list of instructions
so you can go back to the dialplan with the new varianbles set.


see: http://wiki.freeswitch.org/wiki/Dialplan

On Wed, Sep 24, 2008 at 5:52 AM, Jon Bruel <[EMAIL PROTECTED]> wrote:

>  For a test, I have used the following show sample dialstring:
>
> <extension name="Local_Extension">
>             <condition field="destination_number"
> expression="(10[01][0-9])$">
>                   <action application="set" data="custid=100001210"/>
>                   <action application="set" data="dialed_ext=$1"/>
>                   <action application="set" data="caller_domain=10.3.1.11
> "/>
>                   <action application="export"
> data="execute_on_answer=execute_extension ONANSWER XML default"/>
>                   <action application="export"
> data="execute_on_ring=execute_extension ONRING XML default"/>
>                   <action application="bridge"
> data="[NEWVARIABLE=AAABBBCCC]user/${custid}${dialed_ext}@
> ${caller_domain}"/>
>             </condition>
>       </extension>
>
> <extension name="Call_Answered">
>         <condition field="destination_number" expression="^ONANSWER$">
>               <action application="set"
> data="On_Answer_Is_It_Then_Passed=${NEWVARIABLE}"/>
>               <action application="info"/>
>         </condition>
>   </extension>
>
>       <extension name="Ringing">
>             <condition field="destination_number" expression="^ONRING$">
>                   <action application="set"
> data="Ringing_Is_It_Then_Passed=${NEWVARIABLE}"/>
>             </condition>
>       </extension>
>
> The two extensions Call_Answered and Ringing are just test extensions to
> check if the variable NEWVARIABLE has been passed. If I just make normal
> call, it is not passed on. Using export for the execute_on_answer, the code
> runs twice. I have tried other "execute_on_XXX" but I can't see the new
> variable. Again this may be related to my lack of understanding the
> fundamentals of FS. /Jon
>
> _______________________________________________
> Freeswitch-users mailing list
> [email protected]
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:[EMAIL PROTECTED] <[EMAIL PROTECTED]>
GTALK/JABBER/PAYPAL:[EMAIL PROTECTED]<[EMAIL PROTECTED]>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:[EMAIL PROTECTED] <[EMAIL PROTECTED]>
iax:[EMAIL PROTECTED]/888
googletalk:[EMAIL PROTECTED]<[EMAIL PROTECTED]>
pstn:213-799-1400
_______________________________________________
Freeswitch-users mailing list
[email protected]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

Reply via email to