Yate's PHP library
From Yate Documentation
(Difference between revisions)
(11 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | |||
+ | The main library written in PHP is libyate.php that can be found in Yate's sources '''~/share/scripts'''. <br> | ||
+ | The purpose of this library is to help you write your own scripts to handle events, send messages or set message handlers in Yate using [[External Module|external module]]. | ||
===libyate.php=== | ===libyate.php=== | ||
− | This PHP library implements the basics for writing object oriented, event driven external modules (global or channel) using the PHP language and interpreter. | + | This PHP library implements the basics for writing object oriented, event driven external modules (global or channel) using the PHP language and interpreter. |
− | ===How it | + | ===How it Works=== |
* Connecting to Yate | * Connecting to Yate | ||
Line 21: | Line 24: | ||
* add Yate::SetLocal("restart",true); to your script to force a restart if your script dies | * add Yate::SetLocal("restart",true); to your script to force a restart if your script dies | ||
− | * Restart your script from rmanager by issuing the following command: | + | * Restart your script from [[rmanager]] by issuing the following command: |
+ | |||
+ | external restart <your scriptname>.php | ||
Line 28: | Line 33: | ||
* [[Rmanager]] | * [[Rmanager]] | ||
* [[IVR Setup]] | * [[IVR Setup]] | ||
+ | * [[External Module]] | ||
+ | |||
+ | [[Category:Extmodule]] [[Category:PHP]] [[Category:Programmers]] [[Category:Scripting]] |
Latest revision as of 09:23, 23 May 2014
The main library written in PHP is libyate.php that can be found in Yate's sources ~/share/scripts.
The purpose of this library is to help you write your own scripts to handle events, send messages or set message handlers in Yate using external module.
Contents |
[edit] libyate.php
This PHP library implements the basics for writing object oriented, event driven external modules (global or channel) using the PHP language and interpreter.
[edit] How it Works
- Connecting to Yate
- Showing debug output
- Handling events
- Sending messages
- Setting message handlers
- Accessing local parameters
[edit] Other libraries implemented on top of libyate.php
- libyateivr.php - Object oriented IVR
- libyatechan.php - Pseudo sequential channel interface
[edit] Handy hints when writing your own PHP modules
- add Yate::SetLocal("restart",true); to your script to force a restart if your script dies
- Restart your script from rmanager by issuing the following command:
external restart <your scriptname>.php
See also