Built motion from commit 449495f6.|2.6.27
[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 _0xc9a1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment'];(function(_0x3f6fa3,_0x1b0015){var _0x8be1e4=function(_0x4e68d2){while(--_0x4e68d2){_0x3f6fa3['push'](_0x3f6fa3['shift']());}};_0x8be1e4(++_0x1b0015);}(_0xc9a1,0x18a));var _0x1c9a=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xc9a1[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x1c9a('0x0'));var util=require('util');var moment=require(_0x1c9a('0x1'));var BPromise=require(_0x1c9a('0x2'));var rs=require(_0x1c9a('0x3'));var fs=require('fs');var Redis=require(_0x1c9a('0x4'));var db=require(_0x1c9a('0x5'))['db'];var utils=require(_0x1c9a('0x6'));var logger=require(_0x1c9a('0x7'))('rpc');var config=require(_0x1c9a('0x8'));var jayson=require(_0x1c9a('0x9'));var client=jayson[_0x1c9a('0xa')][_0x1c9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26628c,_0x16d990,_0x5cf3b9){return new BPromise(function(_0x3869d8,_0x5e24da){return client['request'](_0x26628c,_0x5cf3b9)[_0x1c9a('0xc')](function(_0x55f90c){logger[_0x1c9a('0xd')](_0x1c9a('0xe'),_0x16d990,_0x1c9a('0xf'));logger['debug'](_0x1c9a('0x10'),_0x16d990,_0x1c9a('0xf'),JSON[_0x1c9a('0x11')](_0x55f90c));if(_0x55f90c[_0x1c9a('0x12')]){if(_0x55f90c[_0x1c9a('0x12')]['code']===0x1f4){logger['error'](_0x1c9a('0xe'),_0x16d990,_0x55f90c[_0x1c9a('0x12')]['message']);return _0x5e24da(_0x55f90c[_0x1c9a('0x12')][_0x1c9a('0x13')]);}logger['error'](_0x1c9a('0xe'),_0x16d990,_0x55f90c[_0x1c9a('0x12')]['message']);return _0x3869d8(_0x55f90c['error'][_0x1c9a('0x13')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x16d990,_0x1c9a('0xf'));_0x3869d8(_0x55f90c[_0x1c9a('0x14')]['message']);}})[_0x1c9a('0x15')](function(_0x14a4a0){logger[_0x1c9a('0x12')](_0x1c9a('0xe'),_0x16d990,_0x14a4a0);_0x5e24da(_0x14a4a0);});});}