installation_guide:asterisk:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revisionBoth sides next revision
installation_guide:asterisk:start [2016/09/09 13:41] – [Configuration files] borjainstallation_guide:asterisk:start [2017/06/27 20:39] – [Variables] borja
Line 1: Line 1:
-====== Asterisk integration ======+====== Voximal Asterisk integration ======
  
 ===== The Asterisk Module ===== ===== The Asterisk Module =====
Line 48: Line 48:
        * VoiceXML interpreter configuration file (to overwrite default settings)  : [[installation_guide:openvxi:start|/etc/voximald.conf]]            * VoiceXML interpreter configuration file (to overwrite default settings)  : [[installation_guide:openvxi:start|/etc/voximald.conf]]    
  
-       * Asterisk Application/module configuration file : [[installation_guide:configuration_file_voximal:start|/etc/asterisk/voximal.conf]]  +       * Asterisk Application/module configuration file : [[installation_guide:configuration_file_voximal:start|/etc/asterisk/voximal.conf]] 
  
-==== Variables ====+  
 +====  Configuration example ==== 
 + 
 +Example: 
 + 
 +<code> 
 +; VoiceXML Configuration 
 +
 +[general] 
 +wav_codec=gsm 
 +videosilence=;silence 
 +audiosilence=;silence 
 +debug=4 
 +video=yes 
 + 
 +[license] 
 +max=100 
 +key=… 
 + 
 +[account1] 
 +name=Test1 
 +url=http://localhost/vxml/index.php 
 +max=1 
 + 
 +[account2] 
 +name=Test2 
 +url=http://localhost/vxml/demo/index.vxml 
 +max=3 
 +dialformat=SIP/%s@ovh-out 
 +</code> 
 + 
 +To assign an extension to a VXML account just follow this example, where we are assigning the previous account to three extensions number in your /etc/asterisk/extension.conf asterisk: 
 + 
 +<code> 
 +[default] 
 + 
 +exten => 981001001,1,Voximal(Test1) 
 +exten => 981001002,1,Voximal(Test2) 
 +exten => 981001003,1,Voximal(Test3) 
 +</code> 
 + 
 +NOTE: 
 +When you update your voximal.conf file, remember to refresh configuration making a command “voximal reload” in your CLI*> prompt. If you have added SIP, PRI or new extensions you must launch “sip reload”, “extensions reload”, “dialplan reload” or reload asterisk/voximal processes. Use the command “voximal show accounts” to dump your accounts. 
 + 
 +<code> 
 +CLI*> diaplan reload 
 +CLI*> voximal reload 
 +CLI*> voximal show accounts 
 +</code> 
 + 
 +Example: 
 + 
 +Add extensions to the Asterisk dial plan /etc/asterisk/extensions.conf, if you want to set the URL in the dialplan: 
 + 
 +<code> 
 +exten => 888,1,Answer 
 +exten => 888,n,Wait(3) 
 +exten => 888,n,Voximal(file:///root/example.vxml) 
 +exten => 888,n,Hangup 
 +</code> 
 + 
 +You can create and edit the file /root/example.vxml with the GNU text editor, VI, for example. 
 + 
 +This example will work if you have text-to-speech configured.  If not, use a pre-recorded wav or gsm file to replace the “Hello world!” text by an <audio> tag.  For more information, see the format extensions supported by Asterisk. 
 + 
 +<code> 
 +<?xml version="1.0"?> 
 +<vxml version = "2.0" xmlns="http://www.w3.org/2001/vxml"> 
 + <form> 
 +  <block><audio src="hello.wav"/></block> 
 + </form> 
 +</vxml> 
 +</code> 
 + 
 +Save the file in the same directory as the VoiceXML script (relative reference in this example). 
 +Reload the extensions configuration with: 
 + 
 +<code> 
 +*CLI> extensions reload 
 +</code> 
 + 
 +Call the service by calling: 
 + 
 +<code> 
 +SIP:888@<your server address> 
 +</code> 
 +  
 + 
 +==== Voximal variables ====
  
 Variables to set before or filled after the Vxml() execution : Variables to set before or filled after the Vxml() execution :
Line 95: Line 183:
   * VOXIMAL_ERROR=INTERPRETER ; Session refused, critical error with the VoiceXML browser connection.   * VOXIMAL_ERROR=INTERPRETER ; Session refused, critical error with the VoiceXML browser connection.
  
-===== Examples =====+==== Asterisk Global Variables ==== 
 + 
 +You can set and get variable at any moment from the VoiceXML syntax using the <transfer> tag :  
 + 
 +** GET **
  
-Example use with an URL parameter: 
 <code> <code>
-[incoming]  +     <transfer name="getvar" bridge="true" dest="execute:get(ID)" /> 
-exten => s,1,Answer  +     <block> 
-exten => s,n,Wait(3)  +       <prompt> 
-exten =s,n,Voximal(http://localhost/vxml/index.vxml) +         End of Transfer test <value expr="getvar$.value" />
-exten =s,n,Hangup+       </prompt> 
 +     </block>
 </code> </code>
  
-Example to catch the Vxml() errors :+** SET ** 
 <code> <code>
-exten => _X.,1,Voximal() +     <transfer name="totobridge="truedest="execute:set(MOMO)=10"> 
-exten => _X.,n,NoOp(${VOXIMAL_ERROR}) +     </transfer>
-exten => _X.,n,GotoIf($["${VOXIMAL_ERROR}== ""]?hangup) +
-exten => _X.,n,Busy() +
-exten => _X.,n(hangup),Hangup()+
 </code> </code>
 +
  
 ===== Asterisk Online Help ====== ===== Asterisk Online Help ======
  
 Online help can be accessed by typing the following command at the CLI prompt: Online help can be accessed by typing the following command at the CLI prompt:
 +
 +<code>
 *CLI> help voximal *CLI> help voximal
 +</code>
  
 ===== CLI Management Commands ====== ===== CLI Management Commands ======
Line 210: Line 304:
 The following entries are the Asterisk CLI commands for the VoiceXML browser. The following entries are the Asterisk CLI commands for the VoiceXML browser.
  
-===== Example ======+===== Examples =====
  
 Add extensions to the Asterisk dial plan /etc/asterisk/extensions.conf: Add extensions to the Asterisk dial plan /etc/asterisk/extensions.conf:
 +
 +Example use with an URL parameter:
 <code> <code>
-exten => 888,1,Answer +[incoming]  
-exten => 888,n,Wait(3) +exten => 888,1,Answer  
-exten => 888,n,Voximal(file:///root/example.vxml)+exten => 888,n,Wait(3)  
 +exten => 888,n,Voximal(http://localhost/vxml/index.vxml)
 exten => 888,n,Hangup exten => 888,n,Hangup
 +</code>
 +
 +Example to catch the Vxml() errors :
 +<code>
 +exten => _X.,1,Voximal()
 +exten => _X.,n,NoOp(${VOXIMAL_ERROR})
 +exten => _X.,n,GotoIf($["${VOXIMAL_ERROR}" == ""]?hangup)
 +exten => _X.,n,Busy()
 +exten => _X.,n(hangup),Hangup()
 </code> </code>
  
Line 251: Line 357:
 </code> </code>
  
 +===== Load Balancer =====
 +
 +Example using the Dialplan and 4 different accounts (with differents ASR and TTS ressources).
 +
 +<code>
 +exten => s,1,NoOp(Balancing)
 +exten => s,n,Set(ACCOUNTMAX=4)
 +exten => s,n,Set(TRIES=0)
 +exten => s,n,Set(ACCOUNT=${RAND(1,${ACCOUNTMAX})})
 +exten => s,n(retry),Set(TRIES=$[${TRIES} + 1])
 +exten => s,n,Voximal(account${ACCOUNT})
 +exten => s,n,ExecIf($["${VOXIMAL_ERROR}" = ""]?Goto(app-blackhole,hangup,1))
 +exten => s,n,ExecIf($["${TRIES}" = "${ACCOUNTMAX}"]?Goto(app-blackhole,hangup,1))
 +exten => s,n,Set(ACCOUNT=$[${ACCOUNT} + 1])
 +exten => s,n,ExecIf($[${ACCOUNT} = ${ACCOUNTMAX}]?Set(ACCOUNT=1))
 +exten => s,n,goto(s,retry)
 +</code>
  
 ===== Troubleshooting (for Support) ===== ===== Troubleshooting (for Support) =====
  • installation_guide/asterisk/start.txt
  • Last modified: 2017/06/27 20:40
  • by borja