LumenVox: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
 
(3 intermediate revisions by the same user not shown)
Line 107: Line 107:
The LumenVox Speech Engine communicates with Asterisk via a "connector bridge." It's an Asterisk module called res_speech_lumenvox that ties into Asterisk's generic Speech API (the Asterisk modules res_speech and app_speech_utils).
The LumenVox Speech Engine communicates with Asterisk via a "connector bridge." It's an Asterisk module called res_speech_lumenvox that ties into Asterisk's generic Speech API (the Asterisk modules res_speech and app_speech_utils).


Log into your [http://www.lumenvox.com/customers/ LumenVox] user account and select '''My Downloads'''.  Look for the '''Asterisk 1.4 Connector''' and then select '''Download Latest'''.


Make sure that you have copied the file to /usr/src.  The following tar command may be different depending on the current version of the Connector Bridge.
<pre>
tar xvzf asterisk-1.4.x-lumenvox-support-linux-i686-32bit-b21-engine8.0.tar.gz
cd asterisk-1.4.x-lumenvox-support-linux-i686-32bit-b21-engine8.0
mv res_speech_lumenvox.so /usr/lib/asterisk/modules/res_speech_lumenvox.so
mv lumenvox.conf /etc/asterisk/lumenvox.conf
</pre>


The next step is to change lumenvox.conf to reflect your grammars and settings.
NOTE:I'm not sure at this stage if this file needs modifying.  I will need to revist this once I get a better understanding.
Edit the file /etc/asterisk/modules.conf
<pre>
nano  /etc/asterisk/modules.conf
</pre>
Make sure that the following is enter into the modules section.  Note that res_speech.so has to be loaded before res_speech_lumenvox.so.
<pre>
load => res_speech.so
load => res_speech_lumenvox.so
</pre>
My file looks like the following after I have entered the above two lines.
<pre>
;
; Asterisk configuration file
;
; Module Loader configuration file
;
[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; Uncomment the following if you wish to use the Speech Recognition API
;preload => res_speech.so
load => res_speech.so
load => res_speech_lumenvox.so
;
; If you want, load the GTK console right away. 
; Don't load the KDE console since
; it's not as sophisticated right now.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
;
load => res_musiconhold.so
;
; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
;
noload => chan_alsa.so
;noload => chan_oss.so
</pre>
= Testing the Installation =
=== Speech Engine ===
LumenVox provides an example program to test the installation of the Speech Engine. The program takes a predefined grammar and audio utterance and passes them to the Engine to get a decode.
To build and run the program:
<pre>
cd /opt/lumenvox/engine/examples/
make
</pre>
Run the program called "example"
<pre>
./example 127.0.0.1
</pre>
The program should loop through decodes that look like this:
<pre>
count=0, decode returns 10
Interpretation 1:
8587070707
</pre>
To exit the program, press CTRL+C.
=== Asterisk ===
Testing the LumenVox-Asterisk Connection
Once you have verified that the Speech Engine is running correctly, you can ensure the LumenVox-Asterisk connection is successful by running a simple speech recognition application. The following Dial Plan context will allow you to call in to your machine and say "Yes" or "No" at the beep and get a recognition, returned as either "true" or "false." You will need to have the Asterisk console open and have its verbosity set to at least 1 in order to see the results.
<pre>
[lumenvox-test]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,SpeechCreate
exten => s,n,SpeechLoadGrammar(yesno|/opt/lumenvox/engine/Lang/BuiltinGrammars/ABNFBoolean.gram)
exten => s,n,SpeechActivateGrammar(yesno)
exten => s,n,SpeechBackground(beep)
exten => s,n,Verbose(1|Result was ${SPEECH_TEXT(0)})
exten => s,n,Verbose(1|Confidence was ${SPEECH_SCORE(0)})
</pre>
= Addational Information =
For LumenVox to work correctly I had to copy files
<pre>
cp /opt/lumenvox/engine/lib/ /usr/lib/
</pre>
For Asterisk to start using the service command I needed to modify the file safe_asterisk<br>
/usr/sbin/safe_asterisk<br>
'''Change'''
<pre>
run_asterisk()
{
while :; do
if [ "$TTY" != "" ]; then
cd /tmp
stty sane < /dev/${TTY}
nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
else
cd /tmp
nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
fi
</pre>
'''To'''
<pre>
run_asterisk()
{
while :; do
if [ "$TTY" != "" ]; then
cd /tmp
stty sane < /dev/${TTY}
export LV_LICENSE="/opt/lumenvox/licenseserver/bin"
export LVBIN=/opt/lumenvox/engine/bin
export LVLIB=/opt/lumenvox/engine/lib
export LVINCLUDE=/opt/lumenvox/engine/include
export LVLANG=/opt/lumenvox/engine/Lang
export LVRESPONSE=/opt/lumenvox/engine/Lang
export LD_LIBRARY_PATH=$LVLIB:$LD_LIBRARY_PATH
export LD_RUN_PATH=$LVLIB:$LD_RUN_PATH
nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
else
cd /tmp
export LV_LICENSE="/opt/lumenvox/licenseserver/bin"
export LVBIN=/opt/lumenvox/engine/bin
export LVLIB=/opt/lumenvox/engine/lib
export LVINCLUDE=/opt/lumenvox/engine/include
export LVLANG=/opt/lumenvox/engine/Lang
export LVRESPONSE=/opt/lumenvox/engine/Lang
export LD_LIBRARY_PATH=$LVLIB:$LD_LIBRARY_PATH
export LD_RUN_PATH=$LVLIB:$LD_RUN_PATH
nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
fi
</pre>
[[Category : Asterisk]] [[Category : Software]]
[[Category : Asterisk]] [[Category : Software]]

Latest revision as of 06:43, 5 June 2008

LumenVox is a speech recognition application often used with PBX systems. Speech recognition should not to be confused with voice recognition which is completely different.

Speech recognition is the translation of spoken words into text or other type of useable format as voice recognition is the identification of a person like a fingerprint or a biometric eye scanner.

CentOS 4.x Configuration

Install GPG Key

mkdir -p /etc/pki/rpm-gpg/
cd /etc/pki/rpm-gpg/
wget http://www.lumenvox.com/packages/EL4/i386/RPM-GPG-KEY-LumenVox.gpg

Configuration of Repository

nano /etc/yum.repos.d/LumenVox.repo

Paste below content into file above.

###################################################
[LumenVox]
name=LumenVox Products $basearch
baseurl=http://www.LumenVox.com/packages/EL4/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LumenVox.gpg 
###################################################
cd /usr/src
wget http://dag.wieers.com/rpm/packages/js/js-1.5-0.rc6a.2.el4.rf.i386.rpm
rpm -i js-1.5-0.rc6a.2.el4.rf.i386.rpm


Cent OS 5.x Configuration

Install GPG Key

mkdir -p /etc/pki/rpm-gpg/
cd /etc/pki/rpm-gpg/
wget http://www.lumenvox.com/packages/EL5/i386/RPM-GPG-KEY-LumenVox.gpg

Configuration of Repository

nano /etc/yum.repos.d/LumenVox.repo

Paste below content into file above.

###################################################
[LumenVox]
name=LumenVox Products $basearch
baseurl=http://www.LumenVox.com/packages/EL5/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LumenVox.gpg 
###################################################
cd /usr/src
wget http://dag.wieers.com/rpm/packages/js/js-devel-1.60-1.el5.rf.i386.rpm
rpm -i js-devel-1.60-1.el5.rf.i386.rpm

Installation

yum install LumenVoxLicenseServer LumenVoxSRE

If any updates are reuqired to be installed a yum update will upgrade these applications.

You are now required to log off and then log back on to continue.

License

Part 1. Generating the Server ID File

cd /opt/lumenvox/licenseserver/bin
./getlvsystem_info

The process has created a file called Info.bts that needs ot be uploaded to LumenVox to generate a license key.

Part 2. Uploading the Server ID File and Downloading the License

Upload Info.bts

Log into your LumenVox user account and select My Licenses. Look under the heading of My Deployments you will see an link for Upload License. Select Upload License and browse to the file Info.bts. Once you have uploaded the Info.bts file the upload file changes to downlaod license.

Download License

From the My Licenses page and the My Deployments section select Download License. Once the file is downloaded save the file to /opt/lumenvox/licenseserver/bin.

Part 3. Installing a License

cd /opt/lumenvox/licenseserver/bin 
./license_mgr -m Licensefile.bts

You should get a responce as follows:

License server has successfully merged license file

Connector Bridge

The LumenVox Speech Engine communicates with Asterisk via a "connector bridge." It's an Asterisk module called res_speech_lumenvox that ties into Asterisk's generic Speech API (the Asterisk modules res_speech and app_speech_utils).

Log into your LumenVox user account and select My Downloads. Look for the Asterisk 1.4 Connector and then select Download Latest.

Make sure that you have copied the file to /usr/src. The following tar command may be different depending on the current version of the Connector Bridge.

tar xvzf asterisk-1.4.x-lumenvox-support-linux-i686-32bit-b21-engine8.0.tar.gz
cd asterisk-1.4.x-lumenvox-support-linux-i686-32bit-b21-engine8.0
mv res_speech_lumenvox.so /usr/lib/asterisk/modules/res_speech_lumenvox.so
mv lumenvox.conf /etc/asterisk/lumenvox.conf

The next step is to change lumenvox.conf to reflect your grammars and settings. NOTE:I'm not sure at this stage if this file needs modifying. I will need to revist this once I get a better understanding.

Edit the file /etc/asterisk/modules.conf

nano  /etc/asterisk/modules.conf

Make sure that the following is enter into the modules section. Note that res_speech.so has to be loaded before res_speech_lumenvox.so.

load => res_speech.so
load => res_speech_lumenvox.so

My file looks like the following after I have entered the above two lines.

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger has been initialized) can be loaded
; using 'preload'. This will frequently be needed if you wish to map all
; module configuration files into Realtime storage, since the Realtime
; driver will need to be loaded before the modules using those configuration
; files are initialized.
;
; An example of loading ODBC support would be:
;preload => res_odbc.so
;preload => res_config_odbc.so
;
; Uncomment the following if you wish to use the Speech Recognition API
;preload => res_speech.so

load => res_speech.so
load => res_speech_lumenvox.so

;
; If you want, load the GTK console right away.  
; Don't load the KDE console since
; it's not as sophisticated right now.
;
noload => pbx_gtkconsole.so
;load => pbx_gtkconsole.so
noload => pbx_kdeconsole.so
;
load => res_musiconhold.so
;
; Load either OSS or ALSA, not both
; By default, load OSS only (automatically) and do not load ALSA
;
noload => chan_alsa.so
;noload => chan_oss.so

Testing the Installation

Speech Engine

LumenVox provides an example program to test the installation of the Speech Engine. The program takes a predefined grammar and audio utterance and passes them to the Engine to get a decode.

To build and run the program:

cd /opt/lumenvox/engine/examples/
make

Run the program called "example"

./example 127.0.0.1

The program should loop through decodes that look like this:

count=0, decode returns 10
Interpretation 1:
8587070707

To exit the program, press CTRL+C.

Asterisk

Testing the LumenVox-Asterisk Connection Once you have verified that the Speech Engine is running correctly, you can ensure the LumenVox-Asterisk connection is successful by running a simple speech recognition application. The following Dial Plan context will allow you to call in to your machine and say "Yes" or "No" at the beep and get a recognition, returned as either "true" or "false." You will need to have the Asterisk console open and have its verbosity set to at least 1 in order to see the results.

[lumenvox-test]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,SpeechCreate
exten => s,n,SpeechLoadGrammar(yesno|/opt/lumenvox/engine/Lang/BuiltinGrammars/ABNFBoolean.gram)
exten => s,n,SpeechActivateGrammar(yesno)
exten => s,n,SpeechBackground(beep)
exten => s,n,Verbose(1|Result was ${SPEECH_TEXT(0)})
exten => s,n,Verbose(1|Confidence was ${SPEECH_SCORE(0)})

Addational Information

For LumenVox to work correctly I had to copy files

cp /opt/lumenvox/engine/lib/ /usr/lib/

For Asterisk to start using the service command I needed to modify the file safe_asterisk
/usr/sbin/safe_asterisk
Change

run_asterisk()
{
	while :; do 

		if [ "$TTY" != "" ]; then
			cd /tmp
			stty sane < /dev/${TTY}
			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
		else
			cd /tmp
			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
		fi

To

run_asterisk()
{
	while :; do 

		if [ "$TTY" != "" ]; then
			cd /tmp
			stty sane < /dev/${TTY}
	export LV_LICENSE="/opt/lumenvox/licenseserver/bin"
	export LVBIN=/opt/lumenvox/engine/bin
	export LVLIB=/opt/lumenvox/engine/lib
	export LVINCLUDE=/opt/lumenvox/engine/include
	export LVLANG=/opt/lumenvox/engine/Lang
	export LVRESPONSE=/opt/lumenvox/engine/Lang
	export LD_LIBRARY_PATH=$LVLIB:$LD_LIBRARY_PATH
	export LD_RUN_PATH=$LVLIB:$LD_RUN_PATH
			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} < /dev/${TTY}
		else
			cd /tmp
	export LV_LICENSE="/opt/lumenvox/licenseserver/bin"
	export LVBIN=/opt/lumenvox/engine/bin
	export LVLIB=/opt/lumenvox/engine/lib
	export LVINCLUDE=/opt/lumenvox/engine/include
	export LVLANG=/opt/lumenvox/engine/Lang
	export LVRESPONSE=/opt/lumenvox/engine/Lang
	export LD_LIBRARY_PATH=$LVLIB:$LD_LIBRARY_PATH
	export LD_RUN_PATH=$LVLIB:$LD_RUN_PATH
			nice -n $PRIORITY ${ASTSBINDIR}/asterisk ${CLIARGS} ${ASTARGS}
		fi