if you run the socket in async mode, every call to execute is async<br>if you don'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"><<a href="mailto:ron.freeswitch@mcleodnet.com">ron.freeswitch@mcleodnet.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;">
Here'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>
> -----Original Message-----<br>
> 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>
> <a href="mailto:users-bounces@lists.freeswitch.org">users-bounces@lists.freeswitch.org</a>] On Behalf Of Ron McLeod<br>
> Sent: Saturday, December 19, 2009 5:30 PM<br>
> To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
> Subject: [Freeswitch-users] Difference between ESL execute()<br>
> andexecuteAsync()<br>
><br>
> I don't notice any different in behavior between execute() and<br>
> executeAsync(). I was expecting that executeAsync() would return<br>
> right-away, and that execute() would only return after the specified<br>
> application runs to completion (CHANNEL_EXECUTE_COMPLETE event).<br>
><br>
> Running the sample app below, I see the "About to call execute(playback)"<br>
> and "returned" displayed one right-after the other, even though the file<br>
> being played takes about 4 minutes to play-out.<br>
><br>
> Do I have this wrong, or is there something incorrect in my app?<br>
><br>
> APP:<br>
> #!/usr/bin/php<br>
> <?php<br>
> require_once "ESL.php";<br>
><br>
> $eventSocket = New ESLconnection('192.168.100.132', '8021', 'ClueCon');<br>
> $eventSocket->events('plain', 'CHANNEL_STATE');<br>
> $eventSocket->filter('channel-state', 'CS_ROUTING');<br>
><br>
> // Wait for new call attempts<br>
> while($eventSocket->connected()){<br>
> $event = $eventSocket->recvEvent();<br>
> $serializedBody = $event->serialize();<br>
> $listOfLines = toArrayOfLines($serializedBody);<br>
> $nameValuePairs = toArrayOfNameValuePairs($listOfLines);<br>
><br>
> $uuid = $nameValuePairs['Caller-Unique-ID'];<br>
> printf("New call from uuid: $uuid\n");<br>
><br>
> // answer the caller and play announcement<br>
> $eventSocket->execute('answer', Null ,$uuid);<br>
><br>
> printf("About to call execute(playback)\n");<br>
> $eventSocket->execute('playback', '/tmp/ann.wav', $uuid);<br>
> printf("returned\n");<br>
> }<br>
> ?><br>
><br>
><br>
> DIALPLAN:<br>
> <?xml version="1.0" encoding="utf-8"?><br>
> <include><br>
> <context name="mytest"><br>
> <extension name="mytest"><br>
> <condition field="destination_number" expression="^.*$"><br>
> <action application="park"/><br>
> </condition><br>
> </extension><br>
> </context><br>
> </include><br>
><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>
><br>
</div></div>> --<br>
> This email was Anti Virus checked by Astaro Security Gateway.<br>
> <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>