Built motion from commit 9e1ec266.|2.6.28
[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 _0x875e=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x875e,0x106));var _0xe875=function(_0x3ea022,_0x2d5328){_0x3ea022=_0x3ea022-0x0;var _0x3b97a2=_0x875e[_0x3ea022];return _0x3b97a2;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require(_0xe875('0x3'));var fs=require('fs');var Redis=require(_0xe875('0x4'));var db=require(_0xe875('0x5'))['db'];var utils=require(_0xe875('0x6'));var logger=require(_0xe875('0x7'))(_0xe875('0x8'));var config=require(_0xe875('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe875('0xa')][_0xe875('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a8ae9,_0x79cf6a,_0x5d2102){return new BPromise(function(_0x11c9b0,_0x2d44c5){return client[_0xe875('0xc')](_0x2a8ae9,_0x5d2102)[_0xe875('0xd')](function(_0x4b61f5){logger[_0xe875('0xe')](_0xe875('0xf'),_0x79cf6a,_0xe875('0x10'));logger[_0xe875('0x11')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x79cf6a,'request\x20sent',JSON[_0xe875('0x12')](_0x4b61f5));if(_0x4b61f5['error']){if(_0x4b61f5[_0xe875('0x13')][_0xe875('0x14')]===0x1f4){logger['error'](_0xe875('0xf'),_0x79cf6a,_0x4b61f5['error'][_0xe875('0x15')]);return _0x2d44c5(_0x4b61f5[_0xe875('0x13')][_0xe875('0x15')]);}logger[_0xe875('0x13')](_0xe875('0xf'),_0x79cf6a,_0x4b61f5[_0xe875('0x13')][_0xe875('0x15')]);return _0x11c9b0(_0x4b61f5[_0xe875('0x13')][_0xe875('0x15')]);}else{logger[_0xe875('0xe')](_0xe875('0xf'),_0x79cf6a,'request\x20sent');_0x11c9b0(_0x4b61f5[_0xe875('0x16')][_0xe875('0x15')]);}})[_0xe875('0x17')](function(_0x1db796){logger[_0xe875('0x13')](_0xe875('0xf'),_0x79cf6a,_0x1db796);_0x2d44c5(_0x1db796);});});}