Built motion from commit 746c7d2a.|2.5.35
[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 _0x6169=['../../config/environment','jayson/promise','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6169,0x115));var _0x9616=function(_0xa7d27,_0x1f30e2){_0xa7d27=_0xa7d27-0x0;var _0x1d1cd2=_0x6169[_0xa7d27];return _0x1d1cd2;};'use strict';var _=require(_0x9616('0x0'));var util=require(_0x9616('0x1'));var moment=require(_0x9616('0x2'));var BPromise=require(_0x9616('0x3'));var rs=require(_0x9616('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9616('0x5'))['db'];var utils=require(_0x9616('0x6'));var logger=require(_0x9616('0x7'))(_0x9616('0x8'));var config=require(_0x9616('0x9'));var jayson=require(_0x9616('0xa'));var client=jayson[_0x9616('0xb')][_0x9616('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x518771,_0x451522,_0x385231){return new BPromise(function(_0x5136ec,_0x524f1a){return client[_0x9616('0xd')](_0x518771,_0x385231)[_0x9616('0xe')](function(_0x1190ff){logger['info'](_0x9616('0xf'),_0x451522,_0x9616('0x10'));logger[_0x9616('0x11')](_0x9616('0x12'),_0x451522,_0x9616('0x10'),JSON[_0x9616('0x13')](_0x1190ff));if(_0x1190ff[_0x9616('0x14')]){if(_0x1190ff[_0x9616('0x14')][_0x9616('0x15')]===0x1f4){logger[_0x9616('0x14')](_0x9616('0xf'),_0x451522,_0x1190ff[_0x9616('0x14')][_0x9616('0x16')]);return _0x524f1a(_0x1190ff['error'][_0x9616('0x16')]);}logger[_0x9616('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x451522,_0x1190ff[_0x9616('0x14')][_0x9616('0x16')]);return _0x5136ec(_0x1190ff[_0x9616('0x14')][_0x9616('0x16')]);}else{logger[_0x9616('0x17')](_0x9616('0xf'),_0x451522,_0x9616('0x10'));_0x5136ec(_0x1190ff[_0x9616('0x18')]['message']);}})[_0x9616('0x19')](function(_0x44fa64){logger['error'](_0x9616('0xf'),_0x451522,_0x44fa64);_0x524f1a(_0x44fa64);});});}