See comments inline...<br><br><div class="gmail_quote">On Sun, Jul 26, 2009 at 10:07 PM, Thangappan.M <span dir="ltr"><<a href="mailto:thangappan143@gmail.com" target="_blank">thangappan143@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear all,<br><br> 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. </blockquote><div><br>Tony, Brian, and I all like Perl. :)<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br> So far I heard two methods for executing IVR. <br>
One is in dial plan using perl application.( In perl I create IVR menu and play the voice files)<br> 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.<br>
</blockquote><div><br>Yes, you can call a script from the dialplan using syntax like this:<br><action application="perl" data="/path/to/myivr.pl"/><br><br>OR<br><br>You can call an outbound socket connection like this:<br>
<action application="socket" data="<a href="http://127.0.0.1:8084" target="_blank">127.0.0.1:8084</a> async full"/><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Have I understood correctly?.If it is correct means tell which method can I use?. Other make me understand well.</blockquote><div><br>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.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>I have seen downloaded perl IVR menu from freeswitch site.In that they called some internal functions like playandGetDigits,StreamFile,ready ...etc.<br>
<br>These functions is been called by using $session variable.Where these functions are defined.?<br></blockquote><div><br>When you call a Perl script from the dialplan the script automatically has access to a variable called $session. Check this for more information:<br>
<a href="http://wiki.freeswitch.org/wiki/Mod_perl#Programming_with_mod_perl" target="_blank">http://wiki.freeswitch.org/wiki/Mod_perl#Programming_with_mod_perl</a><br><br>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.<br>
<br>I recommend that you try and create a simple IVR using each method and get a feel for how each one works. <br><br>-MC<br></div></div><br>