External Module

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
Line 76: Line 76:
 
Also take a look at: [[How To For External Modules In Telnet]]
 
Also take a look at: [[How To For External Modules In Telnet]]
  
[[IVR Setup|Here]] is an example how to write an external module in PHP.
+
[[IVR Setup|Here]] is an example how to write a script in PHP.

Revision as of 17:40, 31 October 2012

External Module allows you to use channel or global scripts in Yate.

These modules can be started from Yate and communicate through pipes to the extmodule.
They can also be started from outside Yate and connect to a TCP or UNIX socket if a listener is configured.

Configuration

File extmodule.conf:

[general]
; General settings for the external module

; scripts_dir: string: The absolute or relative path used by default to load
;  scripts if no full path is specified
; Note that a trailing path separator should be added
; Uncomment the following line when running in the sources directory
;scripts_dir=share/scripts/

; priority: int: Priority of the call.execute handler
;priority=100

; timeout: int: How many milliseconds to wait for a module to answer
;timeout=10000

; timebomb: bool: Kill the module instance if it timed out
;timebomb=false

; waitflush: int: Milliseconds to wait at script shutdown after waiting messages
;  and message relays are flushed, valid range 1-100 ms
;waitflush=5

; trackparam: bool: Add the external module to the handler tracking parameter
;  The default of false lets each external script do so
;trackparam=false


;[listener sample]
; For each socket listener there should be a section starting with the
;  "listener" keyword

; type: keyword: Type of socket - "unix" or "tcp"

; path: string: Path of the UNIX socket to create

; addr: string: IP address to bind the TCP socket to
;addr=127.0.0.1

; port: int: TCP port to bind to, must be positive

; role: keyword: Role of incoming connections - "global", "channel" or don't set

[scripts]
; Add one entry in this section for each global external module that is to be
;  loaded on Yate startup
; Each line has to be on the form:
;   scriptname=parameter
; The script name should hold either the absolute path and name or the path
;  and name relative to the scripts_dir in section [general]
; The parameter is optional and if present is passed to the script as the first
;  (and single) parameter


[execute]
; Add one entry in this section for each external program that is to be
;  executed on Yate startup
; Each line has to be on the form:
;   progname=parameter
; The program name should hold the absolute path to the program
; The parameter is optional and if present is passed to the program as the first
;  (and single) parameter

IMPORTANT: If an external module fails to start the exact reason why is not displayed in rmanager.
You should instead examine the logs that will hold the reason the exec() has failed.

Also take a look at: How To For External Modules In Telnet

Here is an example how to write a script in PHP.

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers