Built motion from commit c738b9ac.|2.6.25
[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 _0xebaf=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1d801d,_0x2136a1){var _0x4f81ff=function(_0x4bb819){while(--_0x4bb819){_0x1d801d['push'](_0x1d801d['shift']());}};_0x4f81ff(++_0x2136a1);}(_0xebaf,0x1cf));var _0xfeba=function(_0x4ebfa7,_0x23a53f){_0x4ebfa7=_0x4ebfa7-0x0;var _0x3c0a97=_0xebaf[_0x4ebfa7];return _0x3c0a97;};'use strict';var _=require(_0xfeba('0x0'));var util=require(_0xfeba('0x1'));var moment=require(_0xfeba('0x2'));var BPromise=require(_0xfeba('0x3'));var rs=require(_0xfeba('0x4'));var fs=require('fs');var Redis=require(_0xfeba('0x5'));var db=require(_0xfeba('0x6'))['db'];var utils=require(_0xfeba('0x7'));var logger=require('../../config/logger')(_0xfeba('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfeba('0x9')][_0xfeba('0xa')]({'port':0x232a});config[_0xfeba('0xb')]=_[_0xfeba('0xc')](config[_0xfeba('0xb')],{'host':_0xfeba('0xd'),'port':0x18eb});var socket=require(_0xfeba('0xe'))(new Redis(config[_0xfeba('0xb')]));require(_0xfeba('0xf'))['register'](socket);function respondWithRpcPromise(_0x5dc5ea,_0x431e0c,_0x17de00){return new BPromise(function(_0x1fa5ed,_0x222d18){return client[_0xfeba('0x10')](_0x5dc5ea,_0x17de00)[_0xfeba('0x11')](function(_0x57bad3){logger[_0xfeba('0x12')](_0xfeba('0x13'),_0x431e0c,_0xfeba('0x14'));logger[_0xfeba('0x15')](_0xfeba('0x16'),_0x431e0c,'request\x20sent',JSON[_0xfeba('0x17')](_0x57bad3));if(_0x57bad3[_0xfeba('0x18')]){if(_0x57bad3[_0xfeba('0x18')][_0xfeba('0x19')]===0x1f4){logger[_0xfeba('0x18')](_0xfeba('0x13'),_0x431e0c,_0x57bad3[_0xfeba('0x18')]['message']);return _0x222d18(_0x57bad3[_0xfeba('0x18')][_0xfeba('0x1a')]);}logger['error'](_0xfeba('0x13'),_0x431e0c,_0x57bad3['error']['message']);return _0x1fa5ed(_0x57bad3[_0xfeba('0x18')][_0xfeba('0x1a')]);}else{logger[_0xfeba('0x12')](_0xfeba('0x13'),_0x431e0c,'request\x20sent');_0x1fa5ed(_0x57bad3[_0xfeba('0x1b')][_0xfeba('0x1a')]);}})[_0xfeba('0x1c')](function(_0x162228){logger[_0xfeba('0x18')](_0xfeba('0x13'),_0x431e0c,_0x162228);_0x222d18(_0x162228);});});}