Built motion from commit (unavailable).|2.4.13
[motion2.git] / server / api / jscriptySessionReport / jscriptySessionReport.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 _0xfccf=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfccf,0xaa));var _0xffcc=function(_0x56a31c,_0xd1b2e1){_0x56a31c=_0x56a31c-0x0;var _0x5a0a7b=_0xfccf[_0x56a31c];return _0x5a0a7b;};'use strict';var _=require(_0xffcc('0x0'));var util=require(_0xffcc('0x1'));var moment=require(_0xffcc('0x2'));var BPromise=require(_0xffcc('0x3'));var rs=require(_0xffcc('0x4'));var fs=require('fs');var Redis=require(_0xffcc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xffcc('0x6'))(_0xffcc('0x7'));var config=require(_0xffcc('0x8'));var jayson=require(_0xffcc('0x9'));var client=jayson[_0xffcc('0xa')][_0xffcc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x229fe1,_0x3cf6b6,_0x5792b8){return new BPromise(function(_0x15e64c,_0x240dfe){return client['request'](_0x229fe1,_0x5792b8)[_0xffcc('0xc')](function(_0x3ceec5){logger['info'](_0xffcc('0xd'),_0x3cf6b6,_0xffcc('0xe'));logger[_0xffcc('0xf')](_0xffcc('0x10'),_0x3cf6b6,_0xffcc('0xe'),JSON[_0xffcc('0x11')](_0x3ceec5));if(_0x3ceec5[_0xffcc('0x12')]){if(_0x3ceec5[_0xffcc('0x12')][_0xffcc('0x13')]===0x1f4){logger[_0xffcc('0x12')](_0xffcc('0xd'),_0x3cf6b6,_0x3ceec5['error']['message']);return _0x240dfe(_0x3ceec5[_0xffcc('0x12')][_0xffcc('0x14')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x3cf6b6,_0x3ceec5[_0xffcc('0x12')]['message']);return _0x15e64c(_0x3ceec5[_0xffcc('0x12')][_0xffcc('0x14')]);}else{logger[_0xffcc('0x15')](_0xffcc('0xd'),_0x3cf6b6,'request\x20sent');_0x15e64c(_0x3ceec5[_0xffcc('0x16')][_0xffcc('0x14')]);}})[_0xffcc('0x17')](function(_0x1fc745){logger['error'](_0xffcc('0xd'),_0x3cf6b6,_0x1fc745);_0x240dfe(_0x1fc745);});});}