Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] working PHP script with socket


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
saigop at gmail.com
Guest





PostPosted: Thu Sep 25, 2008 2:51 am    Post subject: [Freeswitch-users] working PHP script with socket Reply with quote

Hi,

Outbound call went thru socket with the PHP program. The program as follows,

<?php
$Caller = htmlspecialchars($_POST['Caller']);
$Callee = htmlspecialchars($_POST['Callee']);
echo "Php now!<br>";
echo "Caller is: $Caller<br>";
echo "Callee is: $Callee<br>";

$handle = fsockopen('127.0.0.1', '8021', $erno, $errstr, 30);
if (!$handle) {
//if connection fails exit and tell us what went wrong.
die("Connect failed with erno $erno and errstr $errstr\n");
}
else {
//read the first line the smtp server gives us (usually the version string)
//$responses = fgets($handle, 1024);
$response= fread($handle, 1024);
echo "connection opened, got response:<br> $response<br><br>";

$authMessage = "auth ClueCon\r\n\r\n";
fwrite($handle, "$authMessage");


$response = fread($handle, 1024);
echo "authMessage sent, got response:<br> $response<br>";


$command = "api originate sofia/default/$Callee@<freeswitch IP address> $Caller \r\n\r\n";

echo "command is $command";
fwrite($handle, $command);

$response = fread($handle, 1024);
echo "command sent, got response:<br> $response<br>";
$response = fread($handle, 1024);
echo "command sent, got response:<br> $response<br>";


//fclose($handle);
}
}
?>

Thanks
--
Thank you with regards,
Gopal,
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services