[Freeswitch-svn] [commit] r8202 - in freeswitch/trunk/scripts: lua perl

Freeswitch SVN brian at freeswitch.org
Fri Apr 25 20:37:04 EDT 2008


Author: brian
Date: Fri Apr 25 20:37:03 2008
New Revision: 8202

Added:
   freeswitch/trunk/scripts/lua/
   freeswitch/trunk/scripts/lua/mwi_event.lua
   freeswitch/trunk/scripts/lua/originate.lua
   freeswitch/trunk/scripts/perl/
   freeswitch/trunk/scripts/perl/mwi_event.pl
   freeswitch/trunk/scripts/perl/originate.pl

Log:
some small lua and perl examples.. they look very similar...

Added: freeswitch/trunk/scripts/lua/mwi_event.lua
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/lua/mwi_event.lua	Fri Apr 25 20:37:03 2008
@@ -0,0 +1,8 @@
+-- This is an example of sending an event via luarun from the cli
+-- Edit to your liking.  luarun mwi_event.lua
+freeswitch.console_log("info", "Sending MWI Event using Lua\n");
+
+local event = freeswitch.Event("message_waiting");
+event:add_header("MWI-Messages-Waiting", "no");
+event:add_header("MWI-Message-Account", "sip:1002 at 10.0.1.100");
+event:fire();

Added: freeswitch/trunk/scripts/lua/originate.lua
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/lua/originate.lua	Fri Apr 25 20:37:03 2008
@@ -0,0 +1,6 @@
+-- Example Lua script to originate. luarun
+freeswitch.console_log("info", "Lua in da house!!!\n");
+
+local session = freeswitch.Session("sofia/10.0.1.100/1002");
+session:execute("playback", "/sr8k.wav");
+session:hangup();

Added: freeswitch/trunk/scripts/perl/mwi_event.pl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/perl/mwi_event.pl	Fri Apr 25 20:37:03 2008
@@ -0,0 +1,8 @@
+# This is an example of sending an event via perlrun from the cli
+# Edit to your liking.  perlrun mwi_event.pl
+freeswitch::console_log("info", "Perl in da house!!!\n");
+
+$event = new freeswitch::Event("message_waiting");
+$event->add_header("MWI-Messages-Waiting", "yes");
+$event->add_header("MWI-Message-Account", 'sip:1002 at 10.0.1.100');
+$event->fire();

Added: freeswitch/trunk/scripts/perl/originate.pl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/perl/originate.pl	Fri Apr 25 20:37:03 2008
@@ -0,0 +1,6 @@
+# Example Perl script to originate. perlrun
+freeswitch::console_log("info", "Perl in da house!!!\n");
+
+$session = new freeswitch::Session("sofia/10.0.1.100/1002") ;
+$session->execute("playback", "/sr8k.wav");
+$session->hangup();



More information about the Freeswitch-svn mailing list