Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Set problem in dialplan


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
woodydickson at gmail.com
Guest





PostPosted: Wed Jun 03, 2009 1:24 am    Post subject: [Freeswitch-users] Set problem in dialplan Reply with quote

Hello,

I am getting a strange problem in my dialplan.

After doing "SET", I want to use it in the next condition field.  But then the value is not being set properly.  

Could someone please tell me what is wrong?

Thanks,
Woody


Here is the dialplan:
<context name="conf-execution">
<extension name="get-pin" continue="true" >
<condition field="${destination_number}" expression="^(.*)$" break="never">

<action application="set" data="conference_id=111"/>
<action application="set" data="is_moderator=true"/>
<action application="info"/>

</condition>
</extension>
<extension name="conf">
<condition field="${is_moderator}" expression="^true$" break="never">
<action application="conference" data="${conference_id}@default+flags{Moderator}+1234"/>

</condition>
<condition field="${is_moderator}" expression="^false$" break="never">
<action application="conference" data="${conference_id}@default"/>

</condition>
<condition field="${is_moderator}" expression="^$" break="always">
<action application="playback" data="/var/app/prompt/wav/bye.wav"/>
<action application="hangup"/>

</condition>
</extension>

</context>


Here is the FS log.

Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) parsing [conf-execution->get-pin] continue=true
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (PASS) [get-pin] ${destination_number}(117) =~ /^(.*)$/ break=never
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action set(conference_id=111)
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action set(is_moderator=true)
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action info()
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) parsing [conf-execution->conf] continue=false
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (FAIL) [conf] ${is_moderator}() =~ /^true$/ break=never
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (FAIL) [conf] ${is_moderator}() =~ /^false$/ break=never
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (PASS) [conf] ${is_moderator}() =~ /^$/ break=always
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action playback(/var/app/prompt/wav/bye.wav)
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action hangup()
Back to top
mrene_lists at avgs.ca
Guest





PostPosted: Wed Jun 03, 2009 1:27 am    Post subject: [Freeswitch-users] Set problem in dialplan Reply with quote

Hi,


FreeSWITCH decides what to execute first, the set application runs later (look a few lines later, you'll see lines beginning with EXECUTE, this is when it runs).


If you need to use variables you've set in the DP, you need to use the transfer application to make it go back into routing state.


Math

On 3-Jun-09, at 2:22 AM, Woody Dickson wrote:
Quote:
Hello,

I am getting a strange problem in my dialplan.

After doing "SET", I want to use it in the next condition field. But then the value is not being set properly.

Could someone please tell me what is wrong?

Thanks,
Woody


Here is the dialplan:
<context name="conf-execution">
<extension name="get-pin" continue="true" >
<condition field="${destination_number}" expression="^(.*)$" break="never">

<action application="set" data="conference_id=111"/>
<action application="set" data="is_moderator=true"/>
<action application="info"/>

</condition>
</extension>
<extension name="conf">
<condition field="${is_moderator}" expression="^true$" break="never">
<action application="conference" data="${conference_id}@default+flags{Moderator}+1234"/>

</condition>
<condition field="${is_moderator}" expression="^false$" break="never">
<action application="conference" data="${conference_id}@default"/>

</condition>
<condition field="${is_moderator}" expression="^$" break="always">
<action application="playback" data="/var/app/prompt/wav/bye.wav"/>
<action application="hangup"/>

</condition>
</extension>

</context>


Here is the FS log.

Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) parsing [conf-execution->get-pin] continue=true
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (PASS) [get-pin] ${destination_number}(117) =~ /^(.*)$/ break=never
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action set(conference_id=111)
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action set(is_moderator=true)
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action info()
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) parsing [conf-execution->conf] continue=false
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (FAIL) [conf] ${is_moderator}() =~ /^true$/ break=never
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (FAIL) [conf] ${is_moderator}() =~ /^false$/ break=never
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Regex (PASS) [conf] ${is_moderator}() =~ /^$/ break=always
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action playback(/var/app/prompt/wav/bye.wav)
Dialplan: sofia/internal/1001@192.168.1.101 (1001@192.168.1.101) Action hangup() _______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
jason at jasonjgw.net
Guest





