Built motion from commit 0900f080.|2.5.45
[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 _0x7c55=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x57c662,_0x2c9ffe){var _0x216916=function(_0x357ee8){while(--_0x357ee8){_0x57c662['push'](_0x57c662['shift']());}};_0x216916(++_0x2c9ffe);}(_0x7c55,0x19a));var _0x57c5=function(_0x5d6e81,_0x3766c1){_0x5d6e81=_0x5d6e81-0x0;var _0x407a46=_0x7c55[_0x5d6e81];return _0x407a46;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x57c5('0x0'));var BPromise=require(_0x57c5('0x1'));var rs=require(_0x57c5('0x2'));var fs=require('fs');var Redis=require(_0x57c5('0x3'));var db=require(_0x57c5('0x4'))['db'];var utils=require(_0x57c5('0x5'));var logger=require(_0x57c5('0x6'))(_0x57c5('0x7'));var config=require(_0x57c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x57c5('0x9')][_0x57c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x516265,_0xf8f9c5,_0x124da8){return new BPromise(function(_0x31470b,_0x55437e){return client[_0x57c5('0xb')](_0x516265,_0x124da8)[_0x57c5('0xc')](function(_0x46d648){logger[_0x57c5('0xd')](_0x57c5('0xe'),_0xf8f9c5,'request\x20sent');logger[_0x57c5('0xf')](_0x57c5('0x10'),_0xf8f9c5,_0x57c5('0x11'),JSON[_0x57c5('0x12')](_0x46d648));if(_0x46d648[_0x57c5('0x13')]){if(_0x46d648[_0x57c5('0x13')][_0x57c5('0x14')]===0x1f4){logger[_0x57c5('0x13')](_0x57c5('0xe'),_0xf8f9c5,_0x46d648['error']['message']);return _0x55437e(_0x46d648[_0x57c5('0x13')][_0x57c5('0x15')]);}logger['error'](_0x57c5('0xe'),_0xf8f9c5,_0x46d648['error'][_0x57c5('0x15')]);return _0x31470b(_0x46d648[_0x57c5('0x13')][_0x57c5('0x15')]);}else{logger[_0x57c5('0xd')](_0x57c5('0xe'),_0xf8f9c5,_0x57c5('0x11'));_0x31470b(_0x46d648[_0x57c5('0x16')][_0x57c5('0x15')]);}})[_0x57c5('0x17')](function(_0x253a93){logger[_0x57c5('0x13')](_0x57c5('0xe'),_0xf8f9c5,_0x253a93);_0x55437e(_0x253a93);});});}