if you run the socket in async mode, every call to execute is async<br>if you don&#39;t specify async in the socket app in FS all calls are synchronous but you can send async calls with te asyncExecute<br><br><br><div class="gmail_quote">
On Sat, Dec 19, 2009 at 9:16 PM, Ron McLeod <span dir="ltr">&lt;<a href="mailto:ron.freeswitch@mcleodnet.com">ron.freeswitch@mcleodnet.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;">
Here&#39;s the ES network trace:<br>
<br>
Content-Length: 1502<br>
Content-Type: text/event-plain<br>
Event-Name: CHANNEL_STATE<br>
Core-UUID: bb9ea62a-ed02-11de-91b1-8b7cb185f66f<br>
FreeSWITCH-Hostname: ron-laptop<br>
FreeSWITCH-IPv4: 192.168.100.132<br>
FreeSWITCH-IPv6: %3A%3A1<br>
Event-Date-Local: 2009-12-19%2019%3A12%3A09<br>
Event-Date-GMT: Sun,%2020%20Dec%202009%2003%3A12%3A09%20GMT<br>
Event-Date-Timestamp: 1261278729767397<br>
Event-Calling-File: switch_channel.c<br>
Event-Calling-Function: switch_channel_perform_set_running_state<br>
Event-Calling-Line-Number: 1024<br>
Channel-State: CS_ROUTING<br>
Channel-State-Number: 2<br>
Channel-Name: sofia/internal/699%40192.168.100.132<br>
Unique-ID: 76021ab2-ed15-11de-91b1-8b7cb185f66f<br>
Call-Direction: inbound<br>
Presence-Call-Direction: inbound<br>
Answer-State: ringing<br>
Channel-Read-Codec-Name: PCMU<br>
Channel-Read-Codec-Rate: 8000<br>
Channel-Write-Codec-Name: PCMU<br>
Channel-Write-Codec-Rate: 8000<br>
Caller-Username: 699<br>
Caller-Dialplan: XML<br>
Caller-Caller-ID-Name: Ron%20Soft%20Phone<br>
Caller-Caller-ID-Number: 699<br>
Caller-Network-Addr: 192.168.100.3<br>
Caller-Destination-Number: 444<br>
Caller-Unique-ID: 76021ab2-ed15-11de-91b1-8b7cb185f66f<br>
Caller-Source: mod_sofia<br>
Caller-Context: mytest<br>
Caller-Channel-Name: sofia/internal/699%40192.168.100.132<br>
Caller-Profile-Index: 1<br>
Caller-Profile-Created-Time: 1261278729764077<br>
Caller-Channel-Created-Time: 1261278729764077<br>
Caller-Channel-Answered-Time: 0<br>
Caller-Channel-Progress-Time: 0<br>
Caller-Channel-Progress-Media-Time: 0<br>
Caller-Channel-Hangup-Time: 0<br>
Caller-Channel-Transfer-Time: 0<br>
Caller-Screen-Bit: true<br>
Caller-Privacy-Hide-Name: false<br>
Caller-Privacy-Hide-Number: false<br>
<br>
<br>
sendmsg 76021ab2-ed15-11de-91b1-8b7cb185f66f<br>
call-command: execute<br>
execute-app-name: answer<br>
execute-app-arg:<br>
<br>
<br>
Content-Type: command/reply<br>
Reply-Text: +OK<br>
<br>
<br>
sendmsg 76021ab2-ed15-11de-91b1-8b7cb185f66f<br>
call-command: execute<br>
execute-app-name: playback<br>
execute-app-arg: /tmp/ann.wav<br>
<br>
<br>
Content-Type: command/reply<br>
Reply-Text: +OK<br>
<div><div></div><div class="h5"><br>
<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a> [mailto:<a href="mailto:freeswitch-">freeswitch-</a><br>
&gt; <a href="mailto:users-bounces@lists.freeswitch.org">users-bounces@lists.freeswitch.org</a>] On Behalf Of Ron McLeod<br>
&gt; Sent: Saturday, December 19, 2009 5:30 PM<br>
&gt; To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
&gt; Subject: [Freeswitch-users] Difference between ESL execute()<br>
&gt; andexecuteAsync()<br>
&gt;<br>
&gt; I don&#39;t notice any different in behavior between execute() and<br>
&gt; executeAsync().  I was expecting that executeAsync() would return<br>
&gt; right-away, and that execute() would only return after the specified<br>
&gt; application runs to completion (CHANNEL_EXECUTE_COMPLETE event).<br>
&gt;<br>
&gt; Running the sample app below, I see the &quot;About to call execute(playback)&quot;<br>
&gt; and &quot;returned&quot; displayed one right-after the other, even though the file<br>
&gt; being played takes about 4 minutes to play-out.<br>
&gt;<br>
&gt; Do I have this wrong, or is there something incorrect in my app?<br>
&gt;<br>
&gt; APP:<br>
&gt; #!/usr/bin/php<br>
&gt; &lt;?php<br>
&gt; require_once &quot;ESL.php&quot;;<br>
&gt;<br>
&gt; $eventSocket = New ESLconnection(&#39;192.168.100.132&#39;, &#39;8021&#39;, &#39;ClueCon&#39;);<br>
&gt; $eventSocket-&gt;events(&#39;plain&#39;, &#39;CHANNEL_STATE&#39;);<br>
&gt; $eventSocket-&gt;filter(&#39;channel-state&#39;, &#39;CS_ROUTING&#39;);<br>
&gt;<br>
&gt; // Wait for new call attempts<br>
&gt; while($eventSocket-&gt;connected()){<br>
&gt;     $event = $eventSocket-&gt;recvEvent();<br>
&gt;     $serializedBody = $event-&gt;serialize();<br>
&gt;     $listOfLines = toArrayOfLines($serializedBody);<br>
&gt;     $nameValuePairs = toArrayOfNameValuePairs($listOfLines);<br>
&gt;<br>
&gt;     $uuid = $nameValuePairs[&#39;Caller-Unique-ID&#39;];<br>
&gt;     printf(&quot;New call from uuid: $uuid\n&quot;);<br>
&gt;<br>
&gt;     // answer the caller and play announcement<br>
&gt;     $eventSocket-&gt;execute(&#39;answer&#39;, Null ,$uuid);<br>
&gt;<br>
&gt;     printf(&quot;About to call execute(playback)\n&quot;);<br>
&gt;     $eventSocket-&gt;execute(&#39;playback&#39;, &#39;/tmp/ann.wav&#39;, $uuid);<br>
&gt;     printf(&quot;returned\n&quot;);<br>
&gt; }<br>
&gt; ?&gt;<br>
&gt;<br>
&gt;<br>
&gt; DIALPLAN:<br>
&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>
&gt; &lt;include&gt;<br>
&gt;   &lt;context name=&quot;mytest&quot;&gt;<br>
&gt;     &lt;extension name=&quot;mytest&quot;&gt;<br>
&gt;       &lt;condition field=&quot;destination_number&quot; expression=&quot;^.*$&quot;&gt;<br>
&gt;         &lt;action application=&quot;park&quot;/&gt;<br>
&gt;       &lt;/condition&gt;<br>
&gt;     &lt;/extension&gt;<br>
&gt;   &lt;/context&gt;<br>
&gt; &lt;/include&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; FreeSWITCH-users mailing list<br>
&gt; <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
&gt;<br>
</div></div>&gt; --<br>
&gt; This email was Anti Virus checked by Astaro Security Gateway.<br>
&gt; <a href="http://www.astaro.com" target="_blank">http://www.astaro.com</a><br>
<div><div></div><div class="h5"><br>
<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>
</div></div></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:+19193869900<br>