Dear Expert,<br>   Thanks for you reply....<br><br>My Perl Script is,<br>use strict;<br>use warnings;<br><br>#---------------------------------------------------------------------------<br># Event socket library.<br># Socket programming<br>
# printing the data structures<br># Using posix parametered functions.<br>#---------------------------------------------------------------------------<br>use lib(&#39;/root/freeswitch-1.0.3/libs/esl/perl/&#39;);<br>require ESL;<br>
use IO::Socket::INET;<br>use Data::Dumper qw(Dumper);<br>use POSIX;<br>use Config::IniFiles;<br><br><br># Global variables to store the socket connection and eneterd DTM digits.<br>my ($conn,$digit);<br>$digit=&#39;&#39;;<br>
<br>#Registering the ALARM signal.<br>$SIG{ALRM}=\&amp;sub_alr;<br><br># When alarm signal occurs call the play_digit function<br>sub sub_alr {<br>        print &quot;IN Sigalarm---\n&quot;;<br>        &amp;play_digit;<br>
        return ;<br>}       # ----------  end of subroutine sub_alr  ----------<br><br><br><br># Play the voice files for menu.<br>sub play(){<br>                $conn-&gt;execute(&quot;playback&quot;,&quot;ivr/ivr-please.wav&quot;);<br>
                $conn-&gt;execute(&quot;playback&quot;,&quot;ivr/ivr-enter_ext.wav&quot;);<br>}<br><br><br>sub play_digit {<br>        print &quot;In Play Digit....\n&quot;;<br>        my      ( $par1 )       = $digit; #$digit is global variable<br>
<br>        print &quot;Eneterd Digits=&quot;,$digit,&quot;\n&quot;;<br>        ################################################################<br>        # Here what is my problem the execute function is not working  #<br>
        ################################################################<br>        $conn-&gt;execute(&quot;phrase&quot;, &quot;spell,$par1&quot;);<br>        return ;<br>}       # ----------  end of subroutine play_digit  ----------<br>
<br><br>#---------------------------------------------------------------------------<br># IP address and port of the server.<br># Sound path file.<br>#---------------------------------------------------------------------------<br>
my $ip = &quot;192.168.1.222&quot;; my $port = &#39;5057&#39;;<br>my $sound_path = &quot;/usr/local/freeswitch/sounds/en/us/callie/&quot;;<br><br><br># Creating a socket<br>my $sock = new IO::Socket::INET (<br>        LocalHost =&gt; $ip,<br>
        LocalPort =&gt; $port,<br>        Proto     =&gt; &#39;tcp&#39;,<br>        Listen    =&gt; 1,<br>        Reuse     =&gt; 1<br>);<br># Checking the error.<br>die &quot;Cannot create a socket:$!\n&quot; unless $sock;<br>
<br><br>for(;;){<br><br>        my $new_socket = $sock-&gt;accept();<br>        print &quot;Current Process Id:&quot;.POSIX::getpid().&quot;\n&quot;;<br>        my $pid = fork();<br><br>        if($pid){<br>                close($new_socket);<br>
                next;<br>        }<br><br>        print &quot;Child Process Id:&quot;.POSIX::getpid().&quot;\n&quot;;<br><br>        my $fd = fileno($new_socket);<br>        print &quot;File Number:$fd\n&quot;;<br><br>        # Create a conenction with Event socket library.<br>
        $conn = new ESL::ESLconnection($fd);<br><br>        # Getting the connection informations and values of the variables.<br>        my $info = $conn-&gt;getInfo();<br><br>        # Getting the caller id and print the statement.<br>
        my $caller_id =$info-&gt;getHeader(&quot;caller-caller-id-number&quot;);<br>        printf  &quot;Connected from %s\n&quot;, $caller_id;<br><br>        # Receive the events from only in this switch.<br>        $conn-&gt;sendRecv(&quot;myevents&quot;);<br>
<br>        # Answer the call.<br>        $conn-&gt;execute(&quot;answer&quot;);<br><br>        # playback the welcome message.<br>        $conn-&gt;setEventLock(&quot;true&quot;);<br>        $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-welcome_to_freeswitch.wav&quot;);<br>
        $conn-&gt;execute(&quot;sleep&quot;, &quot;1000&quot;);<br><br>        &amp;play;<br><br><br>        alarm(10);<br>        while($conn-&gt;connected()){<br><br>                # Receive the event<br>                my $event = $conn-&gt;recvEvent();<br>
<br>                # Check the event is received<br>                if($event){<br>                        # Get the event name  and print it.<br>                        my $name = $event-&gt;getHeader(&quot;event-name&quot;);<br>
                        print &quot;EVENT:[$name]\n&quot;;<br><br>                        # If the event name is DTMF then print the  enterted digit.<br>                        if($name eq &#39;DTMF&#39;){<br>                                my $digi = $event-&gt;getHeader(&quot;dtmf-digit&quot;);<br>
                                # Here concatenate the eneterd digits<br>                                $digit.=$digi;<br>                        }<br>                }<br>        }<br>        # Kill the child process.<br>
        print &quot;Disconnected:$caller_id\n&quot;; kill 9,POSIX::getpid();<br>}<br><br><br>My dial plan is,<br>&lt;!-- Testing IVR --&gt;<br>    &lt;extension name=&quot;Test&quot;&gt;<br>      &lt;condition field=&quot;destination_number&quot; expression=&quot;^(200)$&quot;&gt;<br>
            &lt;action application=&quot;socket&quot; data=&quot;<a href="http://192.168.1.222:5057">192.168.1.222:5057</a> async full&quot;/&gt;<br>      &lt;/condition&gt;<br>    &lt;/extension&gt;<br><br>The output of the Script is,<br>
<br>Current Process Id:2906<br>Child Process Id:2908<br>File Number:4<br>Connected from 1000<br>EVENT:[CHANNEL_EXECUTE]<br>EVENT:[CHANNEL_ANSWER]<br>EVENT:[CHANNEL_EXECUTE_COMPLETE]<br>EVENT:[CHANNEL_EXECUTE]<br>EVENT:[CHANNEL_EXECUTE_COMPLETE]<br>
EVENT:[CHANNEL_EXECUTE]<br>EVENT:[CHANNEL_EXECUTE_COMPLETE]<br>EVENT:[CHANNEL_EXECUTE]<br>EVENT:[CHANNEL_EXECUTE_COMPLETE]<br>EVENT:[CHANNEL_EXECUTE]<br>EVENT:[CHANNEL_EXECUTE_COMPLETE]<br>EVENT:[DTMF]<br>EVENT:[DTMF]<br>
EVENT:[DTMF]<br>EVENT:[DTMF]<br>IN Sigalarm---<br>In Play Digit....<br>Eneterd Digits=7485<br>Disconnected:1000<br><br>When alarm signal generated, it prints digits but it won&#39;t execute the &quot;execute&quot; function..<br>
<br>Please  any one give suggestions where I made wrong...<br><br>Thanks...<br><br>Regards,<br>Velusamy. <br><br><br><div class="gmail_quote">On Thu, Aug 6, 2009 at 11:24 AM, Michael Collins <span dir="ltr">&lt;<a href="mailto:msc@freeswitch.org">msc@freeswitch.org</a>&gt;</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;"><br><br><div class="gmail_quote"><div class="im">On Wed, Aug 5, 2009 at 11:38 PM, velusamy velu <span dir="ltr">&lt;<a href="mailto:velu.technical@gmail.com" target="_blank">velu.technical@gmail.com</a>&gt;</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;">
Please any one help for this problem..<div><div></div><div><br></div></div></blockquote></div><div><br>Sorry for the delay but many of the FreeSWITCH experts are at ClueCon right now so we&#39;ll ask for your patience... in the meantime could you pastebin your script and your dialplan entry so that we can take a look at them?<br>

<br>Thanks,<br>MC<br></div></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br>