Upgrade 3CX to v18 and get it hosted free!

Asterisk LumenVox Via PHPAGI

Author image

Asterisk LumenVox via the PHPAGI

The PHPAGI is a PHP class for the Asterisk Gateway Interface. LumenVox is a company that creates a voice recognition add-on for Asterisk.

Below is a quick example PHP script that loads the PHPAGI class and then uses it to accept speech input. You must create a grammar before loading it with the example below. I could not find ANY documentation about using LumenVox from the AGI. You may want to try a simple test through the DialPlan, to make sure you have everything working, before you jump into the AGI.

#!/usr/bin/php -q
<?php

  // Include the agi class
  require('./phpagi-2.14/phpagi.php');

  // Create an instance of the agi class
  $agi = new AGI();

  // Answer
  $agi->answer();

  // Lumenvox Test
  $agi->exec('SpeechCreate');
  $agi->exec('SpeechActivateGrammar hipReport');
  $agi->exec('SpeechStart');
  $result = $agi->exec('SpeechBackground beep|5');
  $score = $agi->get_variable('SPEECH_SCORE(0)');
  $text = $agi->get_variable('SPEECH_TEXT(0)');
  $agi->exec('SpeechDeactivateGrammar');

  $agi->exec('NoOp "Speech score = ' . $score['data'] . '"');
  $agi->exec('NoOp "Speech result = ' . $text['data'] . '"');

?>

The result from the grammar will be stored in the variable $text[‘data’]. The score will be stored in $score[‘data’].


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.
Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.