ahmedmunir007 at gmail... Guest
|
Posted: Thu Oct 22, 2009 4:58 am Post subject: [Freeswitch-users] Expression in dialplan |
|
|
Thanks for reply. Actually I want to match values and strings. Like IP_CALL=="true" or IP_CALL != "true" or Date >= "22/10/09" and vice versa. Last thing I forgot to mention, how can I implement condition in dial plan xml when using operation and/or i.e. IP_CALL == "false" and PST_CALL == "false" / IP_CALL == "false" or PST_CALL == "false".
Note: I only want to implement it in dial plan not in any script.
Kindly advise the solution.
---------- Forwarded message ----------
From: Michael Collins <msc@freeswitch.org (msc@freeswitch.org)>
To: freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)
Date: Wed, 21 Oct 2009 21:36:31 -0700
Subject: Re: [Freeswitch-users] FreeSWITCH-users Digest, Vol 40, Issue 179
On Wed, Oct 21, 2009 at 9:28 PM, Mark Campbell-Smith <mcampbellsmith@gmail.com (mcampbellsmith@gmail.com)> wrote:
Yes you can. Just don't abuse it like Tony said. If you find yourself doing it a lot then it's a sure sign that you're taking the wrong approach.
-MC
---------- Forwarded message ----------
From: Michael Collins <msc@freeswitch.org (msc@freeswitch.org)>
To: freeswitch-users@lists.freeswitch.org (freeswitch-users@lists.freeswitch.org)
Date: Wed, 21 Oct 2009 21:41:31 -0700
Subject: Re: [Freeswitch-users] FreeSWITCH-users Digest, Vol 40, Issue 179
On Wed, Oct 21, 2009 at 9:08 PM, Ahmed Munir <ahmedmunir007@gmail.com (ahmedmunir007@gmail.com)> wrote:
Quote: | Hi,
Thanks for reply, it really helped me. One more thing to ask, how can we make decision against >,<, >=, <= in condition header? Like we use == for action and != for anti-action.
Kindly highlight it.
|
You can only do greater than and less than in the date/time matching. See the date/time example in the default.xml dialplan file.
You can also use regular expressions if you're in a pinch. For example, if you need to match numbers >= 1100 and <= 1500 you could just use this regex:
^(1[1234]\d\d|1500)$
The real question, though, is this: what types of values do you need to match for GT or LT? Date/time? Money? Other? That will determine if you need to use a script or just the dialplan.
-MC |
|