I don't believe there is a way to pull multiple values
back from the call to api:execute. However, Lua has native pattern
matching with captures. Here are a few resources for you:
FreeSWITCH book, pages 149-151
Here's a simple example that you can actually run with
"luarun" if you want to do some testing:
-- pattern.lua
data = "1234#5678";
_,_,var1,var2 = string.find(data,"(%d+)#(%d+)");
freeswitch.consoleLog("INFO","\ndata: " .. data ..
"\nvar1: " .. var1 .. "\nvar2: " .. var2 .. "\n");
Output:
freeswitch@internal> luarun pattern.lua
+OK
2011-04-18 08:28:49.242080 [INFO]
switch_cpp.cpp:1197
data: 1234#5678
var1: 1234
var2: 5678
Have fun!
-MC
P.S. - I added some of this information to the wiki:
_______________________________________________
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