Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / api / voiceQueuesLog / voiceQueuesLog.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 _0x9532=['../../config/logger','../../config/environment','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x19ded1,_0x306816){var _0x40b970=function(_0x3e8dab){while(--_0x3e8dab){_0x19ded1['push'](_0x19ded1['shift']());}};_0x40b970(++_0x306816);}(_0x9532,0x8c));var _0x2953=function(_0x571f5d,_0x509507){_0x571f5d=_0x571f5d-0x0;var _0x4844ef=_0x9532[_0x571f5d];return _0x4844ef;};'use strict';var _=require(_0x2953('0x0'));var util=require(_0x2953('0x1'));var moment=require(_0x2953('0x2'));var BPromise=require(_0x2953('0x3'));var rs=require(_0x2953('0x4'));var fs=require('fs');var Redis=require(_0x2953('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2953('0x6'));var logger=require(_0x2953('0x7'))('rpc');var config=require(_0x2953('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2953('0x9')][_0x2953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b2aea,_0x53566f,_0x21a76a){return new BPromise(function(_0x5cbdaa,_0x49f180){return client[_0x2953('0xb')](_0x5b2aea,_0x21a76a)['then'](function(_0xc5c60f){logger[_0x2953('0xc')](_0x2953('0xd'),_0x53566f,_0x2953('0xe'));logger['debug'](_0x2953('0xf'),_0x53566f,_0x2953('0xe'),JSON[_0x2953('0x10')](_0xc5c60f));if(_0xc5c60f[_0x2953('0x11')]){if(_0xc5c60f[_0x2953('0x11')][_0x2953('0x12')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x53566f,_0xc5c60f[_0x2953('0x11')][_0x2953('0x13')]);return _0x49f180(_0xc5c60f['error'][_0x2953('0x13')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x53566f,_0xc5c60f['error']['message']);return _0x5cbdaa(_0xc5c60f[_0x2953('0x11')][_0x2953('0x13')]);}else{logger[_0x2953('0xc')](_0x2953('0xd'),_0x53566f,_0x2953('0xe'));_0x5cbdaa(_0xc5c60f['result'][_0x2953('0x13')]);}})[_0x2953('0x14')](function(_0x341e73){logger[_0x2953('0x11')](_0x2953('0xd'),_0x53566f,_0x341e73);_0x49f180(_0x341e73);});});}