Built motion from commit (unavailable).|2.5.4
[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 _0x0fb8=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x19b320,_0x17c4f9){var _0x509fab=function(_0x4362de){while(--_0x4362de){_0x19b320['push'](_0x19b320['shift']());}};_0x509fab(++_0x17c4f9);}(_0x0fb8,0x1d5));var _0x80fb=function(_0x289479,_0x4c742a){_0x289479=_0x289479-0x0;var _0x35fd61=_0x0fb8[_0x289479];return _0x35fd61;};'use strict';var _=require('lodash');var util=require(_0x80fb('0x0'));var moment=require(_0x80fb('0x1'));var BPromise=require(_0x80fb('0x2'));var rs=require(_0x80fb('0x3'));var fs=require('fs');var Redis=require(_0x80fb('0x4'));var db=require(_0x80fb('0x5'))['db'];var utils=require(_0x80fb('0x6'));var logger=require(_0x80fb('0x7'))('rpc');var config=require(_0x80fb('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47875c,_0x1a2f30,_0xa03161){return new BPromise(function(_0x338f84,_0x5c3a8b){return client['request'](_0x47875c,_0xa03161)[_0x80fb('0xa')](function(_0x5c5753){logger[_0x80fb('0xb')](_0x80fb('0xc'),_0x1a2f30,_0x80fb('0xd'));logger[_0x80fb('0xe')](_0x80fb('0xf'),_0x1a2f30,_0x80fb('0xd'),JSON[_0x80fb('0x10')](_0x5c5753));if(_0x5c5753[_0x80fb('0x11')]){if(_0x5c5753[_0x80fb('0x11')][_0x80fb('0x12')]===0x1f4){logger[_0x80fb('0x11')](_0x80fb('0xc'),_0x1a2f30,_0x5c5753[_0x80fb('0x11')][_0x80fb('0x13')]);return _0x5c3a8b(_0x5c5753[_0x80fb('0x11')][_0x80fb('0x13')]);}logger[_0x80fb('0x11')](_0x80fb('0xc'),_0x1a2f30,_0x5c5753[_0x80fb('0x11')]['message']);return _0x338f84(_0x5c5753['error'][_0x80fb('0x13')]);}else{logger['info'](_0x80fb('0xc'),_0x1a2f30,_0x80fb('0xd'));_0x338f84(_0x5c5753[_0x80fb('0x14')][_0x80fb('0x13')]);}})[_0x80fb('0x15')](function(_0x3db79a){logger[_0x80fb('0x11')](_0x80fb('0xc'),_0x1a2f30,_0x3db79a);_0x5c3a8b(_0x3db79a);});});}