@tiledesk/tiledesk-voice-twilio-connector 0.1.14-rc3 → 0.1.14-rc4
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 +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -408,7 +408,9 @@ router.post('/speechresult/:callSid', async (req, res) => {
|
|
|
408
408
|
router.post('/menublock/:callSid', async (req, res) => {
|
|
409
409
|
winston.verbose("(voice) called POST /menu", req.body);
|
|
410
410
|
winston.verbose("(voice) called POST /menu query" , req.query);
|
|
411
|
-
|
|
411
|
+
let start_call = new Date().getTime();
|
|
412
|
+
console.log('/menublock at: ', new Date(), 'with text:', req.body.Digits)
|
|
413
|
+
|
|
412
414
|
let message_text = '';
|
|
413
415
|
let attributes = {};
|
|
414
416
|
let button = {}
|
|
@@ -483,6 +485,7 @@ router.post('/menublock/:callSid', async (req, res) => {
|
|
|
483
485
|
BASE_URL: BASE_URL
|
|
484
486
|
});
|
|
485
487
|
|
|
488
|
+
let startSend = new Date().getTime();
|
|
486
489
|
//send message to tiledesk
|
|
487
490
|
let tiledeskMessage= {
|
|
488
491
|
text:message_text,
|
|
@@ -492,6 +495,8 @@ router.post('/menublock/:callSid', async (req, res) => {
|
|
|
492
495
|
attributes: attributes
|
|
493
496
|
};
|
|
494
497
|
let tdMessage = await tdChannel.send(tiledeskMessage, user.token, conversation_id);
|
|
498
|
+
let endSend = new Date().getTime();
|
|
499
|
+
console.log('(menu) Time to send messagge ( ', message_text, '): ', endSend - startSend, '[ms] at time', new Date())
|
|
495
500
|
|
|
496
501
|
//generate Tiledesk wait message
|
|
497
502
|
let delayTime = await voiceChannel.getNextDelayTimeForCallId(callSid)
|
|
@@ -505,6 +510,9 @@ router.post('/menublock/:callSid', async (req, res) => {
|
|
|
505
510
|
|
|
506
511
|
res.set('Content-Type', 'text/xml');
|
|
507
512
|
res.status(200).send(messageToVXML);
|
|
513
|
+
|
|
514
|
+
let end_call = new Date().getTime();
|
|
515
|
+
console.log('Time to responde to /menublock/<call_id>/ : ', end_call-start_call, '[ms]')
|
|
508
516
|
|
|
509
517
|
});
|
|
510
518
|
|