Built motion from commit (unavailable).|2.5.21
[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 _0xbb49=['code','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xbb49,0x135));var _0x9bb4=function(_0x48a379,_0x1a2d2e){_0x48a379=_0x48a379-0x0;var _0x5220ac=_0xbb49[_0x48a379];return _0x5220ac;};'use strict';var _=require(_0x9bb4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9bb4('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb4('0x2'));var db=require(_0x9bb4('0x3'))['db'];var utils=require(_0x9bb4('0x4'));var logger=require('../../config/logger')(_0x9bb4('0x5'));var config=require(_0x9bb4('0x6'));var jayson=require(_0x9bb4('0x7'));var client=jayson[_0x9bb4('0x8')][_0x9bb4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4780b8,_0x58aa5e,_0x2b6284){return new BPromise(function(_0x20e211,_0x1bff79){return client['request'](_0x4780b8,_0x2b6284)['then'](function(_0x547d9d){logger[_0x9bb4('0xa')](_0x9bb4('0xb'),_0x58aa5e,_0x9bb4('0xc'));logger[_0x9bb4('0xd')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x58aa5e,_0x9bb4('0xc'),JSON['stringify'](_0x547d9d));if(_0x547d9d['error']){if(_0x547d9d['error'][_0x9bb4('0xe')]===0x1f4){logger[_0x9bb4('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x58aa5e,_0x547d9d[_0x9bb4('0xf')][_0x9bb4('0x10')]);return _0x1bff79(_0x547d9d['error'][_0x9bb4('0x10')]);}logger[_0x9bb4('0xf')](_0x9bb4('0xb'),_0x58aa5e,_0x547d9d['error'][_0x9bb4('0x10')]);return _0x20e211(_0x547d9d[_0x9bb4('0xf')]['message']);}else{logger[_0x9bb4('0xa')](_0x9bb4('0xb'),_0x58aa5e,_0x9bb4('0xc'));_0x20e211(_0x547d9d[_0x9bb4('0x11')][_0x9bb4('0x10')]);}})[_0x9bb4('0x12')](function(_0x51c890){logger[_0x9bb4('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x58aa5e,_0x51c890);_0x1bff79(_0x51c890);});});}