9a5a53e8118817c1cd079d36c2785ca3b1f9eec0
[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 _0x0155=['../../config/environment','jayson/promise','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1aac09,_0x38ac68){var _0xbf1baa=function(_0x2e86ad){while(--_0x2e86ad){_0x1aac09['push'](_0x1aac09['shift']());}};_0xbf1baa(++_0x38ac68);}(_0x0155,0x1da));var _0x5015=function(_0xee2d39,_0x576901){_0xee2d39=_0xee2d39-0x0;var _0x57f609=_0x0155[_0xee2d39];return _0x57f609;};'use strict';var _=require(_0x5015('0x0'));var util=require(_0x5015('0x1'));var moment=require(_0x5015('0x2'));var BPromise=require(_0x5015('0x3'));var rs=require(_0x5015('0x4'));var fs=require('fs');var Redis=require(_0x5015('0x5'));var db=require(_0x5015('0x6'))['db'];var utils=require(_0x5015('0x7'));var logger=require(_0x5015('0x8'))(_0x5015('0x9'));var config=require(_0x5015('0xa'));var jayson=require(_0x5015('0xb'));var client=jayson[_0x5015('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x106ca2,_0x114c67,_0x2381f0){return new BPromise(function(_0x88600,_0x104038){return client[_0x5015('0xd')](_0x106ca2,_0x2381f0)[_0x5015('0xe')](function(_0x50575e){logger['info'](_0x5015('0xf'),_0x114c67,_0x5015('0x10'));logger['debug'](_0x5015('0x11'),_0x114c67,'request\x20sent',JSON[_0x5015('0x12')](_0x50575e));if(_0x50575e[_0x5015('0x13')]){if(_0x50575e[_0x5015('0x13')]['code']===0x1f4){logger[_0x5015('0x13')](_0x5015('0xf'),_0x114c67,_0x50575e[_0x5015('0x13')]['message']);return _0x104038(_0x50575e['error'][_0x5015('0x14')]);}logger[_0x5015('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x114c67,_0x50575e[_0x5015('0x13')][_0x5015('0x14')]);return _0x88600(_0x50575e[_0x5015('0x13')]['message']);}else{logger[_0x5015('0x15')]('VoiceQueuesLog,\x20%s,\x20%s',_0x114c67,_0x5015('0x10'));_0x88600(_0x50575e['result']['message']);}})['catch'](function(_0x3a5971){logger[_0x5015('0x13')](_0x5015('0xf'),_0x114c67,_0x3a5971);_0x104038(_0x3a5971);});});}