Welcome to asterisk-tiresias’s documentation!¶
Contents:
Glossary¶
Terms¶
- Timestamp
Requirement levels indicator¶
This document strives to adhere to RFC 2119. In particular should be noted tat:
MUST This word, or the terms “REQUIRED” or “SHALL”, mean that the definition is an absolute requirement of the specification.
MUST NOT This phrase, or the phrase “SHALL NOT”, mean that the definition is an absolute prohibition of the specification.
SHOULD This word, or the adjective “RECOMMENDED”, mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.
SHOULD NOT This phrase, or the phrase “NOT RECOMMENDED” mean that there may exist valid reasons in particular circumstances when the particular behavior is acceptable or even useful, but the full implications should be understood and the case carefully weighed before implementing any behavior described with this label.
MAY This word, or the adjective “OPTIONAL”, mean that an item is truly optional. One vendor may choose to include the item because a particular marketplace requires it or because the vendor feels that it enhances the product while another vendor may omit the same item. An implementation which does not include a particular option MUST be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality. In the same vein an implementation which does include a particular option MUST be prepared to interoperate with another implementation which does not include the option (except, of course, for the feature the option provides.)
Guidance in the use of these Imperatives
Imperatives of the type defined in this memo must be used with care and sparingly. In particular, they MUST only be used where it is actually required for interoperation or to limit behavior which has potential for causing harm (e.g., limiting retransmisssions) For example, they must not be used to try to impose a particular method on implementors where the method is not required for interoperability.
Security Considerations
These terms are frequently used to specify behavior with security implications. The effects on security of not implementing a MUST or SHOULD, or doing something the specification says MUST NOT or SHOULD NOT be done may be very subtle. Document authors should take the time to elaborate the security implications of not following recommendations or requirements as most implementors will not have had the benefit of the experience and discussion that produced the specification.
Introduction¶
This project is designed for voice recognition module for the asterisk.
Installation¶
Required libraries¶
Asterisk-13.6 or later
libaubio
libm
libcrypto
Install¶
$ cd <downloaded source directory>
$ cd src/
$ make
$ sudo make install
Configuration¶
The tiresias.conf consists of 2 parts. One is global, and the other is context.
/etc/asterisk/tiresias.conf
[global]
tolerance=0.001
[mycontext]
directory=/home/pchero/tmp/wav
Dialplan application¶
Tiresias¶
Attemps to fingerprinting and recognize the given channel.
This application attempts to detect the given channel’s voice is in the list of the given tiresias’s context. Simply, call this application after call has been answered(The Tiresias will be answered the call if the call was not answered).
When loaded, tiresias reads tiresias.conf and uses the parameters specified as default values and contexts. Those default values get overwritten when the calling Tiresias with parameters.
Syntax¶
Tiresias(<contaxt name>,<duration>,[tolerance],[freq_ignore_low],[freq_ignore_high])
context name
: Context name.duration
: Duration time(milliseconds).tolerance
: Tolerance score.freq_ignore_low
: frequency ignore low.freq_ignore_high
: frequency ignore high.
If the freq_ignore_low or freq_ignore_high sets, the frequency between freq_ignore_low and freq_ignore_high would be evaluated only.
The valid frquency would be like the below.
freq_ignore_low < frequency < freq_ignore_high
Channel variables¶
This application sets the following channel vairables
TIRSTATUS
TIRFRAMECOUNT
TIRMATCHCOUNT
TIRCONTEXT
TIRFILENAME
TIRFILEHASH
TIRFILEUUID
TIRSTATUS
: This is the status of the voice recognition.FOUND
: Found the voice fingerprinting info from the context’s audio list.NOTFOUND
: Could not find the voice fingerprinting info from the context’s audio list.HANGUP
: The call has been hungup before complete the recognition.
TIRFRAMECOUNT
: This is the value of the given channel’s audio frame total count. It sets only when the TIRSTATUS is FOUND.TIRMATCHCOUNT
: This is the value of matched count. It sets only when the TIRSTATUS is FOUND.TIRCONTEXT
: This is the context name of the found voice recognition. This sets only when the TIRSTATUS is FOUND.TIRFILENAME
: This is the file name of the found voice recognition. This sets only when the TIRSTATUS is FOUND.TIRFILEHASH
: This is the file hash of the found voice recognition. This sets only when the TIRSTATUS is FOUND.TIRFILEUUID
: This is the file uuid of the found voice recognition. This sets only when the TIRSTATUS is FOUND.
Example¶
[test_tiresias]
exten=> s,1,NoOp(test_tiresias)
same=> n,Answer()
same=> n,Tiresias(test,3000)
same=> n,NoOp(${TIRSTATUS})
same=> n,NoOp(${TIRFRAMECOUNT})
same=> n,NoOp(${TIRMATCHCOUNT})
same=> n,NoOp(${TIRCONTEXT})
same=> n,NoOp(${TIRFILENAME})
same=> n,NoOp(${TIRFILEHASH})
same=> n,NoOp(${TIRFILEUUID})
Cli operation¶
tiresias show contexts¶
Shows registered context list.
Asterisk*CLI>tiresias show contexts
Example¶
saturn*CLI> tiresias show contexts
Name Directory
test /home/pchero/tmp/mp3
tiresias show audios <context name>¶
Shows registered audio lists of given context.
Asterisk*CLI>tiresias show audios <context name>
Example¶
saturn*CLI> tiresias show audios test
Uuid Name Context Hash
1915e0f9-4e3c-4b39-880e-3f800551a1e4 Brad-Sucks--Total-Breakdown.mp3 test 0c92fa0c828583ed4361418262dd167c
12cc871e-8e0a-47d2-b557-47a098329a41 Choc--Eigenvalue-Subspace-Decomposition.mp3 test 73747a0bb4f74499a04e8364292e4255
36898a56-fa99-4e7e-93a4-459f2d4f0ee1 Josh-Woodward--I-Want-To-Destroy-Something-Be test e626aeabeb3c5d1e9855b71466f8a26c
a2b0f19d-db5f-4fd4-bb60-1dbf7c164ab2 Sean-Fournier--Falling-For-You.mp3 test 47658e276b7b686a09b34b959142b799
bab02a7b-04a5-491f-91d6-2d3f3ac702ff The-Lights-Galaxia--While-She-Sleeps.mp3 test 8d166a882948f761006cc5e52bf8c3aa
8d14567e-adda-48ce-b014-cf679f389054 demo-congrats.wav test c79c70d62dd82a81f25a02d615f3038c
2b88724b-b9d6-4f77-a76c-5feada725499 ibk_ars.wav test cc4ae6223722befe7c0673db37323cf3
a4b8a63d-56e7-42ab-9582-94cf668039bf ibk_ars_2.wav test ac04282209539c8833bf5204d9dc4db6
1efca21b-9807-4451-802d-0a4bdaf08c37 ibk_ars_3.wav test 2bb7ed60e6f28b3c82ceb8df869d631c