Built motion from commit f0a64034.|2.6.11
[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 _0x468e=['JscriptyAnswerReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x468e,0x17f));var _0xe468=function(_0xf315b,_0x14de4a){_0xf315b=_0xf315b-0x0;var _0x4e52ce=_0x468e[_0xf315b];return _0x4e52ce;};'use strict';var _=require(_0xe468('0x0'));var util=require('util');var moment=require(_0xe468('0x1'));var BPromise=require(_0xe468('0x2'));var rs=require(_0xe468('0x3'));var fs=require('fs');var Redis=require(_0xe468('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe468('0x5'));var config=require(_0xe468('0x6'));var jayson=require(_0xe468('0x7'));var client=jayson['client'][_0xe468('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x403932,_0x539eea,_0x578e1c){return new BPromise(function(_0x1d271d,_0x367daf){return client[_0xe468('0x9')](_0x403932,_0x578e1c)[_0xe468('0xa')](function(_0x32e230){logger[_0xe468('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x539eea,_0xe468('0xc'));logger['debug'](_0xe468('0xd'),_0x539eea,_0xe468('0xc'),JSON['stringify'](_0x32e230));if(_0x32e230[_0xe468('0xe')]){if(_0x32e230[_0xe468('0xe')][_0xe468('0xf')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x539eea,_0x32e230['error']['message']);return _0x367daf(_0x32e230['error'][_0xe468('0x10')]);}logger[_0xe468('0xe')](_0xe468('0x11'),_0x539eea,_0x32e230['error'][_0xe468('0x10')]);return _0x1d271d(_0x32e230[_0xe468('0xe')][_0xe468('0x10')]);}else{logger['info'](_0xe468('0x11'),_0x539eea,_0xe468('0xc'));_0x1d271d(_0x32e230[_0xe468('0x12')]['message']);}})[_0xe468('0x13')](function(_0x4a41a5){logger[_0xe468('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x539eea,_0x4a41a5);_0x367daf(_0x4a41a5);});});}