62b3a84efc17adffae2fa8276c2fc3aa530d0769
[motion2.git] / server / api / chatTransferReport / chatTransferReport.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 _0xdcbe=['http','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x32bb5e,_0x31d14e){var _0x228589=function(_0x57bc86){while(--_0x57bc86){_0x32bb5e['push'](_0x32bb5e['shift']());}};_0x228589(++_0x31d14e);}(_0xdcbe,0xdd));var _0xedcb=function(_0x5bb95e,_0x3c9bd7){_0x5bb95e=_0x5bb95e-0x0;var _0x3b1d93=_0xdcbe[_0x5bb95e];return _0x3b1d93;};'use strict';var _=require(_0xedcb('0x0'));var util=require('util');var moment=require(_0xedcb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedcb('0x2'));var db=require(_0xedcb('0x3'))['db'];var utils=require(_0xedcb('0x4'));var logger=require(_0xedcb('0x5'))(_0xedcb('0x6'));var config=require(_0xedcb('0x7'));var jayson=require(_0xedcb('0x8'));var client=jayson[_0xedcb('0x9')][_0xedcb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aa072,_0x31a0f6,_0x746dc9){return new BPromise(function(_0x3b6ebd,_0x166d59){return client['request'](_0x2aa072,_0x746dc9)[_0xedcb('0xb')](function(_0x20783a){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x31a0f6,_0xedcb('0xc'));logger[_0xedcb('0xd')](_0xedcb('0xe'),_0x31a0f6,'request\x20sent',JSON[_0xedcb('0xf')](_0x20783a));if(_0x20783a[_0xedcb('0x10')]){if(_0x20783a[_0xedcb('0x10')][_0xedcb('0x11')]===0x1f4){logger[_0xedcb('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x31a0f6,_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);return _0x166d59(_0x20783a['error']['message']);}logger['error'](_0xedcb('0x13'),_0x31a0f6,_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);return _0x3b6ebd(_0x20783a[_0xedcb('0x10')][_0xedcb('0x12')]);}else{logger[_0xedcb('0x14')](_0xedcb('0x13'),_0x31a0f6,_0xedcb('0xc'));_0x3b6ebd(_0x20783a['result']['message']);}})['catch'](function(_0x312f1d){logger[_0xedcb('0x10')](_0xedcb('0x13'),_0x31a0f6,_0x312f1d);_0x166d59(_0x312f1d);});});}