Using Yate's PHP library on windows

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Install PHP)
Line 4: Line 4:
 
===Install PHP===
 
===Install PHP===
  
Download and install the latest (version 5.4.8 at this time) php package from http://www.php.net/downloads.php. I suggest the self installer [http://windows.php.net/download/ mirror].
+
Download and install the latest (version 5.4.8 at this time) php package from http://www.php.net/downloads.php. I suggest the self installer [http://windows.php.net/download/ mirror].<br>
 
Run the installer and don't forget to add the '''socket extensions''' (needed to connect to yate via tcp)
 
Run the installer and don't forget to add the '''socket extensions''' (needed to connect to yate via tcp)
  

Revision as of 17:06, 16 November 2012

Test an existing PHP script on Windows.

Contents

Install PHP

Download and install the latest (version 5.4.8 at this time) php package from http://www.php.net/downloads.php. I suggest the self installer mirror.
Run the installer and don't forget to add the socket extensions (needed to connect to yate via tcp)

Setup a listener

Add the following section to extmodule.conf (the word after "listener" will become the module name)

extmodule.conf

[listener test]
type=tcp
addr=0.0.0.0
port=5039
role=global

Modify provided example php files

These are found under <yatehome>\share\scripts. Let's open test.php and modify it as following: change line 13 from

Yate::Init();

to

Yate::Init(true, "localhost", 5039, "");

(init without parameters uses unix sockets to connect - in windows you have to use TCP)

Test the installation

  • Restart yate
  • Execute php test.php
  • connect to yate in telnet and type "external". Output should be:
>test

raise debug level (debug on) and you should be able to see timer messages.

See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers