Built motion from commit d5e4af8c.|2.6.23
[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 _0x8aca=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3dc5c1,_0x503e9c){var _0x57fdc5=function(_0x40f2db){while(--_0x40f2db){_0x3dc5c1['push'](_0x3dc5c1['shift']());}};_0x57fdc5(++_0x503e9c);}(_0x8aca,0x13a));var _0xa8ac=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x8aca[_0x58db4e];return _0x40139a;};'use strict';var _=require(_0xa8ac('0x0'));var util=require(_0xa8ac('0x1'));var moment=require('moment');var BPromise=require(_0xa8ac('0x2'));var rs=require(_0xa8ac('0x3'));var fs=require('fs');var Redis=require(_0xa8ac('0x4'));var db=require(_0xa8ac('0x5'))['db'];var utils=require(_0xa8ac('0x6'));var logger=require('../../config/logger')(_0xa8ac('0x7'));var config=require(_0xa8ac('0x8'));var jayson=require(_0xa8ac('0x9'));var client=jayson[_0xa8ac('0xa')][_0xa8ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31eaed,_0x38a9e1,_0x51245b){return new BPromise(function(_0x2b6c71,_0x507244){return client[_0xa8ac('0xc')](_0x31eaed,_0x51245b)['then'](function(_0x5406c1){logger[_0xa8ac('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x38a9e1,_0xa8ac('0xe'));logger[_0xa8ac('0xf')](_0xa8ac('0x10'),_0x38a9e1,_0xa8ac('0xe'),JSON['stringify'](_0x5406c1));if(_0x5406c1[_0xa8ac('0x11')]){if(_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x12')]===0x1f4){logger[_0xa8ac('0x11')](_0xa8ac('0x13'),_0x38a9e1,_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);return _0x507244(_0x5406c1[_0xa8ac('0x11')]['message']);}logger[_0xa8ac('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x38a9e1,_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);return _0x2b6c71(_0x5406c1[_0xa8ac('0x11')][_0xa8ac('0x14')]);}else{logger[_0xa8ac('0xd')](_0xa8ac('0x13'),_0x38a9e1,_0xa8ac('0xe'));_0x2b6c71(_0x5406c1[_0xa8ac('0x15')][_0xa8ac('0x14')]);}})[_0xa8ac('0x16')](function(_0x147ab2){logger[_0xa8ac('0x11')](_0xa8ac('0x13'),_0x38a9e1,_0x147ab2);_0x507244(_0x147ab2);});});}