Built motion from commit (unavailable).|2.5.23
[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 _0xf8bb=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error'];(function(_0x40e00e,_0xe3ddfa){var _0x1050de=function(_0x4e15af){while(--_0x4e15af){_0x40e00e['push'](_0x40e00e['shift']());}};_0x1050de(++_0xe3ddfa);}(_0xf8bb,0x1cf));var _0xbf8b=function(_0x3a128c,_0x27c240){_0x3a128c=_0x3a128c-0x0;var _0x45f7d2=_0xf8bb[_0x3a128c];return _0x45f7d2;};'use strict';var _=require(_0xbf8b('0x0'));var util=require('util');var moment=require(_0xbf8b('0x1'));var BPromise=require(_0xbf8b('0x2'));var rs=require(_0xbf8b('0x3'));var fs=require('fs');var Redis=require(_0xbf8b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf8b('0x5'));var logger=require(_0xbf8b('0x6'))(_0xbf8b('0x7'));var config=require(_0xbf8b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf8b('0x9')][_0xbf8b('0xa')]({'port':0x232a});config[_0xbf8b('0xb')]=_[_0xbf8b('0xc')](config[_0xbf8b('0xb')],{'host':_0xbf8b('0xd'),'port':0x18eb});var socket=require(_0xbf8b('0xe'))(new Redis(config['redis']));require(_0xbf8b('0xf'))[_0xbf8b('0x10')](socket);function respondWithRpcPromise(_0x37a255,_0x3d0407,_0x503507){return new BPromise(function(_0x55edb6,_0x5ad4c1){return client[_0xbf8b('0x11')](_0x37a255,_0x503507)[_0xbf8b('0x12')](function(_0x3c12e3){logger['info'](_0xbf8b('0x13'),_0x3d0407,_0xbf8b('0x14'));logger['debug'](_0xbf8b('0x15'),_0x3d0407,'request\x20sent',JSON['stringify'](_0x3c12e3));if(_0x3c12e3[_0xbf8b('0x16')]){if(_0x3c12e3[_0xbf8b('0x16')][_0xbf8b('0x17')]===0x1f4){logger[_0xbf8b('0x16')](_0xbf8b('0x13'),_0x3d0407,_0x3c12e3['error'][_0xbf8b('0x18')]);return _0x5ad4c1(_0x3c12e3[_0xbf8b('0x16')][_0xbf8b('0x18')]);}logger[_0xbf8b('0x16')](_0xbf8b('0x13'),_0x3d0407,_0x3c12e3[_0xbf8b('0x16')][_0xbf8b('0x18')]);return _0x55edb6(_0x3c12e3[_0xbf8b('0x16')]['message']);}else{logger['info'](_0xbf8b('0x13'),_0x3d0407,'request\x20sent');_0x55edb6(_0x3c12e3[_0xbf8b('0x19')][_0xbf8b('0x18')]);}})[_0xbf8b('0x1a')](function(_0x7fb30a){logger[_0xbf8b('0x16')]('CmList,\x20%s,\x20%s',_0x3d0407,_0x7fb30a);_0x5ad4c1(_0x7fb30a);});});}