Built motion from commit (unavailable).|2.5.31
[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 _0xeac1=['lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','code','error','JscriptyAnswerReport,\x20%s,\x20%s','message'];(function(_0x21e9ce,_0x31fe71){var _0xa6f302=function(_0x58398b){while(--_0x58398b){_0x21e9ce['push'](_0x21e9ce['shift']());}};_0xa6f302(++_0x31fe71);}(_0xeac1,0x143));var _0x1eac=function(_0x5cc678,_0x17bccc){_0x5cc678=_0x5cc678-0x0;var _0x4034e7=_0xeac1[_0x5cc678];return _0x4034e7;};'use strict';var _=require(_0x1eac('0x0'));var util=require(_0x1eac('0x1'));var moment=require('moment');var BPromise=require(_0x1eac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1eac('0x3'));var logger=require(_0x1eac('0x4'))(_0x1eac('0x5'));var config=require(_0x1eac('0x6'));var jayson=require(_0x1eac('0x7'));var client=jayson[_0x1eac('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e019f,_0xc53f56,_0x197124){return new BPromise(function(_0x1103f8,_0x4b96d4){return client[_0x1eac('0x9')](_0x2e019f,_0x197124)[_0x1eac('0xa')](function(_0x1a514d){logger[_0x1eac('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc53f56,_0x1eac('0xc'));logger[_0x1eac('0xd')](_0x1eac('0xe'),_0xc53f56,'request\x20sent',JSON['stringify'](_0x1a514d));if(_0x1a514d['error']){if(_0x1a514d['error'][_0x1eac('0xf')]===0x1f4){logger[_0x1eac('0x10')](_0x1eac('0x11'),_0xc53f56,_0x1a514d[_0x1eac('0x10')][_0x1eac('0x12')]);return _0x4b96d4(_0x1a514d[_0x1eac('0x10')][_0x1eac('0x12')]);}logger[_0x1eac('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc53f56,_0x1a514d[_0x1eac('0x10')][_0x1eac('0x12')]);return _0x1103f8(_0x1a514d['error'][_0x1eac('0x12')]);}else{logger[_0x1eac('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc53f56,_0x1eac('0xc'));_0x1103f8(_0x1a514d['result'][_0x1eac('0x12')]);}})['catch'](function(_0x625f94){logger[_0x1eac('0x10')](_0x1eac('0x11'),_0xc53f56,_0x625f94);_0x4b96d4(_0x625f94);});});}