Built motion from commit (unavailable).|2.5.20
[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 _0x3bc4=['catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x3bc4,0x1bb));var _0x43bc=function(_0x462832,_0x3c5525){_0x462832=_0x462832-0x0;var _0x33f578=_0x3bc4[_0x462832];return _0x33f578;};'use strict';var _=require('lodash');var util=require(_0x43bc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x43bc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43bc('0x2'))['db'];var utils=require(_0x43bc('0x3'));var logger=require(_0x43bc('0x4'))(_0x43bc('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x43bc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3b6f4b,_0x290549,_0xf18389){return new BPromise(function(_0x31afe7,_0x57eecf){return client['request'](_0x3b6f4b,_0xf18389)['then'](function(_0x2e610e){logger[_0x43bc('0x7')](_0x43bc('0x8'),_0x290549,_0x43bc('0x9'));logger[_0x43bc('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x290549,'request\x20sent',JSON[_0x43bc('0xb')](_0x2e610e));if(_0x2e610e[_0x43bc('0xc')]){if(_0x2e610e[_0x43bc('0xc')][_0x43bc('0xd')]===0x1f4){logger[_0x43bc('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x290549,_0x2e610e[_0x43bc('0xc')][_0x43bc('0xe')]);return _0x57eecf(_0x2e610e[_0x43bc('0xc')][_0x43bc('0xe')]);}logger[_0x43bc('0xc')](_0x43bc('0x8'),_0x290549,_0x2e610e[_0x43bc('0xc')][_0x43bc('0xe')]);return _0x31afe7(_0x2e610e[_0x43bc('0xc')][_0x43bc('0xe')]);}else{logger[_0x43bc('0x7')](_0x43bc('0x8'),_0x290549,_0x43bc('0x9'));_0x31afe7(_0x2e610e[_0x43bc('0xf')][_0x43bc('0xe')]);}})[_0x43bc('0x10')](function(_0x261aff){logger[_0x43bc('0xc')](_0x43bc('0x8'),_0x290549,_0x261aff);_0x57eecf(_0x261aff);});});}