Built motion from commit b5413ace.|2.6.9
[motion2.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.rpc.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 _0x0c6f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x371704,_0x13d301){var _0xfc3801=function(_0x169966){while(--_0x169966){_0x371704['push'](_0x371704['shift']());}};_0xfc3801(++_0x13d301);}(_0x0c6f,0x10e));var _0xf0c6=function(_0x279e8e,_0x352889){_0x279e8e=_0x279e8e-0x0;var _0x45816d=_0x0c6f[_0x279e8e];return _0x45816d;};'use strict';var _=require(_0xf0c6('0x0'));var util=require('util');var moment=require(_0xf0c6('0x1'));var BPromise=require(_0xf0c6('0x2'));var rs=require(_0xf0c6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0c6('0x4'))['db'];var utils=require(_0xf0c6('0x5'));var logger=require(_0xf0c6('0x6'))(_0xf0c6('0x7'));var config=require(_0xf0c6('0x8'));var jayson=require(_0xf0c6('0x9'));var client=jayson[_0xf0c6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x468f04,_0x58dc3d,_0x3b4a00){return new BPromise(function(_0x74d9cd,_0x1bb637){return client[_0xf0c6('0xb')](_0x468f04,_0x3b4a00)[_0xf0c6('0xc')](function(_0x59d72a){logger['info'](_0xf0c6('0xd'),_0x58dc3d,_0xf0c6('0xe'));logger[_0xf0c6('0xf')](_0xf0c6('0x10'),_0x58dc3d,_0xf0c6('0xe'),JSON[_0xf0c6('0x11')](_0x59d72a));if(_0x59d72a['error']){if(_0x59d72a[_0xf0c6('0x12')]['code']===0x1f4){logger[_0xf0c6('0x12')](_0xf0c6('0xd'),_0x58dc3d,_0x59d72a[_0xf0c6('0x12')][_0xf0c6('0x13')]);return _0x1bb637(_0x59d72a['error'][_0xf0c6('0x13')]);}logger['error'](_0xf0c6('0xd'),_0x58dc3d,_0x59d72a[_0xf0c6('0x12')][_0xf0c6('0x13')]);return _0x74d9cd(_0x59d72a[_0xf0c6('0x12')][_0xf0c6('0x13')]);}else{logger[_0xf0c6('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x58dc3d,_0xf0c6('0xe'));_0x74d9cd(_0x59d72a[_0xf0c6('0x15')]['message']);}})[_0xf0c6('0x16')](function(_0x480595){logger[_0xf0c6('0x12')](_0xf0c6('0xd'),_0x58dc3d,_0x480595);_0x1bb637(_0x480595);});});}