Built motion from commit b0a9a629.|2.6.33
[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 _0xc12d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xc12d,0x1e2));var _0xdc12=function(_0x40bbe2,_0x17f7b9){_0x40bbe2=_0x40bbe2-0x0;var _0x42652a=_0xc12d[_0x40bbe2];return _0x42652a;};'use strict';var _=require(_0xdc12('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdc12('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc12('0x2'));var db=require(_0xdc12('0x3'))['db'];var utils=require(_0xdc12('0x4'));var logger=require(_0xdc12('0x5'))('rpc');var config=require(_0xdc12('0x6'));var jayson=require(_0xdc12('0x7'));var client=jayson[_0xdc12('0x8')][_0xdc12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26a512,_0x2b2d6e,_0x12ffde){return new BPromise(function(_0x137b0e,_0x480628){return client[_0xdc12('0xa')](_0x26a512,_0x12ffde)[_0xdc12('0xb')](function(_0x27630e){logger[_0xdc12('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2b2d6e,'request\x20sent');logger['debug'](_0xdc12('0xd'),_0x2b2d6e,_0xdc12('0xe'),JSON[_0xdc12('0xf')](_0x27630e));if(_0x27630e['error']){if(_0x27630e[_0xdc12('0x10')][_0xdc12('0x11')]===0x1f4){logger[_0xdc12('0x10')](_0xdc12('0x12'),_0x2b2d6e,_0x27630e['error'][_0xdc12('0x13')]);return _0x480628(_0x27630e[_0xdc12('0x10')]['message']);}logger[_0xdc12('0x10')](_0xdc12('0x12'),_0x2b2d6e,_0x27630e[_0xdc12('0x10')][_0xdc12('0x13')]);return _0x137b0e(_0x27630e[_0xdc12('0x10')][_0xdc12('0x13')]);}else{logger[_0xdc12('0xc')](_0xdc12('0x12'),_0x2b2d6e,_0xdc12('0xe'));_0x137b0e(_0x27630e[_0xdc12('0x14')][_0xdc12('0x13')]);}})['catch'](function(_0x14b37a){logger[_0xdc12('0x10')](_0xdc12('0x12'),_0x2b2d6e,_0x14b37a);_0x480628(_0x14b37a);});});}