If socket connection is required by libyate.php check if the PHP sockets extension is loaded.
git-svn-id: http://voip.null.ro/svn/yate@5411 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
0eb5df5f89
commit
b76cc849fe
|
@ -449,8 +449,14 @@ class Yate
|
|||
$yate_stdout = false;
|
||||
$yate_stderr = false;
|
||||
$yate_output = false;
|
||||
$yate_socket = false;
|
||||
if ($addr) {
|
||||
$ok = false;
|
||||
if (!function_exists("socket_create")) {
|
||||
$yate_stderr = fopen("php://stderr","w");
|
||||
Yate::Output("PHP sockets missing, initialization failed");
|
||||
return false;
|
||||
}
|
||||
if ($port) {
|
||||
$yate_socket = @socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
|
||||
$ok = @socket_connect($yate_socket,$addr,$port);
|
||||
|
@ -468,7 +474,6 @@ class Yate
|
|||
$yate_output = true;
|
||||
}
|
||||
else {
|
||||
$yate_socket = false;
|
||||
$yate_stdin = fopen("php://stdin","r");
|
||||
$yate_stdout = fopen("php://stdout","w");
|
||||
$yate_stderr = fopen("php://stderr","w");
|
||||
|
|
Loading…
Reference in New Issue