Built motion from commit 96f8de6d.|2.6.3
[motion2.git] / server / services / agi / scripts / sestek / nda / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x7427=['uniqueid','callerid','dnid','Bearer\x20','access_token','body','channelData','ndagenerate_audio','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type'];(function(_0x5abc1e,_0x8715e7){var _0x3423d1=function(_0x34055b){while(--_0x34055b){_0x5abc1e['push'](_0x5abc1e['shift']());}};_0x3423d1(++_0x8715e7);}(_0x7427,0x111));var _0x7742=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x7427[_0x333767];return _0x51661b;};'use strict';var rp=require(_0x7742('0x0'));var url=require(_0x7742('0x1'));var logger=require(_0x7742('0x2'))(_0x7742('0x3'));module['exports']=function(_0x3b6268,_0x1bfe63){var _0x49ff50={'method':_0x7742('0x4'),'uri':url[_0x7742('0x5')](_0x1bfe63[_0x7742('0x6')],_0x7742('0x7')),'form':{'grant_type':_0x7742('0x8'),'username':_0x1bfe63['username'],'password':_0x1bfe63['password']},'json':!![]};return rp(_0x49ff50)[_0x7742('0x9')](function(_0xd21f94){var _0x3c6ceb={'method':_0x7742('0x4'),'uri':url[_0x7742('0x5')](_0x1bfe63[_0x7742('0xa')],_0x7742('0xb')),'body':{'type':_0x1bfe63[_0x7742('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x3b6268[_0x7742('0xd')]},'from':{'id':_0x3b6268[_0x7742('0xe')],'name':_0x3b6268['calleridname']},'recipient':{'id':_0x3b6268[_0x7742('0xf')],'name':_0x3b6268['extension']},'text':_0x1bfe63['text'],'channelData':{}},'headers':{'Authorization':_0x7742('0x10')+_0xd21f94[_0x7742('0x11')]},'json':!![]};if(_0x1bfe63['project']){_0x3c6ceb[_0x7742('0x12')][_0x7742('0x13')]['ProjectName']=_0x1bfe63['project'];}if(_0x1bfe63[_0x7742('0x14')]=='1'){_0x3c6ceb['body']['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x1bfe63[_0x7742('0x15')]){_0x3c6ceb['body']['channelData'][_0x7742('0x16')]=_0x1bfe63['custom_action'];if(_0x1bfe63[_0x7742('0x17')]){_0x3c6ceb[_0x7742('0x12')][_0x7742('0x13')][_0x7742('0x18')]=_0x1bfe63[_0x7742('0x17')];}}logger[_0x7742('0x19')](JSON['stringify'](_0x3c6ceb));return rp(_0x3c6ceb);});};