[Freeswitch-users] LUA and return variables
Robin Vleij
viper at fx-services.com
Fri Dec 18 02:21:12 PST 2009
Hi guys (and girls)!
I'm working on a little bit of ENUM trickery and I tried doing some
(illegal) nested conditions. :-)
What I want to do is to first check enum with the ENUM application,
then depending on the answer do some stuff. Say that the domain part
of the ENUM answer is robin.nl, then I want to do action X instead of
just briding the enum answer directly as I see in most examples.
But I remembered that it wasn't allowed to do nested conditions. So
what I did was stacked conditions. After that I read the dialplan wiki
pages again and figured that my regexp never matches because variables
I "set" during some phase of the extension I can't use in the same
"go" as another condition. So, now my plan is to use LUA to do the
regexp.
I'll pass the enum answer to a lua script which will split the answer
in a user and domain part and return those two to the main app. Then
based on those two vars I'll do routing or other actions (like, prefix
and then route).
Is this how I'm supposed to do it? I can't find many examples on
manipulating ENUM answers, other than bridging them directly. I can't
change the way I do stuff to ENUM answers, because in most cases I'll
just route them out the standard way.
Anyone with experience on fiddling with ENUM answers?
--
Robin Vleij
More information about the FreeSWITCH-users
mailing list