Built motion from commit 9d7072cc.|2.5.39
[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 _0xbad2=['../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3e94a6,_0x15b13c){var _0x296c06=function(_0x43e353){while(--_0x43e353){_0x3e94a6['push'](_0x3e94a6['shift']());}};_0x296c06(++_0x15b13c);}(_0xbad2,0x150));var _0x2bad=function(_0x409bf8,_0x2bd376){_0x409bf8=_0x409bf8-0x0;var _0x387912=_0xbad2[_0x409bf8];return _0x387912;};'use strict';var _=require(_0x2bad('0x0'));var util=require(_0x2bad('0x1'));var moment=require(_0x2bad('0x2'));var BPromise=require(_0x2bad('0x3'));var rs=require(_0x2bad('0x4'));var fs=require('fs');var Redis=require(_0x2bad('0x5'));var db=require(_0x2bad('0x6'))['db'];var utils=require(_0x2bad('0x7'));var logger=require(_0x2bad('0x8'))('rpc');var config=require(_0x2bad('0x9'));var jayson=require(_0x2bad('0xa'));var client=jayson[_0x2bad('0xb')][_0x2bad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb2c3eb,_0x286bc6,_0x4d1b02){return new BPromise(function(_0x36df39,_0x456943){return client['request'](_0xb2c3eb,_0x4d1b02)[_0x2bad('0xd')](function(_0x286a9a){logger[_0x2bad('0xe')](_0x2bad('0xf'),_0x286bc6,'request\x20sent');logger[_0x2bad('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x286bc6,_0x2bad('0x11'),JSON[_0x2bad('0x12')](_0x286a9a));if(_0x286a9a[_0x2bad('0x13')]){if(_0x286a9a[_0x2bad('0x13')][_0x2bad('0x14')]===0x1f4){logger['error'](_0x2bad('0xf'),_0x286bc6,_0x286a9a[_0x2bad('0x13')][_0x2bad('0x15')]);return _0x456943(_0x286a9a[_0x2bad('0x13')]['message']);}logger['error'](_0x2bad('0xf'),_0x286bc6,_0x286a9a[_0x2bad('0x13')][_0x2bad('0x15')]);return _0x36df39(_0x286a9a[_0x2bad('0x13')][_0x2bad('0x15')]);}else{logger[_0x2bad('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x286bc6,'request\x20sent');_0x36df39(_0x286a9a[_0x2bad('0x16')]['message']);}})['catch'](function(_0x2e5ab9){logger[_0x2bad('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x286bc6,_0x2e5ab9);_0x456943(_0x2e5ab9);});});}