Built motion from commit (unavailable).|2.4.4
[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 _0x5e9c=['request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0x27d42c,_0x27c2f7){var _0x344904=function(_0x592450){while(--_0x592450){_0x27d42c['push'](_0x27d42c['shift']());}};_0x344904(++_0x27c2f7);}(_0x5e9c,0x15c));var _0xc5e9=function(_0x5f3c80,_0x187686){_0x5f3c80=_0x5f3c80-0x0;var _0x38fff7=_0x5e9c[_0x5f3c80];return _0x38fff7;};'use strict';var _=require(_0xc5e9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc5e9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5e9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5e9('0x3'));var logger=require(_0xc5e9('0x4'))(_0xc5e9('0x5'));var config=require(_0xc5e9('0x6'));var jayson=require(_0xc5e9('0x7'));var client=jayson[_0xc5e9('0x8')][_0xc5e9('0x9')]({'port':0x232a});config[_0xc5e9('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc5e9('0xb'))(new Redis(config[_0xc5e9('0xa')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x28fbca,_0x323fa7,_0x18cdc4){return new BPromise(function(_0x2c1b59,_0x5c1da0){return client[_0xc5e9('0xc')](_0x28fbca,_0x18cdc4)[_0xc5e9('0xd')](function(_0x11f538){logger[_0xc5e9('0xe')](_0xc5e9('0xf'),_0x323fa7,_0xc5e9('0x10'));logger[_0xc5e9('0x11')](_0xc5e9('0x12'),_0x323fa7,'request\x20sent',JSON[_0xc5e9('0x13')](_0x11f538));if(_0x11f538[_0xc5e9('0x14')]){if(_0x11f538[_0xc5e9('0x14')][_0xc5e9('0x15')]===0x1f4){logger[_0xc5e9('0x14')]('CmList,\x20%s,\x20%s',_0x323fa7,_0x11f538[_0xc5e9('0x14')][_0xc5e9('0x16')]);return _0x5c1da0(_0x11f538[_0xc5e9('0x14')][_0xc5e9('0x16')]);}logger['error'](_0xc5e9('0xf'),_0x323fa7,_0x11f538[_0xc5e9('0x14')][_0xc5e9('0x16')]);return _0x2c1b59(_0x11f538[_0xc5e9('0x14')][_0xc5e9('0x16')]);}else{logger[_0xc5e9('0xe')]('CmList,\x20%s,\x20%s',_0x323fa7,_0xc5e9('0x10'));_0x2c1b59(_0x11f538[_0xc5e9('0x17')][_0xc5e9('0x16')]);}})['catch'](function(_0x133c40){logger[_0xc5e9('0x14')](_0xc5e9('0xf'),_0x323fa7,_0x133c40);_0x5c1da0(_0x133c40);});});}