Speech Service Token Duration Extension Issue
Version
Webchat: V4.8.0 CDN: https://cdn.botframework.com/botframework-webchat/latest/webchat.js Botframework: V4
Describe the bug
I need to keep a Speech Service alive for a long period of time. Speech Service tokens last 10 minutes by default. Hence a service duration extension is required which requires a new token. I'm trying to adapt the following sample code available at https://github.com/microsoft/BotFramework-WebChat/blob/master/samples/03.speech/b.cognitive-speech-services-js/index.html However, it seems it doesn't requests a new token while keeping the bot flow. Could you please advise?
Thx,
Steps to reproduce
- Create an index.html by pasting the code from the sample code mentioned above.
- Reduce the
expireAfter = now + 300000;toexpireAfter = now + 2000;to speed up token expiration - Add the command
console.log(lastPromise);before thereturn lastPromise;entry in thecreateFetchSpeechServicesCredentials()function. - See the lastPromise token generated on the Google browser console.
- Wait 2 seconds for the new token to be generated
- Check again the lastPromise token variable on the Google browser console.
- Issue: the token doesn't update.
Expected behavior
The Speech test token should update according to the interval stated at expireAfter = now + x; entry.
Sorry. The token is actually changing. BTW, is the source code for https://webchat-mockbot.azurewebsites.net/speechservices/token available somewhere? That would be extremely useful!Thx in advance
Thanks. I found a sample token generator code at https://github.com/compulim/BotFramework-MockBot/blob/master/src/index.ts#L134 and managed to adapt it to my application. So I will be closing the case. Cheers.