Built motion from commit (unavailable).|2.5.0
[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 _0x3a1b=['uniqueid','callerid','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','custom_action','CustomAction','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x2453d0,_0x1b2017){var _0x521fc8=function(_0xfc824f){while(--_0xfc824f){_0x2453d0['push'](_0x2453d0['shift']());}};_0x521fc8(++_0x1b2017);}(_0x3a1b,0x8b));var _0xb3a1=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3a1b[_0x4b055c];return _0x4b62bb;};'use strict';var rp=require(_0xb3a1('0x0'));var url=require(_0xb3a1('0x1'));var logger=require(_0xb3a1('0x2'))(_0xb3a1('0x3'));module[_0xb3a1('0x4')]=function(_0x5cfdbe,_0x5a994c){var _0x15fa50={'method':_0xb3a1('0x5'),'uri':url['resolve'](_0x5a994c[_0xb3a1('0x6')],_0xb3a1('0x7')),'form':{'grant_type':_0xb3a1('0x8'),'username':_0x5a994c[_0xb3a1('0x9')],'password':_0x5a994c[_0xb3a1('0x8')]},'json':!![]};return rp(_0x15fa50)[_0xb3a1('0xa')](function(_0x5f5d70){var _0x3f3173={'method':_0xb3a1('0x5'),'uri':url[_0xb3a1('0xb')](_0x5a994c[_0xb3a1('0xc')],_0xb3a1('0xd')),'body':{'type':_0x5a994c[_0xb3a1('0xe')]||_0xb3a1('0xf'),'channelId':'Nda','conversation':{'id':_0x5cfdbe[_0xb3a1('0x10')]},'from':{'id':_0x5cfdbe[_0xb3a1('0x11')],'name':_0x5cfdbe['calleridname']},'recipient':{'id':_0x5cfdbe['dnid'],'name':_0x5cfdbe[_0xb3a1('0x12')]},'text':_0x5a994c[_0xb3a1('0x13')],'channelData':{}},'headers':{'Authorization':_0xb3a1('0x14')+_0x5f5d70['access_token']},'json':!![]};if(_0x5a994c[_0xb3a1('0x15')]){_0x3f3173[_0xb3a1('0x16')][_0xb3a1('0x17')][_0xb3a1('0x18')]=_0x5a994c[_0xb3a1('0x15')];}if(_0x5a994c[_0xb3a1('0x19')]=='1'){_0x3f3173[_0xb3a1('0x16')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5a994c[_0xb3a1('0x1a')]){_0x3f3173['body'][_0xb3a1('0x17')][_0xb3a1('0x1b')]=_0x5a994c[_0xb3a1('0x1a')];if(_0x5a994c['custom_action_data']){_0x3f3173[_0xb3a1('0x16')][_0xb3a1('0x17')][_0xb3a1('0x1c')]=_0x5a994c['custom_action_data'];}}logger[_0xb3a1('0x1d')](JSON[_0xb3a1('0x1e')](_0x3f3173));return rp(_0x3f3173);});};