<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16890" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009>Hello,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>I am using
Freeswitch to do some development work and encounter a problem with Event
Socket.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009>The configuration is: Freeswitch works as PBX. I
also configure three softphones A, B and C.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>What I want
is:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>1. A call
B.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>2. B reject the
call.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>3. Freeswitch start
conference involve A, B and C.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>What I
did was:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>1. Add perl script
to the dialplan, so the perl script will be called after B reject the
call from A. Worked fine.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>2. In the script, I
connected to localhost:8021 so the Freeswitch work in Inbound mode.
Worked fine.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>3. Then run
$connection->execute to run "conference_set_auto_outcall" and
"conference" command. Not worked.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>So I check the
"parse_command" function in file "mod_event_socket.c", the following is
what happened:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>Since I give the
uuid to "$connection->execute" command, so FS doesn't care if it is
Async mode or not. Actually FS just call</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>function
"switch_core_session_queue_private_event" to queue the event. Here is the
problem, since B already reject the </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>call, then <FONT
color=#0000ff>nobody will call the function "switch_ivr_parse_event" to execute
the command</FONT>.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>I did try to
add code to "parse_command" function to treat the Async and Sync
mode differently when the uuid is provided. The </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>conference was
started successfully in Sync mode but since the "conference" application is
blocked, my perl script was not able </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>to move on since it
was waiting for the "conference" to stop. If I choose
"$connection->executeAsync", the commands were not </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>run because of the
reason I mentioned above.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>What is the proper
solution for this?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009>Thanks</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=965510020-19082009></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=965510020-19082009>Hai
Lei</SPAN></FONT></DIV></BODY></HTML>