Built motion from commit (unavailable).|2.5.10
[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 _0xe253=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xe253,0x15a));var _0x3e25=function(_0x3eedcd,_0x27f234){_0x3eedcd=_0x3eedcd-0x0;var _0x221be1=_0xe253[_0x3eedcd];return _0x221be1;};'use strict';var _=require(_0x3e25('0x0'));var util=require(_0x3e25('0x1'));var moment=require(_0x3e25('0x2'));var BPromise=require(_0x3e25('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e25('0x4'));var db=require(_0x3e25('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e25('0x6'))(_0x3e25('0x7'));var config=require(_0x3e25('0x8'));var jayson=require(_0x3e25('0x9'));var client=jayson[_0x3e25('0xa')][_0x3e25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3efbfe,_0x2115ed,_0x2e9882){return new BPromise(function(_0x58d7b4,_0x1b65cd){return client[_0x3e25('0xc')](_0x3efbfe,_0x2e9882)['then'](function(_0x97012e){logger[_0x3e25('0xd')](_0x3e25('0xe'),_0x2115ed,_0x3e25('0xf'));logger[_0x3e25('0x10')](_0x3e25('0x11'),_0x2115ed,_0x3e25('0xf'),JSON['stringify'](_0x97012e));if(_0x97012e[_0x3e25('0x12')]){if(_0x97012e[_0x3e25('0x12')][_0x3e25('0x13')]===0x1f4){logger[_0x3e25('0x12')](_0x3e25('0xe'),_0x2115ed,_0x97012e[_0x3e25('0x12')][_0x3e25('0x14')]);return _0x1b65cd(_0x97012e['error'][_0x3e25('0x14')]);}logger[_0x3e25('0x12')](_0x3e25('0xe'),_0x2115ed,_0x97012e[_0x3e25('0x12')][_0x3e25('0x14')]);return _0x58d7b4(_0x97012e['error']['message']);}else{logger[_0x3e25('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2115ed,'request\x20sent');_0x58d7b4(_0x97012e[_0x3e25('0x15')][_0x3e25('0x14')]);}})['catch'](function(_0xbbc83f){logger[_0x3e25('0x12')](_0x3e25('0xe'),_0x2115ed,_0xbbc83f);_0x1b65cd(_0xbbc83f);});});}