@tiledesk/tiledesk-voice-twilio-connector 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -269,8 +269,8 @@ router.post('/nextblock/:callSid/', async(req, res) => {
269
269
  user = sessionInfo.user;
270
270
 
271
271
  let vxmlAttributes = {
272
- TTS_VOICE_LANGUAGE: null,
273
- TTS_VOICE_NAME: null,
272
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
273
+ TTS_VOICE_NAME: VOICE_NAME,
274
274
  callSid: callSid,
275
275
  };
276
276
 
@@ -426,8 +426,8 @@ router.post('/speechresult/:callSid', async (req, res) => {
426
426
  user = sessionInfo.user;
427
427
 
428
428
  let vxmlAttributes = {
429
- TTS_VOICE_LANGUAGE: null,
430
- TTS_VOICE_NAME: null,
429
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
430
+ TTS_VOICE_NAME: VOICE_NAME,
431
431
  callSid: callSid,
432
432
  };
433
433
 
@@ -551,8 +551,8 @@ router.post('/menublock/:callSid', async (req, res) => {
551
551
  user = sessionInfo.user;
552
552
 
553
553
  let vxmlAttributes = {
554
- TTS_VOICE_LANGUAGE: null,
555
- TTS_VOICE_NAME: null,
554
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
555
+ TTS_VOICE_NAME: VOICE_NAME,
556
556
  callSid: callSid,
557
557
  };
558
558
 
@@ -625,8 +625,8 @@ router.post('/handle/:callSid/:event', async (req, res) => {
625
625
  user = sessionInfo.user;
626
626
 
627
627
  let vxmlAttributes = {
628
- TTS_VOICE_LANGUAGE: null,
629
- TTS_VOICE_NAME: null,
628
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
629
+ TTS_VOICE_NAME: VOICE_NAME,
630
630
  callSid: callSid,
631
631
  };
632
632
 
@@ -710,8 +710,8 @@ router.post('/event/:callSid/:event', async(req, res)=> {
710
710
  user = sessionInfo.user;
711
711
 
712
712
  let vxmlAttributes = {
713
- TTS_VOICE_LANGUAGE: null,
714
- TTS_VOICE_NAME: null,
713
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
714
+ TTS_VOICE_NAME: VOICE_NAME,
715
715
  callSid: callSid,
716
716
  };
717
717
 
@@ -809,8 +809,8 @@ router.post('/twilio/status',async (req, res) => {
809
809
  user = sessionInfo.user;
810
810
 
811
811
  let vxmlAttributes = {
812
- TTS_VOICE_LANGUAGE: null,
813
- TTS_VOICE_NAME: null,
812
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
813
+ TTS_VOICE_NAME: VOICE_NAME,
814
814
  callSid: callSid,
815
815
  };
816
816
 
@@ -894,8 +894,8 @@ router.post('/record/:callSid/',async (req, res) => {
894
894
  user = sessionInfo.user;
895
895
 
896
896
  let vxmlAttributes = {
897
- TTS_VOICE_LANGUAGE: null,
898
- TTS_VOICE_NAME: null,
897
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
898
+ TTS_VOICE_NAME: VOICE_NAME,
899
899
  callSid: callSid,
900
900
  };
901
901
 
@@ -1116,8 +1116,8 @@ router.get('/test', async (req, res) => {
1116
1116
 
1117
1117
 
1118
1118
  let vxmlAttributes = {
1119
- TTS_VOICE_LANGUAGE: null,
1120
- TTS_VOICE_NAME: null,
1119
+ TTS_VOICE_LANGUAGE: VOICE_LANGUAGE,
1120
+ TTS_VOICE_NAME: VOICE_NAME,
1121
1121
  callSid: callSid
1122
1122
  };
1123
1123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiledesk/tiledesk-voice-twilio-connector",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Tiledesk VOICE Twilio connector",
5
5
  "license": "MIT",
6
6
  "author": "Gabriele Panico",
@@ -77,8 +77,7 @@ class TiledeskTwilioTranslator {
77
77
  vxmlAttributes.TTS_MODEL = flowAttributes.TTS_MODEL? flowAttributes.TTS_MODEL : OPENAI_SETTINGS.TTS_MODEL;
78
78
  vxmlAttributes.STT_MODEL = flowAttributes.STT_MODEL? flowAttributes.STT_MODEL : OPENAI_SETTINGS.STT_MODEL;
79
79
  }
80
-
81
-
80
+
82
81
 
83
82
  }
84
83
 
@@ -310,7 +309,7 @@ class TiledeskTwilioTranslator {
310
309
  const queryUrl = '?intentName='+ querystring.encode(xmlAttributes.intentName) + "&previousIntentTimestamp="+Date.now();
311
310
  gather.att("action", this.BASE_URL + '/speechresult/' + xmlAttributes.callSid + queryUrl)
312
311
  .att("method", "POST")
313
- .att("language", xmlAttributes.voiceLanguage)
312
+ .att("language", xmlAttributes.TTS_VOICE_LANGUAGE)
314
313
  .att('speechTimeout', "0")
315
314
 
316
315
  //if(xmlAttributes && xmlAttributes.noInputTimeout){
@@ -377,7 +376,7 @@ class TiledeskTwilioTranslator {
377
376
  .att("numDigits", "1" )
378
377
  .att("action", this.BASE_URL + '/menublock/' + xmlAttributes.callSid + queryUrl)
379
378
  .att("method", "POST")
380
- .att("language", xmlAttributes.voiceLanguage)
379
+ .att("language", xmlAttributes.TTS_VOICE_LANGUAGE)
381
380
 
382
381
  const prompt = await this.promptVXML(gather, message, xmlAttributes);
383
382
 
@@ -398,7 +397,7 @@ class TiledeskTwilioTranslator {
398
397
  gather.att("timeout", xmlAttributes.noInputTimeout/1000 )
399
398
  .att("action", this.BASE_URL + '/menublock/' + xmlAttributes.callSid + queryUrl)
400
399
  .att("method", "POST")
401
- .att("language", xmlAttributes.voiceLanguage)
400
+ .att("language", xmlAttributes.TTS_VOICE_LANGUAGE)
402
401
  const settings = await this.optionsVXML(gather, message, xmlAttributes);
403
402
 
404
403
  const prompt = this.promptVXML(gather, message, xmlAttributes);
@@ -429,7 +428,7 @@ class TiledeskTwilioTranslator {
429
428
  //rootEle.att("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
430
429
  //rootEle.att( "xsi:schemaLocation", "http://www.w3.org/2001/vxml http://www.w3.org/TR/2007/REC-voicexml21-20070619/vxml.xsd");
431
430
  //rootEle.att("version", "2.1");
432
- //rootEle.att("xml:lang", attributes.voiceLanguage);
431
+ //rootEle.att("xml:lang", attributes.TTS_VOICE_LANGUAGE);
433
432
 
434
433
  rootEle.ele("Parameter", { name: "callSid", value: "'" + attributes.callSid + "'" }).up();
435
434
  rootEle.ele("Parameter", { name: "intentName", value: "'" + attributes.intentName + "'"}).up();
@@ -40,8 +40,8 @@ module.exports = {
40
40
  },
41
41
  BASE_POOLING_DELAY: 250,
42
42
  MAX_POLLING_TIME: 30000,
43
- VOICE_NAME: 'Polly.Bianca-Neural',
44
- VOICE_LANGUAGE: 'it-IT',
43
+ VOICE_NAME: 'Polly.Danielle',
44
+ VOICE_LANGUAGE: 'en-US',
45
45
  CALL_STATUS: {
46
46
  INITIATED: 'initiated',
47
47
  RINGING: 'ringing',
@@ -69,7 +69,12 @@ class UploadService {
69
69
  }).catch((err) => {
70
70
  console.log('err', err)
71
71
  reject(err);
72
- })
72
+ }).finally(() => {
73
+ // Sempre eseguito
74
+ if (fs.existsSync(tempFilePath)) {
75
+ fs.unlinkSync(tempFilePath);
76
+ }
77
+ });
73
78
 
74
79
  })
75
80
  }