Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / userOpenchannelQueue / userOpenchannelQueue.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 _0xfe29=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xfe29,0x16e));var _0x9fe2=function(_0x292cb5,_0x173d59){_0x292cb5=_0x292cb5-0x0;var _0x16c043=_0xfe29[_0x292cb5];return _0x16c043;};'use strict';var _=require('lodash');var util=require(_0x9fe2('0x0'));var moment=require(_0x9fe2('0x1'));var BPromise=require(_0x9fe2('0x2'));var rs=require(_0x9fe2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fe2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9fe2('0x5'))(_0x9fe2('0x6'));var config=require(_0x9fe2('0x7'));var jayson=require(_0x9fe2('0x8'));var client=jayson['client'][_0x9fe2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7c3d,_0x427733,_0xac5c31){return new BPromise(function(_0x2bf1a9,_0x5ee248){return client['request'](_0x5d7c3d,_0xac5c31)[_0x9fe2('0xa')](function(_0x198ec6){logger[_0x9fe2('0xb')](_0x9fe2('0xc'),_0x427733,_0x9fe2('0xd'));logger[_0x9fe2('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x427733,_0x9fe2('0xd'),JSON[_0x9fe2('0xf')](_0x198ec6));if(_0x198ec6[_0x9fe2('0x10')]){if(_0x198ec6[_0x9fe2('0x10')][_0x9fe2('0x11')]===0x1f4){logger[_0x9fe2('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x427733,_0x198ec6[_0x9fe2('0x10')]['message']);return _0x5ee248(_0x198ec6['error'][_0x9fe2('0x12')]);}logger[_0x9fe2('0x10')](_0x9fe2('0xc'),_0x427733,_0x198ec6[_0x9fe2('0x10')][_0x9fe2('0x12')]);return _0x2bf1a9(_0x198ec6[_0x9fe2('0x10')]['message']);}else{logger['info'](_0x9fe2('0xc'),_0x427733,_0x9fe2('0xd'));_0x2bf1a9(_0x198ec6[_0x9fe2('0x13')][_0x9fe2('0x12')]);}})[_0x9fe2('0x14')](function(_0x5e4910){logger[_0x9fe2('0x10')](_0x9fe2('0xc'),_0x427733,_0x5e4910);_0x5ee248(_0x5e4910);});});}