Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / api / analyticMetric / analyticMetric.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 _0xa83a=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','AnalyticMetric,\x20%s,\x20%s'];(function(_0x524f97,_0x1814ce){var _0x2192e4=function(_0x4b5935){while(--_0x4b5935){_0x524f97['push'](_0x524f97['shift']());}};_0x2192e4(++_0x1814ce);}(_0xa83a,0x179));var _0xaa83=function(_0x53c89c,_0x56c26f){_0x53c89c=_0x53c89c-0x0;var _0x2de0f4=_0xa83a[_0x53c89c];return _0x2de0f4;};'use strict';var _=require(_0xaa83('0x0'));var util=require(_0xaa83('0x1'));var moment=require(_0xaa83('0x2'));var BPromise=require(_0xaa83('0x3'));var rs=require(_0xaa83('0x4'));var fs=require('fs');var Redis=require(_0xaa83('0x5'));var db=require(_0xaa83('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa83('0x7'))(_0xaa83('0x8'));var config=require(_0xaa83('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaa83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x288a15,_0x447734,_0x435f9d){return new BPromise(function(_0x5ce4e8,_0x4698f5){return client[_0xaa83('0xb')](_0x288a15,_0x435f9d)[_0xaa83('0xc')](function(_0x17c349){logger['info'](_0xaa83('0xd'),_0x447734,_0xaa83('0xe'));logger[_0xaa83('0xf')](_0xaa83('0x10'),_0x447734,_0xaa83('0xe'),JSON[_0xaa83('0x11')](_0x17c349));if(_0x17c349[_0xaa83('0x12')]){if(_0x17c349[_0xaa83('0x12')]['code']===0x1f4){logger[_0xaa83('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x447734,_0x17c349[_0xaa83('0x12')][_0xaa83('0x13')]);return _0x4698f5(_0x17c349[_0xaa83('0x12')][_0xaa83('0x13')]);}logger[_0xaa83('0x12')](_0xaa83('0xd'),_0x447734,_0x17c349[_0xaa83('0x12')]['message']);return _0x5ce4e8(_0x17c349[_0xaa83('0x12')][_0xaa83('0x13')]);}else{logger[_0xaa83('0x14')](_0xaa83('0xd'),_0x447734,_0xaa83('0xe'));_0x5ce4e8(_0x17c349[_0xaa83('0x15')]['message']);}})[_0xaa83('0x16')](function(_0x754653){logger[_0xaa83('0x12')](_0xaa83('0xd'),_0x447734,_0x754653);_0x4698f5(_0x754653);});});}