Built motion from commit d1eab355.|2.6.28
[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 _0x223f=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1281d5,_0x3cc8b6){var _0x1d8818=function(_0x4345be){while(--_0x4345be){_0x1281d5['push'](_0x1281d5['shift']());}};_0x1d8818(++_0x3cc8b6);}(_0x223f,0xd6));var _0xf223=function(_0xab1d93,_0x1c4431){_0xab1d93=_0xab1d93-0x0;var _0x5513c6=_0x223f[_0xab1d93];return _0x5513c6;};'use strict';var _=require(_0xf223('0x0'));var util=require(_0xf223('0x1'));var moment=require(_0xf223('0x2'));var BPromise=require('bluebird');var rs=require(_0xf223('0x3'));var fs=require('fs');var Redis=require(_0xf223('0x4'));var db=require(_0xf223('0x5'))['db'];var utils=require(_0xf223('0x6'));var logger=require(_0xf223('0x7'))(_0xf223('0x8'));var config=require('../../config/environment');var jayson=require(_0xf223('0x9'));var client=jayson[_0xf223('0xa')][_0xf223('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x441970,_0x6cbdb,_0x2204de){return new BPromise(function(_0xcbab8,_0x3318a7){return client['request'](_0x441970,_0x2204de)[_0xf223('0xc')](function(_0x3c6390){logger[_0xf223('0xd')](_0xf223('0xe'),_0x6cbdb,_0xf223('0xf'));logger[_0xf223('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x6cbdb,_0xf223('0xf'),JSON['stringify'](_0x3c6390));if(_0x3c6390[_0xf223('0x11')]){if(_0x3c6390[_0xf223('0x11')][_0xf223('0x12')]===0x1f4){logger[_0xf223('0x11')](_0xf223('0xe'),_0x6cbdb,_0x3c6390[_0xf223('0x11')][_0xf223('0x13')]);return _0x3318a7(_0x3c6390[_0xf223('0x11')][_0xf223('0x13')]);}logger['error'](_0xf223('0xe'),_0x6cbdb,_0x3c6390[_0xf223('0x11')][_0xf223('0x13')]);return _0xcbab8(_0x3c6390[_0xf223('0x11')]['message']);}else{logger[_0xf223('0xd')](_0xf223('0xe'),_0x6cbdb,_0xf223('0xf'));_0xcbab8(_0x3c6390[_0xf223('0x14')][_0xf223('0x13')]);}})[_0xf223('0x15')](function(_0x616ed2){logger[_0xf223('0x11')](_0xf223('0xe'),_0x6cbdb,_0x616ed2);_0x3318a7(_0x616ed2);});});}