1f78ee7e4ed4a3f01609e0e59bf45d2c470722c8
[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 _0x1eba=['then','info','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0x1eba[_0x5a7e3c];return _0x59252b;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var moment=require(_0xa1eb('0x2'));var BPromise=require(_0xa1eb('0x3'));var rs=require(_0xa1eb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa1eb('0x5'));var logger=require(_0xa1eb('0x6'))(_0xa1eb('0x7'));var config=require(_0xa1eb('0x8'));var jayson=require(_0xa1eb('0x9'));var client=jayson[_0xa1eb('0xa')][_0xa1eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bfbb0,_0x39a5a3,_0x7d2982){return new BPromise(function(_0x2aebb6,_0x9d7113){return client['request'](_0x2bfbb0,_0x7d2982)[_0xa1eb('0xc')](function(_0x4d4aaf){logger[_0xa1eb('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x39a5a3,_0xa1eb('0xe'));logger['debug'](_0xa1eb('0xf'),_0x39a5a3,'request\x20sent',JSON[_0xa1eb('0x10')](_0x4d4aaf));if(_0x4d4aaf[_0xa1eb('0x11')]){if(_0x4d4aaf[_0xa1eb('0x11')]['code']===0x1f4){logger[_0xa1eb('0x11')](_0xa1eb('0x12'),_0x39a5a3,_0x4d4aaf['error'][_0xa1eb('0x13')]);return _0x9d7113(_0x4d4aaf['error']['message']);}logger[_0xa1eb('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x39a5a3,_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);return _0x2aebb6(_0x4d4aaf[_0xa1eb('0x11')][_0xa1eb('0x13')]);}else{logger[_0xa1eb('0xd')](_0xa1eb('0x12'),_0x39a5a3,_0xa1eb('0xe'));_0x2aebb6(_0x4d4aaf[_0xa1eb('0x14')][_0xa1eb('0x13')]);}})['catch'](function(_0xbd6a6b){logger['error'](_0xa1eb('0x12'),_0x39a5a3,_0xbd6a6b);_0x9d7113(_0xbd6a6b);});});}