Built motion from commit 67e5df37.|2.0.68
[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 _0x6d82=['socket.io-emitter','localhost','./cmList.socket','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x278025,_0x25e313){var _0x1fea6c=function(_0x4e71a8){while(--_0x4e71a8){_0x278025['push'](_0x278025['shift']());}};_0x1fea6c(++_0x25e313);}(_0x6d82,0x10b));var _0x26d8=function(_0x3cbfe9,_0x36fe84){_0x3cbfe9=_0x3cbfe9-0x0;var _0x5bb130=_0x6d82[_0x3cbfe9];return _0x5bb130;};'use strict';var _=require(_0x26d8('0x0'));var util=require(_0x26d8('0x1'));var moment=require(_0x26d8('0x2'));var BPromise=require(_0x26d8('0x3'));var rs=require(_0x26d8('0x4'));var fs=require('fs');var db=require(_0x26d8('0x5'))['db'];var utils=require(_0x26d8('0x6'));var logger=require(_0x26d8('0x7'))(_0x26d8('0x8'));var config=require(_0x26d8('0x9'));var jayson=require(_0x26d8('0xa'));var client=jayson[_0x26d8('0xb')][_0x26d8('0xc')]({'port':0x232a});var socket=require(_0x26d8('0xd'))({'host':_0x26d8('0xe'),'port':0x18eb});require(_0x26d8('0xf'))['register'](socket);function respondWithRpcPromise(_0x29ebdb,_0x40c472,_0x99ee24){return new BPromise(function(_0x1550e8,_0x52a30f){return client[_0x26d8('0x10')](_0x29ebdb,_0x99ee24)[_0x26d8('0x11')](function(_0x35d087){logger[_0x26d8('0x12')]('CmList,\x20%s,\x20%s',_0x40c472,_0x26d8('0x13'));logger[_0x26d8('0x14')](_0x26d8('0x15'),_0x40c472,_0x26d8('0x13'),JSON[_0x26d8('0x16')](_0x35d087));if(_0x35d087[_0x26d8('0x17')]){if(_0x35d087[_0x26d8('0x17')][_0x26d8('0x18')]===0x1f4){logger[_0x26d8('0x17')](_0x26d8('0x19'),_0x40c472,_0x35d087[_0x26d8('0x17')][_0x26d8('0x1a')]);return _0x52a30f(_0x35d087[_0x26d8('0x17')][_0x26d8('0x1a')]);}logger['error'](_0x26d8('0x19'),_0x40c472,_0x35d087['error'][_0x26d8('0x1a')]);return _0x1550e8(_0x35d087[_0x26d8('0x17')][_0x26d8('0x1a')]);}else{logger[_0x26d8('0x12')]('CmList,\x20%s,\x20%s',_0x40c472,'request\x20sent');_0x1550e8(_0x35d087[_0x26d8('0x1b')][_0x26d8('0x1a')]);}})['catch'](function(_0x2181e5){logger[_0x26d8('0x17')](_0x26d8('0x19'),_0x40c472,_0x2181e5);_0x52a30f(_0x2181e5);});});}