Built motion from commit 6f14c8ba.|2.6.29
[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 _0xdbfc=['CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','url','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','dnid','text','access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav'];(function(_0xf4868e,_0x45a7f9){var _0x290d23=function(_0x19ac16){while(--_0x19ac16){_0xf4868e['push'](_0xf4868e['shift']());}};_0x290d23(++_0x45a7f9);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x430842,_0x30d2d7){_0x430842=_0x430842-0x0;var _0x576ea1=_0xdbfc[_0x430842];return _0x576ea1;};'use strict';var rp=require(_0xcdbf('0x0'));var url=require(_0xcdbf('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0xcdbf('0x2')]=function(_0x3067d8,_0x3db24f){var _0x3ed1e1={'method':_0xcdbf('0x3'),'uri':url[_0xcdbf('0x4')](_0x3db24f[_0xcdbf('0x5')],'/token'),'form':{'grant_type':_0xcdbf('0x6'),'username':_0x3db24f[_0xcdbf('0x7')],'password':_0x3db24f['password']},'json':!![]};return rp(_0x3ed1e1)[_0xcdbf('0x8')](function(_0x3c077d){var _0x409a4e={'method':_0xcdbf('0x3'),'uri':url['resolve'](_0x3db24f[_0xcdbf('0x9')],_0xcdbf('0xa')),'body':{'type':_0x3db24f[_0xcdbf('0xb')]||_0xcdbf('0xc'),'channelId':_0xcdbf('0xd'),'conversation':{'id':_0x3067d8['uniqueid']},'from':{'id':_0x3067d8[_0xcdbf('0xe')],'name':_0x3067d8['calleridname']},'recipient':{'id':_0x3067d8[_0xcdbf('0xf')],'name':_0x3067d8['extension']},'text':_0x3db24f[_0xcdbf('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3c077d[_0xcdbf('0x11')]},'json':!![]};if(_0x3db24f[_0xcdbf('0x12')]){_0x409a4e[_0xcdbf('0x13')]['channelData'][_0xcdbf('0x14')]=_0x3db24f['project'];}if(_0x3db24f[_0xcdbf('0x15')]=='1'){_0x409a4e[_0xcdbf('0x13')][_0xcdbf('0x16')][_0xcdbf('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xcdbf('0x18')};}if(_0x3db24f['custom_action']){_0x409a4e[_0xcdbf('0x13')][_0xcdbf('0x16')][_0xcdbf('0x19')]=_0x3db24f[_0xcdbf('0x1a')];if(_0x3db24f[_0xcdbf('0x1b')]){_0x409a4e[_0xcdbf('0x13')][_0xcdbf('0x16')][_0xcdbf('0x1c')]=_0x3db24f[_0xcdbf('0x1b')];}}logger[_0xcdbf('0x1d')](JSON[_0xcdbf('0x1e')](_0x409a4e));return rp(_0x409a4e);});};