Built motion from commit 1fd437e9.|2.6.19
[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 _0x1d4c=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result'];(function(_0xfca425,_0x2950d6){var _0x44ea89=function(_0x5c0db6){while(--_0x5c0db6){_0xfca425['push'](_0xfca425['shift']());}};_0x44ea89(++_0x2950d6);}(_0x1d4c,0x70));var _0xc1d4=function(_0x6224f4,_0x3524c5){_0x6224f4=_0x6224f4-0x0;var _0x2e9bef=_0x1d4c[_0x6224f4];return _0x2e9bef;};'use strict';var _=require(_0xc1d4('0x0'));var util=require(_0xc1d4('0x1'));var moment=require('moment');var BPromise=require(_0xc1d4('0x2'));var rs=require(_0xc1d4('0x3'));var fs=require('fs');var Redis=require(_0xc1d4('0x4'));var db=require(_0xc1d4('0x5'))['db'];var utils=require(_0xc1d4('0x6'));var logger=require(_0xc1d4('0x7'))(_0xc1d4('0x8'));var config=require(_0xc1d4('0x9'));var jayson=require(_0xc1d4('0xa'));var client=jayson['client'][_0xc1d4('0xb')]({'port':0x232a});config[_0xc1d4('0xc')]=_[_0xc1d4('0xd')](config[_0xc1d4('0xc')],{'host':_0xc1d4('0xe'),'port':0x18eb});var socket=require(_0xc1d4('0xf'))(new Redis(config[_0xc1d4('0xc')]));require(_0xc1d4('0x10'))[_0xc1d4('0x11')](socket);function respondWithRpcPromise(_0x152d22,_0x33293c,_0x5bdeb5){return new BPromise(function(_0x5342ab,_0x31f389){return client['request'](_0x152d22,_0x5bdeb5)[_0xc1d4('0x12')](function(_0x49924b){logger['info']('CmList,\x20%s,\x20%s',_0x33293c,_0xc1d4('0x13'));logger['debug'](_0xc1d4('0x14'),_0x33293c,'request\x20sent',JSON[_0xc1d4('0x15')](_0x49924b));if(_0x49924b['error']){if(_0x49924b[_0xc1d4('0x16')][_0xc1d4('0x17')]===0x1f4){logger[_0xc1d4('0x16')](_0xc1d4('0x18'),_0x33293c,_0x49924b[_0xc1d4('0x16')][_0xc1d4('0x19')]);return _0x31f389(_0x49924b['error'][_0xc1d4('0x19')]);}logger[_0xc1d4('0x16')](_0xc1d4('0x18'),_0x33293c,_0x49924b[_0xc1d4('0x16')][_0xc1d4('0x19')]);return _0x5342ab(_0x49924b[_0xc1d4('0x16')][_0xc1d4('0x19')]);}else{logger[_0xc1d4('0x1a')]('CmList,\x20%s,\x20%s',_0x33293c,'request\x20sent');_0x5342ab(_0x49924b[_0xc1d4('0x1b')][_0xc1d4('0x19')]);}})['catch'](function(_0x15ad25){logger[_0xc1d4('0x16')](_0xc1d4('0x18'),_0x33293c,_0x15ad25);_0x31f389(_0x15ad25);});});}