[Freeswitch-users] Difference between ESL execute() and executeAsync()
ron.freeswitch at mcleodnet.com
Sat Dec 19 17:29:31 PST 2009
I don't notice any different in behavior between execute() and
executeAsync(). I was expecting that executeAsync() would return
right-away, and that execute() would only return after the specified
application runs to completion (CHANNEL_EXECUTE_COMPLETE event).
Running the sample app below, I see the "About to call execute(playback)"
and "returned" displayed one right-after the other, even though the file
being played takes about 4 minutes to play-out.
Do I have this wrong, or is there something incorrect in my app?
$eventSocket = New ESLconnection('192.168.100.132', '8021', 'ClueCon');
// Wait for new call attempts
$event = $eventSocket->recvEvent();
$serializedBody = $event->serialize();
$listOfLines = toArrayOfLines($serializedBody);
$nameValuePairs = toArrayOfNameValuePairs($listOfLines);
$uuid = $nameValuePairs['Caller-Unique-ID'];
printf("New call from uuid: $uuid\n");
// answer the caller and play announcement
$eventSocket->execute('answer', Null ,$uuid);
printf("About to call execute(playback)\n");
$eventSocket->execute('playback', '/tmp/ann.wav', $uuid);
<?xml version="1.0" encoding="utf-8"?>
<condition field="destination_number" expression="^.*$">
More information about the FreeSWITCH-users