0

I have freeswitch running on a Centos 6 remote server and I have XAMPP installed on the local machine ( windows 7 x64 PHP Version 5.3.8 ) for testing. I am trying to use Mod event socket ( http://wiki.freeswitch.org/wiki/Event_Socket ) to connect to freeswitch from a php script, using Event Socket Library ( http://wiki.freeswitch.org/wiki/Event_Socket_Library ).

My php script is:

#!/usr/bin/php

<?php

require_once('ESL.php');

$command = "show channels";
$sock = new ESLconnection('xxx.xxx.xxx.xxx', '8021', 'fsAdmin');
$res = $sock->api($command);
printf("%s\n", $res->getBody());

?>

where xxx.xxx.xxx.xxx is the freeswitch server's address.

I have two problems:

  • in Windows I seem to need a php_ESL.dll which I can't find anywhere. The only files I've got are:

    • ESL.php
    • esl_wrap.cpp
    • Makefile
    • php_ESL.h
  • I have PHP Version 5.3.8 and in the ESL.php is used the dl() function and I get: Fatal error: Call to undefined function dl() in C:\xampp\htdocs\phpesl\ESL.php

    +The dl() function is called in ESL.php:

        // Try to load our extension if it's not already loaded.
      if (!extension_loaded("ESL")) {
      if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
        if (!dl('php_ESL.dll')) return;
      } else {
        // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'.
        // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'.
        if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
          if (!dl('ESL.so')) return;
        } else {
          if (!dl('ESL.'.PHP_SHLIB_SUFFIX)) return;
        }
      }
    }
    

Does anybody know how to solve this or encountered the same problem ?

Thanks.

Berry
  • 59
  • 1
  • 10
  • To answer both problems 1) You will need to build the DLL yourself from the source code - [see here](http://wiki.freeswitch.org/wiki/Installation_for_Windows) 2) [`enable_dl`](http://www.php.net/manual/en/info.configuration.php#ini.enable-dl) is set to off in your php.ini file. – DaveRandom Jun 12 '12 at 13:31

2 Answers2

0

probably the least effort would be to have a Linux webserver somewhere - for example, in a virtual machine on your windows PC

Stanislav Sinyagin
  • 1,973
  • 10
  • 10
0

In your issue I think dl function disabled in the php.ini file.

phpmotion requires these PHP settings:

Thread saftery= disabled
enable_dl = On
safe_mode = off
Bendy
  • 3,506
  • 6
  • 40
  • 71
HP371
  • 860
  • 11
  • 24