Like I said you set the event lock to true right away when you create the connection,<br>Then all your sendmsg events will be queued and processed one at a time instead of &quot;as received&quot;<br><br><br><br><div class="gmail_quote">
On Fri, Jul 31, 2009 at 12:04 AM, Thangappan.M <span dir="ltr">&lt;<a href="mailto:thangappan143@gmail.com">thangappan143@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;">
<br>If I missed out the async mode from the dial plan I am not able to get the events from it.<br><br>Here is my Perl script.<br><br># Create a conenction with Event socket library.<br>my $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.<div class="im"><br> $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-welcome_to_freeswitch.wav&quot;);<br>        $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-this_ivr_will_let_you_test_features.wav&quot;);<br>

     $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-you_may_exit_by_hanging_up.wav&quot;);<br><br></div>$conn-&gt;execute(&quot;sleep&quot;, &quot;1000&quot;);<br><br># Until the connection get disconnected<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 $digit = $event-&gt;getHeader(&quot;dtmf-digit&quot;);<br>                                my $duration = $event-&gt;getHeader(&quot;dtmf-duration&quot;);<br>

                                # And duration.<br>                                print &quot;DTMF digit $digit ($duration)\n&quot;;<br>                       }<br>                }<br>        }<br><br><br>If I specified data field in the dial plan as &lt;<a href="http://127.0.0.1:5000" target="_blank">127.0.0.1:5000</a> full&gt; All the voice files are played in order.But I am not able to get the EVENTS in the while loop.<br>

<br>If I specified data field in the dial plan as &lt;<a href="http://127.0.0.1:5000" target="_blank">127.0.0.1:5000</a> async full&gt;.The voice files are not played in order.But I am able to get the events in the while loop.<br>
<br>I need to receive EVENS.Then I check the event name if it is DTMF based on the DTMF input I processed that option.<br>
<br>In the case of $conn-&gt;setEventLock(&quot;true&quot;) , where can I reset this value to false.<br><br>Please Help Me.......<div><div></div><div class="h5"><br><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>
From: <b class="gmail_sendername">Thangappan.M</b> <span dir="ltr">&lt;<a href="mailto:thangappan143@gmail.com" target="_blank">thangappan143@gmail.com</a>&gt;</span><br>
Date: Thu, Jul 30, 2009 at 12:42 PM<br>Subject: IVR Problem<br>To: freeswitch-users &lt;<a href="mailto:freeswitch-users@lists.freeswitch.org" target="_blank">freeswitch-users@lists.freeswitch.org</a>&gt;<br><br><br>Dear all, <br>
<br>             I am in the process of implementing an IVR using event outbound socket. In the dial plan I used the following statement.<br>
             &lt;action application=&quot;socket&quot; data=&quot;<a href="http://127.0.0.1:5000" target="_blank">127.0.0.1:5000</a> async full&quot;/&gt;<br>
            <br>            I implemented a Perl script which is listening on the dial plan specified IP address and  PORT ( In this case 127.0.0.1 and 5000). Whenever the caller is calling 5000 I executed the above dial plan.     <br>


            Before dialing to the number I executed the Perl script.<br><br>              In my Perl script, first I did the following steps.<br>               <br>                    * Accepting the client connection  <br>


                    * Fork a process<br>                    * Connect with Event Socket Library <br>                    * Finally send and receive the events to that channel.<br>         <br>           In the sending part, at first I  am sending ($conn-&gt;sendRecv(&quot;myevents&quot;) ) myevents to the freeswitch.It means receive the events from this channel only.<br>


<br>            I answer for that call ( $conn-&gt;execute(&quot;answer&quot;) )<br><br>        Then I play back three files as<br><br>        $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-welcome_to_freeswitch.wav&quot;);<br>


        $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-this_ivr_will_let_you_test_features.wav&quot;);<br>        $conn-&gt;execute(&quot;playback&quot;,$sound_path.&quot;ivr/ivr-you_may_exit_by_hanging_up.wav&quot;);<br>


<br>Here the sound path is /usr/local/freeswitch/sounds/en/us/callie/<br><br>       But it is not play backed the sound in order. Why?<br>       I know that it is a problem in mode(async, full). Can you please clarify these two keywords?<br>


       I have studied from the wiki page. But I was not able to get it.<br><br>       I also specified the lock mode after every play back as<br>       $conn-&gt;SetEventBlock(&quot;true&quot;);<br><br>But is not working. Could you please solve this issue?<br>


   <br> <br><br>      <br><br><br clear="all"><br>-- <br>Regards,<br><font color="#888888">Thangappan.M<br>
</font></div><br><br clear="all"><br></div></div>-- <br>Regards,<br><font color="#888888">Thangappan.M<br>
</font><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><br clear="all"><br>-- <br>Anthony Minessale II<br><br>FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br><br>AIM: anthm<br><a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br><br>FreeSWITCH Developer Conference<br><a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br><a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>pstn:213-799-1400<br>