PostPosted: Wed Jun 03, 2009 2:50 am    Post subject: [Freeswitch-users] Set problem in dialplan Reply with quote

Woody Dickson <woodydickson@gmail.com> wrote:
Quote:
I am getting a strange problem in my dialplan.

After doing "SET", I want to use it in the next condition field. But then
the value is not being set properly.

When parsing the dial plan, FreeSWITCH tests all of the conditions, then
builds a linked list of actions to execute. Once this is done, the actions are
executed, in order.

This is why you can't simply set a variable in one extension and test it in
the condition of a later extension.


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
testeador01 at gmail.com
Guest





PostPosted: Wed Jun 03, 2009 12:40 pm    Post subject: [Freeswitch-users] Set problem in dialplan Reply with quote

Hi Woody Smile
You cannot use the variable on another extension, however you could just merge both extensions' conditions.

then your only problem would be that you're not exporting the value, after set, you gotta export, look at this example (a little extract from dialplan/default.xml):

 <extension name="Local_Extension">   <condition field="destination_number" expression="^(10[01][0-9])$">      <action application="set" data="dialed_extension=$1"/>     <action application="export" data="dialed_extension=$1"/>    </condition>
   <condition field="destination_number" expression="^${caller_id_number}$">      <action application="set" data="voicemail_authorized=${sip_authorized}"$     <action application="answer"/>      <action application="sleep" data="1000"/>     <action application="voicemail" data="check default ${domain_name} ${dialed_extension}"/>
...
        <anti-action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
      </condition>
    </extension>



2009/6/3 Jason White <jason@jasonjgw.net (jason@jasonjgw.net)>
Quote:
Woody Dickson <woodydickson@gmail.com (woodydickson@gmail.com)> wrote:
Quote:
I am getting a strange problem in my dialplan.

After doing "SET", I want to use it in the next condition field.  But then
the value is not being set properly.


When parsing the dial plan, FreeSWITCH tests all of the conditions, then
builds a linked list of actions to execute. Once this is done, the actions are
executed, in order.

This is why you can't simply set a variable in one extension and test it in
the condition of a later extension.



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


Back to top
mrene_lists at avgs.ca
Guest





PostPosted: Wed Jun 03, 2009 12:58 pm    Post subject: [Freeswitch-users] Set problem in dialplan Reply with quote

Export transfers the variable to the B-leg whenever the channel is bridged, it doesnt affect how the dialplan work, conditions are still checked before executing anything.

Math

On 3-Jun-09, at 1:39 PM, Milena wrote:
Quote:
Hi Woody Smile
You cannot use the variable on another extension, however you could just merge both extensions' conditions.

then your only problem would be that you're not exporting the value, after set, you gotta export, look at this example (a little extract from dialplan/default.xml):

<extension name="Local_Extension"> <condition field="destination_number" expression="^(10[01][0-9])$"> <action application="set" data="dialed_extension=$1"/> <action application="export" data="dialed_extension=$1"/> </condition>
<condition field="destination_number" expression="^${caller_id_number}$"> <action application="set" data="voicemail_authorized=${sip_authorized}"$ <action application="answer"/> <action application="sleep" data="1000"/> <action application="voicemail" data="check default ${domain_name} ${dialed_extension}"/>
...
<anti-action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
</condition>
</extension>



2009/6/3 Jason White <jason@jasonjgw.net (jason@jasonjgw.net)>
Quote:
Woody Dickson <woodydickson@gmail.com (woodydickson@gmail.com)> wrote:
Quote:
I am getting a strange problem in my dialplan.

After doing "SET", I want to use it in the next condition field. But then
the value is not being set properly.


When parsing the dial plan, FreeSWITCH tests all of the conditions, then
builds a linked list of actions to execute. Once this is done, the actions are
executed, in order.

This is why you can't simply set a variable in one extension and test it in
the condition of a later extension.



_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org




_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services