Добрый вечер!
[root@freepbx voicer]# npm install voicer -g
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Use uuid module instead
/root/.nvm/versions/node/v10.21.0/bin/voicer -> /root/.nvm/versions/node/v10.21.0/lib/node_modules/voicer/bin/agi.js
voicer в связке с wit.ai
Что-то опять изменилось...
Если правильно понимаю, voicer сравнивает, но не выдает ответ ...
agi server started on port 3000 with config { agi: { port: 3000 },
processing:
{ totalAttempts: 2,
playGreeting: true,
playBeepBeforeRecording: false },
asterisk:
{ sounds:
{ onErrorBeforeFinish: 'ostavaytes',
onErrorBeforeRepeat: 'eseraz',
greeting: 'beep' },
recognitionDialplanVars: { status: 'RECOGNITION_RESULT', target: 'RECOGNITION_TARGET' } },
record: { directory: '/tmp', type: 'wav', duration: 3 },
recognize:
{ directory: '/tmp',
type: 'witai',
options: { developer_key: 'тутверныйключ' } },
lookup:
{ type: 'file',
options: { dataFile: '/etc/voicer/data/peernames.json' } } }
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 -- start processing
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 variables {"agi_network":"yes","agi_request":"agi","agi_channel":"SIP/Alina_Sip_742843_1-000001ed","agi_language":"ru","agi_type":"SIP","agi_uniqueid":"1628183856.750","agi_version":"16.11.1","agi_callerid":"89162911537","agi_calleridname":" Иван Валерьевич","agi_callingpres":"0","agi_callingani2":"0","agi_callington":"0","agi_callingtns":"0","agi_dnid":"100365101","agi_rdnis":"unknown","agi_context":"my-voicer","agi_extension":"s","agi_priority":"1","agi_enhanced":"0.0","agi_accountcode":"","agi_threadid":"140450513794816","":""}
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 stepSetFailedVars
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 set RECOGNITION_RESULT=FAILED
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 stepGreeting
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 answer
2021-8-5 20:17:46 - �[32minfo�[39m: 0000001 o
2021-8-5 20:17:47 - �[32minfo�[39m: 0000001 stepRecord /tmp/e3bac18f-b369-4381-91b3-79abab2aee06
2021-8-5 20:17:47 - �[32minfo�[39m: 0000001 stepRecord start record
2021-8-5 20:17:50 - �[32minfo�[39m: 0000001 stepRecord end record
2021-8-5 20:17:50 - �[32minfo�[39m: 0000001 stepRecognize /tmp/e3bac18f-b369-4381-91b3-79abab2aee06.wav
2021-8-5 20:17:50 - �[32minfo�[39m: 0000001 file /tmp/e3bac18f-b369-4381-91b3-79abab2aee06.wav
options { developer_key: 'тутверныйключ',
file: '/tmp/e3bac18f-b369-4381-91b3-79abab2aee06.wav' }
res Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]:
{ body:
PassThrough {
_readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: true,
_transformState: [Object] },
disturbed: false,
error: null },
[Symbol(Response internals)]:
{ url: 'https://api.wit.ai/speech',
status: 200,
statusText: 'OK',
headers: Headers { [Symbol(map)]: [Object] },
counter: 0 } }
json { entities: {}, intents: [], text: 'ой', traits: {} }
2021-8-5 20:17:51 - �[32minfo�[39m: 0000001 text , intents=[], text=ой,
2021-8-5 20:17:51 - �[32minfo�[39m: 0000001 stepLookup ой
read file /etc/voicer/data/peernames.json
parsed [ { name: '104',
target: 'SIP/104',
variants:
[ 'мих светлана ивановна',
'светлана ивановна',
'светлана иванова',
.......
тутдлиннаяпортянкафайла
......
'не знаю' ] } ]
2021-8-5 20:17:51 - �[32minfo�[39m: 0000001 stepRepeatOnError Error: Lookup: not found in source
at Promise (/usr/lib/node_modules/voicer/apps/agi/source/fileSource.js:26:16)
at new Promise ()
at FileSource.find (/usr/lib/node_modules/voicer/apps/agi/source/fileSource.js:10:12)
at fileReader.readFile.then.then.then (/usr/lib/node_modules/voicer/apps/agi/source/fileSource.js:48:23)
at
2021-8-5 20:17:53 - �[32minfo�[39m: 0000001 --- fail, make next attempt --- current=2, total=2
2021-8-5 20:17:53 - �[32minfo�[39m: 0000001 stepRecord /tmp/e3bac18f-b369-4381-91b3-79abab2aee06
2021-8-5 20:17:53 - �[32minfo�[39m: 0000001 stepRecord start record
2021-8-5 20:17:57 - �[32minfo�[39m: 0000001 stepRecord end record
2021-8-5 20:17:57 - �[32minfo�[39m: 0000001 stepRecognize /tmp/e3bac18f-b369-4381-91b3-79abab2aee06.wav
2021-8-5 20:17:57 - �[32minfo�[39m: 0000001 file /tmp/e3bac18f-b369-4381-91b3-79abab2aee06.wav
options { developer_key: 'тутверныйключ',
file: '/tmp/e3bac18f-b369-4381-91b3-79abab2aee06.wav' }
res Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]:
{ body:
PassThrough {
_readableState: [Object],
readable: true,
domain: null,
_events: [Object],
_eventsCount: 3,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: true,
_transformState: [Object] },
disturbed: false,
error: null },
[Symbol(Response internals)]:
{ url: 'https://api.wit.ai/speech',
status: 200,
statusText: 'OK',
headers: Headers { [Symbol(map)]: [Object] },
counter: 0 } }
json { entities: {}, intents: [], text: 'давай', traits: {} }
2021-8-5 20:17:58 - �[32minfo�[39m: 0000001 text , intents=[], text=давай,
2021-8-5 20:17:58 - �[32minfo�[39m: 0000001 stepLookup давай
read file /etc/voicer/data/peernames.json
parsed [ { name: '104',
target: 'SIP/104',
variants:
[ 'мих светлана ивановна',
'светлана ивановна',
'светлана иванова',
.......
тутдлиннаяпортянкафайла
......
'не знаю' ] } ]
2021-8-5 20:17:58 - �[32minfo�[39m: 0000001 stepError Error: Lookup: not found in source
at Promise (/usr/lib/node_modules/voicer/apps/agi/source/fileSource.js:26:16)
at new Promise ()
at FileSource.find (/usr/lib/node_modules/voicer/apps/agi/source/fileSource.js:10:12)
at fileReader.readFile.then.then.then (/usr/lib/node_modules/voicer/apps/agi/source/fileSource.js:48:23)
at
2021-8-5 20:18:00 - �[32minfo�[39m: 0000001 stepFinish
2021-8-5 20:18:00 - �[32minfo�[39m: 0000001 -- hangup
2021-8-5 20:18:00 - �[32minfo�[39m: 0000001 stepFinish
2021-8-5 20:18:00 - �[32minfo�[39m: 0000001 -- close
Спасибо!