<!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>&nbsp;</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>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>//----------------------------------------<BR>function 
MakeFirstCall(caller_number)<BR>{<BR>&nbsp;var gateway = 
"sofia/gateway/myGateway/";</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; session_leg_a = new 
Session();<BR>&nbsp;session_leg_a.originate(session_leg_a, gateway + 
caller_number); <BR>&nbsp;session_leg_a.execute("park()");&nbsp; 
<BR>&nbsp;session_leg_a.streamFile("msg.wav");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;var leg_a_uuid = session_leg_a.uuid;<BR>&nbsp;// How return 
leg_a_uuid to php script ????<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>if(argv[0] != "")<BR>{<BR>&nbsp;MakeFirstCall(argv[0]);<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>exit();<BR>//----------------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>In php I have following lines:</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>//----------------------------------------<BR>$handle = 
fsockopen('127.0.0.1', '8021', $erno, $errstr, 30); <BR>if(!$handle) 
<BR>{<BR>&nbsp;die("Connect failed with erno $erno and errstr 
$errstr\n");<BR>}<BR>else <BR>{<BR>&nbsp;$response= fread($handle, 
1024);<BR>&nbsp;$authMessage = "auth 
myFSpassword\r\n\r\n";<BR>&nbsp;fwrite($handle, "$authMessage");<BR>&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;$response = fread($handle, 
1024);<BR>&nbsp;echo "&lt;BR&gt;First response 
$response&lt;BR&gt;";<BR>&nbsp;$command = "api jsrun firstCall.js 
0048xxxxxxxx1\r\n\r\n";&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;fwrite($handle, 
$command);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;$response = 
fread($handle, 1024);<BR>&nbsp;echo "&lt;BR&gt;Second response 
$response&lt;BR&gt;";<BR>&nbsp;$response = fread($handle, 1024);<BR>&nbsp;echo 
"&lt;BR&gt;Third response 
$response&lt;BR&gt;";<BR>}<BR>//----------------------------------------</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>After I run php script I get OK+ result but I want 
uuid.</FONT></DIV></BODY></HTML>