[Freeswitch-users] Possible problem in adding channel variables to the bridge

Anthony Minessale anthony.minessale at gmail.com
Wed Sep 24 09:19:29 EDT 2008


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 <jbr at consiglia.dk> 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
> Freeswitch-users at lists.freeswitch.org
> 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:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20080924/6614ef8a/attachment.html 


More information about the Freeswitch-users mailing list