Re: [Freeswitch-users] Which method Can I use in IVR

2009-07-27 Thread Michael Collins
See comments inline...

On Sun, Jul 26, 2009 at 10:07 PM, Thangappan.M thangappan...@gmail.comwrote:

 Dear all,

  I am learning how to implement a IVR in Freeswitch.In our organization we
 are using Perl scripting language for doing this.So In freeswitch also I
 need to use Perl.


Tony, Brian, and I all like Perl. :)




  So far I heard two methods for executing IVR.
 One is in dial plan using perl application.( In perl I create IVR
 menu and play the voice files)
 Another one is using event socket.In dial plan I specified socket
 application and write a Perl script which is listening that particular port
 and get the session Id.


Yes, you can call a script from the dialplan using syntax like this:
action application=perl data=/path/to/myivr.pl/

OR

You can call an outbound socket connection like this:
action application=socket data=127.0.0.1:8084 async full/



 Have I understood correctly?.If it is correct means tell which method can I
 use?. Other make me understand well.


You're on the right track. As to which method to use, that depends on your
circumstances. How much does it need to scale? Do you want the IVR brain
to reside physically on a different server than the FS server? Think about
those things.



 I have seen downloaded perl IVR menu from freeswitch site.In that they
 called some internal functions like playandGetDigits,StreamFile,ready
 ...etc.

 These functions is been called by using $session variable.Where these
 functions are defined.?


When you call a Perl script from the dialplan the script automatically has
access to a variable called $session.  Check this for more information:
http://wiki.freeswitch.org/wiki/Mod_perl#Programming_with_mod_perl

Of course, when using the outbound event socket you will not have this magic
$session variable. Your best bet to learn more about the socket interface is
to look at the sample scripts in src/libs/esl/perl/. (server.pl, server2.pl,
and server3.pl) If you are building an IVR with Perl and the event socket be
sure to check out src/libs/esl/perl/ESL/IVR.pm which is a small Perl module
with some simple abstractions to make IVR programming a bit more convenient.

I recommend that you try and create a simple IVR using each method and get a
feel for how each one works.

-MC
___
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


Re: [Freeswitch-users] Which method Can I use in IVR

2009-07-27 Thread roberto
Michael,

For scale reasons is the best choice event socket?

thanks,

On Mon, Jul 27, 2009 at 2:00 PM, Michael Collinsm...@freeswitch.org wrote:
 See comments inline...

 On Sun, Jul 26, 2009 at 10:07 PM, Thangappan.M thangappan...@gmail.com
 wrote:

 Dear all,

  I am learning how to implement a IVR in Freeswitch.In our organization we
 are using Perl scripting language for doing this.So In freeswitch also I
 need to use Perl.

 Tony, Brian, and I all like Perl. :)



  So far I heard two methods for executing IVR.
     One is in dial plan using perl application.( In perl I create IVR
 menu and play the voice files)
     Another one is using event socket.In dial plan I specified socket
 application and write a Perl script which is listening that particular port
 and get the session Id.

 Yes, you can call a script from the dialplan using syntax like this:
 action application=perl data=/path/to/myivr.pl/

 OR

 You can call an outbound socket connection like this:
 action application=socket data=127.0.0.1:8084 async full/


 Have I understood correctly?.If it is correct means tell which method can
 I use?. Other make me understand well.

 You're on the right track. As to which method to use, that depends on your
 circumstances. How much does it need to scale? Do you want the IVR brain
 to reside physically on a different server than the FS server? Think about
 those things.



 I have seen downloaded perl IVR menu from freeswitch site.In that they
 called some internal functions like playandGetDigits,StreamFile,ready
 ...etc.

 These functions is been called by using $session variable.Where these
 functions are defined.?

 When you call a Perl script from the dialplan the script automatically has
 access to a variable called $session.  Check this for more information:
 http://wiki.freeswitch.org/wiki/Mod_perl#Programming_with_mod_perl

 Of course, when using the outbound event socket you will not have this magic
 $session variable. Your best bet to learn more about the socket interface is
 to look at the sample scripts in src/libs/esl/perl/. (server.pl, server2.pl,
 and server3.pl) If you are building an IVR with Perl and the event socket be
 sure to check out src/libs/esl/perl/ESL/IVR.pm which is a small Perl module
 with some simple abstractions to make IVR programming a bit more convenient.

 I recommend that you try and create a simple IVR using each method and get a
 feel for how each one works.

 -MC


 ___
 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



___
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


Re: [Freeswitch-users] Which method Can I use in IVR

2009-07-27 Thread Michael Collins
On Mon, Jul 27, 2009 at 10:35 AM, roberto miles.c...@gmail.com wrote:

 Michael,

 For scale reasons is the best choice event socket?


Yes. You can have the IVR stuff running on a separate server altogether. It
also gives you great flexibility in designing a setup where you can have a
db backend and/or a backup IVR server. The socket method requires a little
more effort up front but it pays off in power and flexibility.
-MC
___
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


[Freeswitch-users] Which method Can I use in IVR

2009-07-26 Thread Thangappan.M
Dear all,

 I am learning how to implement a IVR in Freeswitch.In our organization we
are using Perl scripting language for doing this.So In freeswitch also I
need to use Perl.

 So far I heard two methods for executing IVR.
One is in dial plan using perl application.( In perl I create IVR
menu and play the voice files)
Another one is using event socket.In dial plan I specified socket
application and write a Perl script which is listening that particular port
and get the session Id.

Have I understood correctly?.If it is correct means tell which method can I
use?. Other make me understand well.

I have seen downloaded perl IVR menu from freeswitch site.In that they
called some internal functions like playandGetDigits,StreamFile,ready
...etc.

These functions is been called by using $session variable.Where these
functions are defined.?


-- 
Regards,
Thangappan.M
___
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