Built motion from commit 953226e6.|2.6.32
[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 _0xcd54=['rpc','../../config/environment','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/logger'];(function(_0x1f8755,_0x1f387f){var _0x4ee357=function(_0x3feae2){while(--_0x3feae2){_0x1f8755['push'](_0x1f8755['shift']());}};_0x4ee357(++_0x1f387f);}(_0xcd54,0xaf));var _0x4cd5=function(_0x1aa3d6,_0x4c2fd4){_0x1aa3d6=_0x1aa3d6-0x0;var _0x3fe162=_0xcd54[_0x1aa3d6];return _0x3fe162;};'use strict';var _=require(_0x4cd5('0x0'));var util=require(_0x4cd5('0x1'));var moment=require(_0x4cd5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4cd5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cd5('0x4'))(_0x4cd5('0x5'));var config=require(_0x4cd5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4cd5('0x7')][_0x4cd5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9ad1a5,_0x19eab5,_0x2e216a){return new BPromise(function(_0x5a9277,_0x1759a2){return client[_0x4cd5('0x9')](_0x9ad1a5,_0x2e216a)[_0x4cd5('0xa')](function(_0x456c4c){logger['info'](_0x4cd5('0xb'),_0x19eab5,_0x4cd5('0xc'));logger[_0x4cd5('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x19eab5,_0x4cd5('0xc'),JSON[_0x4cd5('0xe')](_0x456c4c));if(_0x456c4c[_0x4cd5('0xf')]){if(_0x456c4c[_0x4cd5('0xf')]['code']===0x1f4){logger[_0x4cd5('0xf')](_0x4cd5('0xb'),_0x19eab5,_0x456c4c[_0x4cd5('0xf')]['message']);return _0x1759a2(_0x456c4c[_0x4cd5('0xf')][_0x4cd5('0x10')]);}logger[_0x4cd5('0xf')](_0x4cd5('0xb'),_0x19eab5,_0x456c4c[_0x4cd5('0xf')][_0x4cd5('0x10')]);return _0x5a9277(_0x456c4c[_0x4cd5('0xf')][_0x4cd5('0x10')]);}else{logger[_0x4cd5('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x19eab5,_0x4cd5('0xc'));_0x5a9277(_0x456c4c[_0x4cd5('0x12')]['message']);}})[_0x4cd5('0x13')](function(_0x51e78b){logger[_0x4cd5('0xf')](_0x4cd5('0xb'),_0x19eab5,_0x51e78b);_0x1759a2(_0x51e78b);});});}