jambonz / jambonz-feature-server

Core telephony feature server for the jambones platform
MIT License
43 stars 38 forks source link

Generate alert when say verb uses SSML for vendor/voice that does not support it #377

Closed davehorton closed 1 year ago

davehorton commented 1 year ago

For example, google studio voices do not support SSML and if you try to use it you get this error:

 {"level":30,"time":1686657843435,"pid":711886,"hostname":"ip-10-0-53-191","err":{"type":"Error","message":"3 INVALID_ARGUMENT: Studio voices temporarily do not support SSML.","stack":"Error: 3 INVALID_ARGUMENT: Studio voices temporarily do not support SSML.\n    at callErrorFromStatus (/home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/call.js:31:19)\n    at Object.onReceiveStatus (/home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/client.js:192:76)\n    at Object.onReceiveStatus (/home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)\n    at Object.onReceiveStatus (/home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)\n    at /home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78\n    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)\nfor call at\n    at ServiceClientImpl.makeUnaryRequest (/home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/client.js:160:34)\n    at ServiceClientImpl.<anonymous> (/home/admin/apps/jambonz-feature-server/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n    at /home/admin/apps/jambonz-feature-server/node_modules/@google-cloud/text-to-speech/build/src/v1/text_to_speech_client.js:183:29\n    at /home/admin/apps/jambonz-feature-server/node_modules/google-gax/build/src/normalCalls/timeout.js:44:16\n    at repeat (/home/admin/apps/jambonz-feature-server/node_modules/google-gax/build/src/normalCalls/retries.js:80:25)\n    at /home/admin/apps/jambonz-feature-server/node_modules/google-gax/build/src/normalCalls/retries.js:118:13\n    at OngoingCallPromise.call (/home/admin/apps/jambonz-feature-server/node_modules/google-gax/build/src/call.js:67:27)\n    at NormalApiCaller.call (/home/admin/apps/jambonz-feature-server/node_modules/google-gax/build/src/normalCalls/normalApiCaller.js:34:19)\n    at /home/admin/apps/jambonz-feature-server/node_modules/google-gax/build/src/createApiCall.js:84:30\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","code":3,"details":"Studio voices temporarily do not support SSML.","metadata":{},"note":"Exception occurred in retry method that was not classified as transient"},"opts":{"voice":{"name":"en-US-Studio-O","languageCode":"en-US","ssmlGender":"SSML_VOICE_GENDER_UNSPECIFIED"},"audioConfig":{"audioEncoding":"MP3"},"input":{"ssml":"<speak>\n<prosody volume=\"loud\">Hi there,</prosody> and welcome to jambones! \njambones is the <sub alias=\"seapass\">CPaaS</sub> designed with the needs\nof communication service providers in mind.\nThis is an example of simple text-to-speech, but there is so much more you can do.\nTry us out!\n</speak>"}},"msg":"synthAudio: Error synthesizing speech using google"}

We should write an alert with message "SSML tags are not supported for the specified vendor and language"

xquanluu commented 1 year ago

start working on this.

xquanluu commented 1 year ago

{ "total": 2, "page_size": "25", "page": "1", "data": [ { "time": "2023-06-17T06:19:10.612058856Z", "account_sid": "9351f46a-678c-43f5-b8a6-d4eb58d131af", "alert_type": "tts-failure", "detail": "3 INVALID_ARGUMENT: Studio voices temporarily do not support SSML.", "message": "text to speech request to google failed; please check your speech credentials", "service_provider_sid": "undefined", "target_sid": null }, { "time": "2023-06-17T06:19:08.587591066Z", "account_sid": "9351f46a-678c-43f5-b8a6-d4eb58d131af", "alert_type": "webhook-connection-failure", "detail": "The client is closed", "message": "failed to connect to https://run.mocky.io/v3/749cad30-06a2-4f6a-959c-00d5bee7f795", "service_provider_sid": "undefined", "target_sid": null } ] }

Payload already have the detail of error, We need to to update webapp to show that info correctly instead of

Screenshot 2023-06-17 at 13 28 48
xquanluu commented 1 year ago
Screenshot 2023-06-17 at 14 25 23

Update alert page like this

xquanluu commented 1 year ago

closed as PR is merged