Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / services / agi / scripts / sestek / nda / index.js
1 'use strict';const a1235_0x9f16=['2001461vbCbMq','110189Rabzrm','CustomActionData','ndauth_url','1mfxiRa','channelData','URL','extension','username','608581zDzUzT','info','18974uBgmWQ','209609ZXWgrI','custom_action','uniqueid','CustomAction','project','audio/wav','stringify','dnid','custom_action_data','Nda','/api/NaturalDialogAssistant/v1/Run','message','4wEflzw','body','AudioOutputSettings','password','89992uwqylT','callerid','ProjectName','1NwqvyI','request-promise-native','1lSpmyz','Bearer\x20','POST','72055fwdBwS','toString','/token','then','ndassistant_url'];const a1235_0x15d8=function(_0x52ab25,_0x4e42ef){_0x52ab25=_0x52ab25-0x1c0;let _0x9f168c=a1235_0x9f16[_0x52ab25];return _0x9f168c;};const a1235_0x5cbdd5=a1235_0x15d8;(function(_0x1fa289,_0x169e58){const _0x141b65=a1235_0x15d8;while(!![]){try{const _0x170d36=parseInt(_0x141b65(0x1ce))+-parseInt(_0x141b65(0x1e6))+parseInt(_0x141b65(0x1df))*-parseInt(_0x141b65(0x1e4))+-parseInt(_0x141b65(0x1d6))*parseInt(_0x141b65(0x1d1))+parseInt(_0x141b65(0x1d3))*-parseInt(_0x141b65(0x1dc))+-parseInt(_0x141b65(0x1ca))*parseInt(_0x141b65(0x1e7))+parseInt(_0x141b65(0x1db));if(_0x170d36===_0x169e58)break;else _0x1fa289['push'](_0x1fa289['shift']());}catch(_0x4f6c69){_0x1fa289['push'](_0x1fa289['shift']());}}}(a1235_0x9f16,0x6c352));const rp=require(a1235_0x5cbdd5(0x1d2)),url=require('url'),logger=require('@config/logger')('agi');module['exports']=function(_0x1f8064,_0x4e2317){const _0x267a37=a1235_0x5cbdd5,_0x18b797=new url[(_0x267a37(0x1e1))](_0x267a37(0x1d8),_0x4e2317[_0x267a37(0x1de)])[_0x267a37(0x1d7)](),_0x5c0135={'method':_0x267a37(0x1d5),'uri':_0x18b797,'form':{'grant_type':_0x267a37(0x1cd),'username':_0x4e2317[_0x267a37(0x1e3)],'password':_0x4e2317[_0x267a37(0x1cd)]},'json':!![]};return rp(_0x5c0135)[_0x267a37(0x1d9)](function(_0x3f1345){const _0x2c5854=_0x267a37,_0x4fc99c=new url[(_0x2c5854(0x1e1))](_0x2c5854(0x1c8),_0x4e2317[_0x2c5854(0x1da)])['toString'](),_0x44327a={'method':_0x2c5854(0x1d5),'uri':_0x4fc99c,'body':{'type':_0x4e2317['ndaactivity_type']||_0x2c5854(0x1c9),'channelId':_0x2c5854(0x1c7),'conversation':{'id':_0x1f8064[_0x2c5854(0x1c0)]},'from':{'id':_0x1f8064[_0x2c5854(0x1cf)],'name':_0x1f8064['calleridname']},'recipient':{'id':_0x1f8064[_0x2c5854(0x1c5)],'name':_0x1f8064[_0x2c5854(0x1e2)]},'text':_0x4e2317['text'],'channelData':{}},'headers':{'Authorization':_0x2c5854(0x1d4)+_0x3f1345['access_token']},'json':!![]};return _0x4e2317[_0x2c5854(0x1c2)]&&(_0x44327a[_0x2c5854(0x1cb)]['channelData'][_0x2c5854(0x1d0)]=_0x4e2317['project']),_0x4e2317['ndagenerate_audio']=='1'&&(_0x44327a[_0x2c5854(0x1cb)][_0x2c5854(0x1e0)][_0x2c5854(0x1cc)]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2c5854(0x1c3)}),_0x4e2317[_0x2c5854(0x1e8)]&&(_0x44327a['body']['channelData'][_0x2c5854(0x1c1)]=_0x4e2317[_0x2c5854(0x1e8)],_0x4e2317[_0x2c5854(0x1c6)]&&(_0x44327a['body'][_0x2c5854(0x1e0)][_0x2c5854(0x1dd)]=_0x4e2317['custom_action_data'])),logger[_0x2c5854(0x1e5)](JSON[_0x2c5854(0x1c4)](_0x44327a)),rp(_0x44327a);});};