Built motion from commit (unavailable).|2.5.30
[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 _0x7cde=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','bluebird','randomstring','ioredis'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0x7cde,0x66));var _0xe7cd=function(_0x3fcdd4,_0x341d69){_0x3fcdd4=_0x3fcdd4-0x0;var _0x4374ed=_0x7cde[_0x3fcdd4];return _0x4374ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe7cd('0x0'));var rs=require(_0xe7cd('0x1'));var fs=require('fs');var Redis=require(_0xe7cd('0x2'));var db=require(_0xe7cd('0x3'))['db'];var utils=require(_0xe7cd('0x4'));var logger=require(_0xe7cd('0x5'))(_0xe7cd('0x6'));var config=require(_0xe7cd('0x7'));var jayson=require(_0xe7cd('0x8'));var client=jayson['client'][_0xe7cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1643c8,_0x24776b,_0x33dcb7){return new BPromise(function(_0x4b0a27,_0x21b281){return client[_0xe7cd('0xa')](_0x1643c8,_0x33dcb7)['then'](function(_0x285dc7){logger[_0xe7cd('0xb')](_0xe7cd('0xc'),_0x24776b,_0xe7cd('0xd'));logger[_0xe7cd('0xe')](_0xe7cd('0xf'),_0x24776b,'request\x20sent',JSON[_0xe7cd('0x10')](_0x285dc7));if(_0x285dc7[_0xe7cd('0x11')]){if(_0x285dc7['error']['code']===0x1f4){logger[_0xe7cd('0x11')](_0xe7cd('0xc'),_0x24776b,_0x285dc7[_0xe7cd('0x11')][_0xe7cd('0x12')]);return _0x21b281(_0x285dc7[_0xe7cd('0x11')][_0xe7cd('0x12')]);}logger['error'](_0xe7cd('0xc'),_0x24776b,_0x285dc7[_0xe7cd('0x11')][_0xe7cd('0x12')]);return _0x4b0a27(_0x285dc7[_0xe7cd('0x11')][_0xe7cd('0x12')]);}else{logger['info'](_0xe7cd('0xc'),_0x24776b,_0xe7cd('0xd'));_0x4b0a27(_0x285dc7[_0xe7cd('0x13')][_0xe7cd('0x12')]);}})[_0xe7cd('0x14')](function(_0xa44a52){logger[_0xe7cd('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x24776b,_0xa44a52);_0x21b281(_0xa44a52);});});}