Built motion from commit (unavailable).|2.5.0
[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 _0x91a6=['../../config/utils','rpc','../../config/environment','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x22293d,_0x1e7a92){var _0x41bf93=function(_0x57e983){while(--_0x57e983){_0x22293d['push'](_0x22293d['shift']());}};_0x41bf93(++_0x1e7a92);}(_0x91a6,0x1b0));var _0x691a=function(_0x12a6a2,_0x6b6f8a){_0x12a6a2=_0x12a6a2-0x0;var _0x5bbf90=_0x91a6[_0x12a6a2];return _0x5bbf90;};'use strict';var _=require(_0x691a('0x0'));var util=require('util');var moment=require(_0x691a('0x1'));var BPromise=require(_0x691a('0x2'));var rs=require(_0x691a('0x3'));var fs=require('fs');var Redis=require(_0x691a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x691a('0x5'));var logger=require('../../config/logger')(_0x691a('0x6'));var config=require(_0x691a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x691a('0x8')][_0x691a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x177491,_0x260e21,_0xdd0c70){return new BPromise(function(_0xa70af5,_0x2618f2){return client[_0x691a('0xa')](_0x177491,_0xdd0c70)[_0x691a('0xb')](function(_0x166f62){logger['info'](_0x691a('0xc'),_0x260e21,_0x691a('0xd'));logger[_0x691a('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x260e21,_0x691a('0xd'),JSON['stringify'](_0x166f62));if(_0x166f62[_0x691a('0xf')]){if(_0x166f62[_0x691a('0xf')]['code']===0x1f4){logger[_0x691a('0xf')](_0x691a('0xc'),_0x260e21,_0x166f62[_0x691a('0xf')]['message']);return _0x2618f2(_0x166f62['error'][_0x691a('0x10')]);}logger[_0x691a('0xf')](_0x691a('0xc'),_0x260e21,_0x166f62[_0x691a('0xf')]['message']);return _0xa70af5(_0x166f62['error']['message']);}else{logger['info'](_0x691a('0xc'),_0x260e21,_0x691a('0xd'));_0xa70af5(_0x166f62[_0x691a('0x11')]['message']);}})[_0x691a('0x12')](function(_0x247cd0){logger[_0x691a('0xf')](_0x691a('0xc'),_0x260e21,_0x247cd0);_0x2618f2(_0x247cd0);});});}