drachtio/drachtio-freeswitch-modules

[mod_dialogflow] Question about multiple GOOGLE_APPLICATION_CREDENTIALS

Closed this issue · 2 comments

Hello!

I have a quick question regarding mod_dialogflow and credentials
I'm looking to have a Freeswitch instance serving multiple Dialogflow accounts (imagine two different users giving me credentials). One of the use cases is that these two clients may call concurrently. Is there another way other than setting a global ENV VAR?

I noticed this when I dove into the code:
"missing credentials: GOOGLE_APPLICATION_CREDENTIALS must be suuplied either as an env variable (path to file) or a channel variable (json string)\n"
Is it possible that, in the drachtio application, when I receive a call I check which user is calling and then call FreeSWITCH API command uuid_set_var to add the channel variable "GOOGLE_APPLICATION_CREDENTIALS" with the corresponding service account json?

yes, you can do exactly that. Have a look here for an example

Great! Thanks again for the help! 😀