Built motion from commit e1760111.|2.6.18
[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 _0x420d=['../../config/environment','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3474fa,_0x4cf016){var _0x45b2e0=function(_0x5ee9c8){while(--_0x5ee9c8){_0x3474fa['push'](_0x3474fa['shift']());}};_0x45b2e0(++_0x4cf016);}(_0x420d,0xe8));var _0xd420=function(_0xcc9aea,_0x3dbad2){_0xcc9aea=_0xcc9aea-0x0;var _0x4f7d59=_0x420d[_0xcc9aea];return _0x4f7d59;};'use strict';var _=require('lodash');var util=require(_0xd420('0x0'));var moment=require(_0xd420('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd420('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd420('0x3'));var logger=require(_0xd420('0x4'))(_0xd420('0x5'));var config=require(_0xd420('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd420('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x543b94,_0x5488ec,_0x6aa786){return new BPromise(function(_0x136776,_0x557fe7){return client[_0xd420('0x8')](_0x543b94,_0x6aa786)[_0xd420('0x9')](function(_0x2a9bb6){logger[_0xd420('0xa')](_0xd420('0xb'),_0x5488ec,_0xd420('0xc'));logger['debug'](_0xd420('0xd'),_0x5488ec,_0xd420('0xc'),JSON['stringify'](_0x2a9bb6));if(_0x2a9bb6[_0xd420('0xe')]){if(_0x2a9bb6[_0xd420('0xe')]['code']===0x1f4){logger['error'](_0xd420('0xb'),_0x5488ec,_0x2a9bb6['error'][_0xd420('0xf')]);return _0x557fe7(_0x2a9bb6[_0xd420('0xe')][_0xd420('0xf')]);}logger[_0xd420('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5488ec,_0x2a9bb6[_0xd420('0xe')]['message']);return _0x136776(_0x2a9bb6[_0xd420('0xe')][_0xd420('0xf')]);}else{logger[_0xd420('0xa')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5488ec,_0xd420('0xc'));_0x136776(_0x2a9bb6['result'][_0xd420('0xf')]);}})[_0xd420('0x10')](function(_0x211428){logger[_0xd420('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5488ec,_0x211428);_0x557fe7(_0x211428);});});}