The default dialplan shows you a lot of options to handle time dependent call processing, however if you do insist on using lua: before = 900 after = 1800 now = os.date("%H%M") if (after > before) and (now > before) and (now > after) then . End Grmt From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of chrisbware@interfree.it Sent: Friday, November 04, 2011 14:14 To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] Lua time condition Hi guys, I'm a Lua newbie. I'd like to route an incoming call using a Lua script, according to time. Basically I need to specify a Lua condition like the following: If DATE_TIME1 < current_time < DATE_TIME2 then bridge(A) else bridge(B) I hope some Lua guru can help me! ---------------------------------------------------------------------------- --- Valore legale alle tue mail InterfreePEC - la tua Posta Elettronica Certificata http://pec.interfree.it ---------------------------------------------------------------------------- ---
On Fri, Nov 4, 2011 at 7:13 AM, <chrisbware@interfree.it> wrote:
I'm a Lua newbie. I'd like to route an incoming call using a Lua script, according to time.
You might consider routing based on the current time before it hits your script. I don't know if that's a good fit for your application, but it's right up the dialplan's ally. http://wiki.freeswitch.org/wiki/Dialplan_XML#Complex_Condition.2FAction_Rule... Good luck, Gabe
participants (3)
-
chrisbware@interfree.it
-
Gabriel Gunderson
-
grmt