Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

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

[Freeswitch-users] dialplan condition regex question


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





PostPosted: Thu Feb 26, 2009 10:07 am    Post subject: [Freeswitch-users] dialplan condition regex question Reply with quote

hi all,

i am dialing the number 123456789 (example) reaching fs via inbound sip gateway and hitting following dialplan:

<condition field="${sip_to_user}" expression="^123456(\d+)$">
<action application="set" data="my_dialed_extension=$1"/>
</condition>

<condition field="${my_dialed_extension}" expression="^789">
...
<action application="bridge" data="{ignore_early_media=true}user/${my_dialed_extension}@$${domain}"/>
...
</condition>

via info i can see that the variable my_dialed_extension is populated ok with 789 but somehow the second condition is not met.
when i change that to match (.*) the actions gets executed and the my_dialed_extension inside is correct.

any suggestions?

kind regards
alex


_______________________________________________
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
brian at freeswitch.org
Guest





PostPosted: Thu Feb 26, 2009 10:43 am    Post subject: [Freeswitch-users] dialplan condition regex question Reply with quote

Read this http://wiki.freeswitch.org/wiki/Dialplan_XML#About_Dialplan_Variables

You can't condition on a variable you set in the same extension
because the set happens later. Thus its not possible to do what
you're doing... Once you understand the dialplan is just a list of
instructions that is compiled before its installed on the session and
sent into execute. You're trying to have soup before the chicken has
hatched.

/b

On Feb 26, 2009, at 8:56 AM, Alexander de Greiff wrote:

Quote:
hi all,

i am dialing the number 123456789 (example) reaching fs via inbound
sip gateway and hitting following dialplan:

<condition field="${sip_to_user}" expression="^123456(\d+)$">
<action application="set" data="my_dialed_extension=$1"/>
</condition>

<condition field="${my_dialed_extension}" expression="^789">
...
<action application="bridge"
data="{ignore_early_media=true}user/${my_dialed_extension}@$$
{domain}"/>
...
</condition>

via info i can see that the variable my_dialed_extension is
populated ok with 789 but somehow the second condition is not met.
when i change that to match (.*) the actions gets executed and the
my_dialed_extension inside is correct.

any suggestions?


_______________________________________________
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
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