<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2800.1605" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>How to display uuid of channel from js script in
php script ?<BR>My js script looks like this:</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>//----------------------------------------<BR>function
MakeFirstCall(caller_number)<BR>{<BR> var gateway =
"sofia/gateway/myGateway/";</DIV>
<DIV> </DIV>
<DIV> session_leg_a = new
Session();<BR> session_leg_a.originate(session_leg_a, gateway +
caller_number); <BR> session_leg_a.execute("park()");
<BR> session_leg_a.streamFile("msg.wav");</DIV>
<DIV> </DIV>
<DIV> var leg_a_uuid = session_leg_a.uuid;<BR> // How return
leg_a_uuid to php script ????<BR>}</DIV>
<DIV> </DIV>
<DIV>if(argv[0] != "")<BR>{<BR> MakeFirstCall(argv[0]);<BR>}</DIV>
<DIV> </DIV>
<DIV>exit();<BR>//----------------------------------------</DIV>
<DIV> </DIV>
<DIV><BR>In php I have following lines:</DIV>
<DIV> </DIV>
<DIV><BR>//----------------------------------------<BR>$handle =
fsockopen('127.0.0.1', '8021', $erno, $errstr, 30); <BR>if(!$handle)
<BR>{<BR> die("Connect failed with erno $erno and errstr
$errstr\n");<BR>}<BR>else <BR>{<BR> $response= fread($handle,
1024);<BR> $authMessage = "auth
myFSpassword\r\n\r\n";<BR> fwrite($handle, "$authMessage");<BR>
<BR> <BR> $response = fread($handle,
1024);<BR> echo "<BR>First response
$response<BR>";<BR> $command = "api jsrun firstCall.js
0048xxxxxxxx1\r\n\r\n"; <BR> fwrite($handle,
$command);<BR> <BR> $response =
fread($handle, 1024);<BR> echo "<BR>Second response
$response<BR>";<BR> $response = fread($handle, 1024);<BR> echo
"<BR>Third response
$response<BR>";<BR>}<BR>//----------------------------------------</DIV>
<DIV> </DIV>
<DIV><BR>After I run php script I get OK+ result but I want
uuid.</FONT></DIV></BODY></HTML>