Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / userVoiceQueue / userVoiceQueue.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 _0x5886=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','stringify','error','code','message','UserVoiceQueue,\x20%s,\x20%s','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x5886,0x79));var _0x6588=function(_0xe5af66,_0x272674){_0xe5af66=_0xe5af66-0x0;var _0x3c3105=_0x5886[_0xe5af66];return _0x3c3105;};'use strict';var _=require(_0x6588('0x0'));var util=require('util');var moment=require(_0x6588('0x1'));var BPromise=require('bluebird');var rs=require(_0x6588('0x2'));var fs=require('fs');var Redis=require(_0x6588('0x3'));var db=require(_0x6588('0x4'))['db'];var utils=require(_0x6588('0x5'));var logger=require(_0x6588('0x6'))(_0x6588('0x7'));var config=require(_0x6588('0x8'));var jayson=require(_0x6588('0x9'));var client=jayson[_0x6588('0xa')][_0x6588('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d004d,_0x1a458b,_0x5e6de3){return new BPromise(function(_0x580043,_0x272386){return client[_0x6588('0xc')](_0x1d004d,_0x5e6de3)['then'](function(_0x109779){logger[_0x6588('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1a458b,'request\x20sent');logger[_0x6588('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1a458b,_0x6588('0xf'),JSON[_0x6588('0x10')](_0x109779));if(_0x109779[_0x6588('0x11')]){if(_0x109779[_0x6588('0x11')][_0x6588('0x12')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1a458b,_0x109779[_0x6588('0x11')][_0x6588('0x13')]);return _0x272386(_0x109779[_0x6588('0x11')][_0x6588('0x13')]);}logger[_0x6588('0x11')](_0x6588('0x14'),_0x1a458b,_0x109779['error']['message']);return _0x580043(_0x109779[_0x6588('0x11')]['message']);}else{logger[_0x6588('0xd')](_0x6588('0x14'),_0x1a458b,_0x6588('0xf'));_0x580043(_0x109779['result'][_0x6588('0x13')]);}})['catch'](function(_0x56dd25){logger['error'](_0x6588('0x14'),_0x1a458b,_0x56dd25);_0x272386(_0x56dd25);});});}