Built motion from commit (unavailable).|2.5.27
[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 _0xa6c0=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3e2623,_0x2fb760){var _0xe902e2=function(_0x786565){while(--_0x786565){_0x3e2623['push'](_0x3e2623['shift']());}};_0xe902e2(++_0x2fb760);}(_0xa6c0,0x1b3));var _0x0a6c=function(_0x4ef5fb,_0x51236d){_0x4ef5fb=_0x4ef5fb-0x0;var _0x322b00=_0xa6c0[_0x4ef5fb];return _0x322b00;};'use strict';var _=require('lodash');var util=require(_0x0a6c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0a6c('0x1'));var logger=require(_0x0a6c('0x2'))(_0x0a6c('0x3'));var config=require(_0x0a6c('0x4'));var jayson=require(_0x0a6c('0x5'));var client=jayson[_0x0a6c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x402ad5,_0x117301,_0x5dadb9){return new BPromise(function(_0x514f19,_0x4817e9){return client['request'](_0x402ad5,_0x5dadb9)[_0x0a6c('0x7')](function(_0x2d6009){logger[_0x0a6c('0x8')](_0x0a6c('0x9'),_0x117301,'request\x20sent');logger['debug'](_0x0a6c('0xa'),_0x117301,_0x0a6c('0xb'),JSON['stringify'](_0x2d6009));if(_0x2d6009[_0x0a6c('0xc')]){if(_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xd')]===0x1f4){logger[_0x0a6c('0xc')](_0x0a6c('0x9'),_0x117301,_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);return _0x4817e9(_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);}logger[_0x0a6c('0xc')](_0x0a6c('0x9'),_0x117301,_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);return _0x514f19(_0x2d6009[_0x0a6c('0xc')][_0x0a6c('0xe')]);}else{logger[_0x0a6c('0x8')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x117301,_0x0a6c('0xb'));_0x514f19(_0x2d6009[_0x0a6c('0xf')]['message']);}})[_0x0a6c('0x10')](function(_0x19df1f){logger[_0x0a6c('0xc')](_0x0a6c('0x9'),_0x117301,_0x19df1f);_0x4817e9(_0x19df1f);});});}