Built motion from commit 26159a51.|2.5.44
[motion2.git] / server / api / jscriptyAnswerReport / jscriptyAnswerReport.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 _0x9b33=['result','catch','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9b33,0x14c));var _0x39b3=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x9b33[_0x298ed3];return _0x5aad28;};'use strict';var _=require('lodash');var util=require(_0x39b3('0x0'));var moment=require(_0x39b3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39b3('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x39b3('0x3'))(_0x39b3('0x4'));var config=require(_0x39b3('0x5'));var jayson=require(_0x39b3('0x6'));var client=jayson[_0x39b3('0x7')][_0x39b3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x617fac,_0x8863ff,_0x9cb955){return new BPromise(function(_0x41173d,_0x146ad7){return client[_0x39b3('0x9')](_0x617fac,_0x9cb955)[_0x39b3('0xa')](function(_0x105eb3){logger['info'](_0x39b3('0xb'),_0x8863ff,_0x39b3('0xc'));logger[_0x39b3('0xd')](_0x39b3('0xe'),_0x8863ff,'request\x20sent',JSON[_0x39b3('0xf')](_0x105eb3));if(_0x105eb3[_0x39b3('0x10')]){if(_0x105eb3['error'][_0x39b3('0x11')]===0x1f4){logger[_0x39b3('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x8863ff,_0x105eb3[_0x39b3('0x10')][_0x39b3('0x12')]);return _0x146ad7(_0x105eb3[_0x39b3('0x10')][_0x39b3('0x12')]);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x8863ff,_0x105eb3[_0x39b3('0x10')][_0x39b3('0x12')]);return _0x41173d(_0x105eb3[_0x39b3('0x10')][_0x39b3('0x12')]);}else{logger[_0x39b3('0x13')](_0x39b3('0xb'),_0x8863ff,_0x39b3('0xc'));_0x41173d(_0x105eb3[_0x39b3('0x14')][_0x39b3('0x12')]);}})[_0x39b3('0x15')](function(_0x123cf1){logger[_0x39b3('0x10')](_0x39b3('0xb'),_0x8863ff,_0x123cf1);_0x146ad7(_0x123cf1);});});}