Built motion from commit (unavailable).|2.5.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 _0x0f1a=['request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x50890a,_0x3f4250){var _0x4579b6=function(_0x2538da){while(--_0x2538da){_0x50890a['push'](_0x50890a['shift']());}};_0x4579b6(++_0x3f4250);}(_0x0f1a,0x171));var _0xa0f1=function(_0x42c175,_0x4011b7){_0x42c175=_0x42c175-0x0;var _0x45e1c5=_0x0f1a[_0x42c175];return _0x45e1c5;};'use strict';var _=require(_0xa0f1('0x0'));var util=require(_0xa0f1('0x1'));var moment=require(_0xa0f1('0x2'));var BPromise=require(_0xa0f1('0x3'));var rs=require(_0xa0f1('0x4'));var fs=require('fs');var Redis=require(_0xa0f1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0f1('0x6'));var logger=require(_0xa0f1('0x7'))(_0xa0f1('0x8'));var config=require(_0xa0f1('0x9'));var jayson=require(_0xa0f1('0xa'));var client=jayson[_0xa0f1('0xb')][_0xa0f1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1aaa5a,_0x4f2588,_0x447eda){return new BPromise(function(_0x30bff4,_0x1fbeb5){return client[_0xa0f1('0xd')](_0x1aaa5a,_0x447eda)['then'](function(_0x52bb89){logger[_0xa0f1('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f2588,_0xa0f1('0xf'));logger['debug'](_0xa0f1('0x10'),_0x4f2588,_0xa0f1('0xf'),JSON[_0xa0f1('0x11')](_0x52bb89));if(_0x52bb89[_0xa0f1('0x12')]){if(_0x52bb89[_0xa0f1('0x12')][_0xa0f1('0x13')]===0x1f4){logger[_0xa0f1('0x12')](_0xa0f1('0x14'),_0x4f2588,_0x52bb89[_0xa0f1('0x12')]['message']);return _0x1fbeb5(_0x52bb89[_0xa0f1('0x12')][_0xa0f1('0x15')]);}logger[_0xa0f1('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f2588,_0x52bb89[_0xa0f1('0x12')]['message']);return _0x30bff4(_0x52bb89['error'][_0xa0f1('0x15')]);}else{logger[_0xa0f1('0xe')](_0xa0f1('0x14'),_0x4f2588,_0xa0f1('0xf'));_0x30bff4(_0x52bb89[_0xa0f1('0x16')][_0xa0f1('0x15')]);}})[_0xa0f1('0x17')](function(_0x2cddd7){logger['error'](_0xa0f1('0x14'),_0x4f2588,_0x2cddd7);_0x1fbeb5(_0x2cddd7);});});}