Built motion from commit (unavailable).|2.3.3
[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 _0x206a=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x326cef,_0x390649){var _0x733254=function(_0xd442c5){while(--_0xd442c5){_0x326cef['push'](_0x326cef['shift']());}};_0x733254(++_0x390649);}(_0x206a,0xa8));var _0xa206=function(_0x5e6487,_0x2718b8){_0x5e6487=_0x5e6487-0x0;var _0x70c092=_0x206a[_0x5e6487];return _0x70c092;};'use strict';var _=require(_0xa206('0x0'));var util=require(_0xa206('0x1'));var moment=require(_0xa206('0x2'));var BPromise=require('bluebird');var rs=require(_0xa206('0x3'));var fs=require('fs');var Redis=require(_0xa206('0x4'));var db=require(_0xa206('0x5'))['db'];var utils=require(_0xa206('0x6'));var logger=require(_0xa206('0x7'))('rpc');var config=require(_0xa206('0x8'));var jayson=require(_0xa206('0x9'));var client=jayson[_0xa206('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d586a,_0x3ac123,_0xb0c444){return new BPromise(function(_0x5c1f8f,_0x2c54ec){return client['request'](_0x2d586a,_0xb0c444)[_0xa206('0xb')](function(_0x1ee907){logger['info'](_0xa206('0xc'),_0x3ac123,_0xa206('0xd'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3ac123,'request\x20sent',JSON[_0xa206('0xe')](_0x1ee907));if(_0x1ee907[_0xa206('0xf')]){if(_0x1ee907['error'][_0xa206('0x10')]===0x1f4){logger[_0xa206('0xf')](_0xa206('0xc'),_0x3ac123,_0x1ee907['error'][_0xa206('0x11')]);return _0x2c54ec(_0x1ee907[_0xa206('0xf')][_0xa206('0x11')]);}logger[_0xa206('0xf')](_0xa206('0xc'),_0x3ac123,_0x1ee907[_0xa206('0xf')]['message']);return _0x5c1f8f(_0x1ee907[_0xa206('0xf')][_0xa206('0x11')]);}else{logger[_0xa206('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3ac123,'request\x20sent');_0x5c1f8f(_0x1ee907[_0xa206('0x13')]['message']);}})[_0xa206('0x14')](function(_0x4ecc15){logger[_0xa206('0xf')](_0xa206('0xc'),_0x3ac123,_0x4ecc15);_0x2c54ec(_0x4ecc15);});});}