IVR Setup
(→How to route calls to script) |
(→How it works) |
||
(4 intermediate revisions by one user not shown) | |||
Line 19: | Line 19: | ||
Most IVR scripts would use type "nodata" for their type as the actual voice data is not provided by the IVR itself but by Yate provided sources attached later. | Most IVR scripts would use type "nodata" for their type as the actual voice data is not provided by the IVR itself but by Yate provided sources attached later. | ||
− | You can find | + | You can find some IVR examples Yate's sources '''~/share/scripts/'''. |
=== How it works === | === How it works === | ||
Line 29: | Line 29: | ||
* called number "called" - in case the IVR handles more than one number | * called number "called" - in case the IVR handles more than one number | ||
− | The application then keeps running, installing message handlers, generating messages and keeping the event loop running. In the end the caller is either disconnected or is transferred to another channel which can be another IVR. The application terminates when the caller disconnects or is transferred. | + | The application then keeps running, installing message handlers, generating messages and keeping the event loop running.<br> |
+ | In the end the caller is either disconnected or is transferred to another channel which can be another IVR.<br> | ||
+ | The application terminates when the caller disconnects or is transferred. | ||
You can find more about the internal working of an IVR application in the page related to [[Writing an IVR]]. | You can find more about the internal working of an IVR application in the page related to [[Writing an IVR]]. | ||
+ | |||
+ | |||
+ | '''See also''' | ||
+ | |||
+ | * [[External Module]] | ||
+ | * [[Lib Yate PHP|Library PHP in Yate]] | ||
+ | |||
+ | [[Category:Routing]] [[Category:IVR]] [[Category:Extmodule]] |
Latest revision as of 17:09, 31 October 2013
In Yate the IVR functionality is not related to routing, therefore regexroute - or any other routing module - will not help writing an IVR. In Yate an IVR is rather an application started when an incoming call is routed to that application. This application gets the opportunity of inspecting events generated by the caller and giving commands to Yate - all these by handling or generating Messages.
[edit] Where to place the script
You must make sure extmodule.yate exist (is compiled and/or installed) and is not disabled from the yate.conf file. Also in extmodule.conf make sure you specify a proper scripts_dir setting in the [general] section. The scripts_dir parameter must point to the directory where the external scripts and their libraries are installed, like in this example:
[general] scripts_dir=/usr/local/lib/yate/
In this directory you should place the IVR applications or scripts you are going to use.
[edit] How to route calls to script
You will also need to route the incoming calls to the external application so it creates an instance of the IVR when the user dials that number. Let's suppose you want to use Regular expressions to route the short number 555 to the voicemail.
^555$=external/nodata/voicemail.php
Most IVR scripts would use type "nodata" for their type as the actual voice data is not provided by the IVR itself but by Yate provided sources attached later.
You can find some IVR examples Yate's sources ~/share/scripts/.
[edit] How it works
When the 555 number is dialed an instance of the voicemail.php script is launched and the "call.execute" message is passed to it (even if it didn't install a handler) so it can pick up usefull info about the call:
- caller channel "id"
- caller number "caller"
- caller user account "user" - if authenticated by the incoming call driver
- called number "called" - in case the IVR handles more than one number
The application then keeps running, installing message handlers, generating messages and keeping the event loop running.
In the end the caller is either disconnected or is transferred to another channel which can be another IVR.
The application terminates when the caller disconnects or is transferred.
You can find more about the internal working of an IVR application in the page related to Writing an IVR.
See also