Built motion from commit 97153652.|2.6.26
[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 _0xca76=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x164e76,_0x4446cc){var _0x44e4b4=function(_0xec3ea1){while(--_0xec3ea1){_0x164e76['push'](_0x164e76['shift']());}};_0x44e4b4(++_0x4446cc);}(_0xca76,0x1b5));var _0x6ca7=function(_0x3223d6,_0x590106){_0x3223d6=_0x3223d6-0x0;var _0x294945=_0xca76[_0x3223d6];return _0x294945;};'use strict';var _=require(_0x6ca7('0x0'));var util=require(_0x6ca7('0x1'));var moment=require(_0x6ca7('0x2'));var BPromise=require(_0x6ca7('0x3'));var rs=require(_0x6ca7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ca7('0x5'))['db'];var utils=require(_0x6ca7('0x6'));var logger=require(_0x6ca7('0x7'))(_0x6ca7('0x8'));var config=require(_0x6ca7('0x9'));var jayson=require(_0x6ca7('0xa'));var client=jayson[_0x6ca7('0xb')][_0x6ca7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x110c67,_0xb380e5,_0x4fc5de){return new BPromise(function(_0x664f96,_0x32dad1){return client[_0x6ca7('0xd')](_0x110c67,_0x4fc5de)['then'](function(_0x218e46){logger[_0x6ca7('0xe')](_0x6ca7('0xf'),_0xb380e5,'request\x20sent');logger[_0x6ca7('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0xb380e5,_0x6ca7('0x11'),JSON[_0x6ca7('0x12')](_0x218e46));if(_0x218e46[_0x6ca7('0x13')]){if(_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x14')]===0x1f4){logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);return _0x32dad1(_0x218e46[_0x6ca7('0x13')]['message']);}logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);return _0x664f96(_0x218e46[_0x6ca7('0x13')][_0x6ca7('0x15')]);}else{logger[_0x6ca7('0xe')](_0x6ca7('0xf'),_0xb380e5,_0x6ca7('0x11'));_0x664f96(_0x218e46[_0x6ca7('0x16')][_0x6ca7('0x15')]);}})['catch'](function(_0x3b9418){logger[_0x6ca7('0x13')](_0x6ca7('0xf'),_0xb380e5,_0x3b9418);_0x32dad1(_0x3b9418);});});}