Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / cmList / cmList.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 _0x6ec4=['socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x5e2104,_0x12f596){var _0x473067=function(_0x3e8a53){while(--_0x3e8a53){_0x5e2104['push'](_0x5e2104['shift']());}};_0x473067(++_0x12f596);}(_0x6ec4,0xff));var _0x46ec=function(_0x5c2e44,_0x40309e){_0x5c2e44=_0x5c2e44-0x0;var _0x439c96=_0x6ec4[_0x5c2e44];return _0x439c96;};'use strict';var _=require(_0x46ec('0x0'));var util=require(_0x46ec('0x1'));var moment=require(_0x46ec('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46ec('0x3'));var db=require(_0x46ec('0x4'))['db'];var utils=require(_0x46ec('0x5'));var logger=require(_0x46ec('0x6'))(_0x46ec('0x7'));var config=require(_0x46ec('0x8'));var jayson=require(_0x46ec('0x9'));var client=jayson[_0x46ec('0xa')][_0x46ec('0xb')]({'port':0x232a});config[_0x46ec('0xc')]=_[_0x46ec('0xd')](config[_0x46ec('0xc')],{'host':_0x46ec('0xe'),'port':0x18eb});var socket=require(_0x46ec('0xf'))(new Redis(config[_0x46ec('0xc')]));require(_0x46ec('0x10'))[_0x46ec('0x11')](socket);function respondWithRpcPromise(_0x35a386,_0x54c7b5,_0x205a7a){return new BPromise(function(_0x349aad,_0xf76950){return client[_0x46ec('0x12')](_0x35a386,_0x205a7a)[_0x46ec('0x13')](function(_0xef5384){logger['info'](_0x46ec('0x14'),_0x54c7b5,_0x46ec('0x15'));logger[_0x46ec('0x16')]('CmList,\x20%s,\x20%s,\x20%s',_0x54c7b5,_0x46ec('0x15'),JSON[_0x46ec('0x17')](_0xef5384));if(_0xef5384[_0x46ec('0x18')]){if(_0xef5384[_0x46ec('0x18')][_0x46ec('0x19')]===0x1f4){logger[_0x46ec('0x18')](_0x46ec('0x14'),_0x54c7b5,_0xef5384[_0x46ec('0x18')][_0x46ec('0x1a')]);return _0xf76950(_0xef5384[_0x46ec('0x18')][_0x46ec('0x1a')]);}logger[_0x46ec('0x18')](_0x46ec('0x14'),_0x54c7b5,_0xef5384[_0x46ec('0x18')][_0x46ec('0x1a')]);return _0x349aad(_0xef5384[_0x46ec('0x18')][_0x46ec('0x1a')]);}else{logger[_0x46ec('0x1b')](_0x46ec('0x14'),_0x54c7b5,_0x46ec('0x15'));_0x349aad(_0xef5384[_0x46ec('0x1c')]['message']);}})[_0x46ec('0x1d')](function(_0x2c454d){logger[_0x46ec('0x18')](_0x46ec('0x14'),_0x54c7b5,_0x2c454d);_0xf76950(_0x2c454d);});});}