USAN / res_speech_gdfe

Asterisk speech driver for Google Dialogflow
GNU General Public License v2.0
16 stars 12 forks source link

Warnings at SpeechBackground() Could not create google credentials #32

Open Anarchy-avk opened 4 years ago

Anarchy-avk commented 4 years ago

Hi. I installed clear Centos 7. After installed speech driver with all dependencies. The only thing I replaced is pjsip to sip channel driver. In asterisk config folder I put svc_key.json with google credentials (Service account with DialogFlow API role). Set environment GOOGLE_APPLICATION_CREDENTIALS When i make call, I get warnings (project in logs replaced)

    -- Executing [PROJECT_ID@dialogflow-loop:1] NoOp("SIP/1000-00000000", "Dialogflow Loop Start") in new stack
    -- Executing [PROJECT_ID@dialogflow-loop:2] SpeechBackground("SIP/1000-00000000", "") in new stack
[Sep 24 09:27:04] WARNING[5729]: src/core/lib/security/credentials/google_default/credentials_generic.cc:34 grpc: Could not get HOME environment variable.
[Sep 24 09:27:04] WARNING[5729]: src/core/lib/security/credentials/google_default/google_default_credentials.cc:285 grpc: Could not create google default credentials.
[Sep 24 09:27:04] WARNING[5729]: src/core/lib/security/credentials/google_default/google_default_credentials.cc:290 grpc: grpc_google_default_credentials_create: {"created":"@1569310024.697116222","description":"Failed to create Google credentials","file":"src/core/lib/security/credentials/google_default/google_default_credentials.cc","file_line":227,"referenced_errors":[{"created":"@1569310024.697198073","description":"creds_path unset","file":"src/core/lib/security/credentials/google_default/google_default_credentials.cc","file_line":170},{"created":"@1569310024.697413861","description":"creds_path unset","file":"src/core/lib/security/credentials/google_default/google_default_credentials.cc","file_line":170}]}
[Sep 24 09:27:04] WARNING[5729]: src/core/ext/filters/client_channel/channel_connectivity.cc:49 grpc: grpc_channel_check_connectivity_state called on something that isnot a client channel, but 'lame-client'
[Sep 24 09:27:04] NOTICE[5729]: libdfegrpc.cc:564 int df_recognize_event(dialogflow_session*, const char*, const char*, int): Session 1569310024.0 got error performingevent detection on PROJECT_ID: lame client channel (2: )
[Sep 24 09:27:04] WARNING[5729]: res_speech_gdfe.c:1615 start_dialogflow_recognition: Error recognizing event on 0@1569310024.0

What I did wrong, help to understand. Test client in folder libdfegrpc works with this key.

./test_client -e hello -k key.json -p PROJECT_ID

but the queries come up empty image

DanDanN00dle commented 4 years ago

Have you set service_key in the [general] section of a res_speech_gdfe.conf file in your asterisk configuration directory? The module will attempt to use the Google "default credentials" if that value is not set (or if it cannot load that file -- in which case it would log an error).

[general]
service_key = /etc/asterisk/svc_key.json
Anarchy-avk commented 4 years ago

Yes. I have key svc_key.json with credentials and res_speech_gdfe.conf in asterisk folder

[general]
service_key=/etc/asterisk/svc_key.json

all files has owner asterisk:asterisk, read/write access for user and read access for others

Anarchy-avk commented 4 years ago

Tell me what else I can check. So as the problem I have not solved.

DanDanN00dle commented 4 years ago

Does the speech driver or dfe library log anything on startup? If it's looking to use the default credentials it either couldn't find or couldn't load your key.

XadNightfall commented 4 years ago

Hi all,

Someone has solved this problem opened by Anarchy-avk , because i have the same problem here. Thanks.

DanDanN00dle commented 4 years ago

@XadNightfall on startup the module should log if it has trouble loading the key specified in the configuration. Only if it cannot load the specified credentials (or they are not provided) will it attempt to use the Google default credentials. Does the module log any messages on startup? You would also see the messages when you issue gdfe reload on a modified configuration file. Some of the messages are debug level, so make sure you have those configured in your logger.conf.

XadNightfall commented 4 years ago

@DanDanN00dle , thanks for your reply, this is a piece of the FuLL log of Asterisk:

[Nov 5 20:15:26] VERBOSE[28889] loader.c: Loading app_speech_utils.so. [Nov 5 20:15:26] VERBOSE[28889] loader.c: res_speech_gdfe.so => (Google DialogFlow for Enterprise (DFE) Speech Engine) [Nov 5 20:15:26] VERBOSE[28889] res_speech.c: Made 'GoogleDFE' the default speech recognition engine [Nov 5 20:15:26] VERBOSE[28889] res_speech.c: Registered speech recognition engine 'GoogleDFE' [Nov 5 20:15:26] DEBUG[28889] res_speech_gdfe.c: Loading service key data from /etc/asterisk/svc_key.json [Nov 5 20:15:26] VERBOSE[28889] loader.c: Loading res_speech_gdfe.so.

it seems to load correctly the .json key but it doesn't, obviously the json file is correct.

ls /etc/asterisk/svc_key.json -la -rwxr-xr-x. 1 asterisk asterisk 2304 Oct 26 17:29 /etc/asterisk/svc_key.json

Thanks.

Happyman1974 commented 3 years ago

I have the same issue. I found that there is no any traffic to google API

tcpdump -iany host dialogflow.googleapis.com -nn

0 packets captured