Built motion from commit f7863d46.|2.5.41
[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 _0x6725=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6725,0x19d));var _0x5672=function(_0x5f3d2b,_0x1feba0){_0x5f3d2b=_0x5f3d2b-0x0;var _0x45cadc=_0x6725[_0x5f3d2b];return _0x45cadc;};'use strict';var _=require(_0x5672('0x0'));var util=require(_0x5672('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5672('0x2'));var fs=require('fs');var Redis=require(_0x5672('0x3'));var db=require(_0x5672('0x4'))['db'];var utils=require(_0x5672('0x5'));var logger=require(_0x5672('0x6'))(_0x5672('0x7'));var config=require(_0x5672('0x8'));var jayson=require(_0x5672('0x9'));var client=jayson[_0x5672('0xa')][_0x5672('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x441551,_0x134115,_0x3a383a){return new BPromise(function(_0x4b373a,_0x28c05b){return client['request'](_0x441551,_0x3a383a)[_0x5672('0xc')](function(_0x41162c){logger[_0x5672('0xd')](_0x5672('0xe'),_0x134115,'request\x20sent');logger[_0x5672('0xf')](_0x5672('0x10'),_0x134115,_0x5672('0x11'),JSON[_0x5672('0x12')](_0x41162c));if(_0x41162c['error']){if(_0x41162c[_0x5672('0x13')][_0x5672('0x14')]===0x1f4){logger[_0x5672('0x13')](_0x5672('0xe'),_0x134115,_0x41162c['error']['message']);return _0x28c05b(_0x41162c['error'][_0x5672('0x15')]);}logger[_0x5672('0x13')](_0x5672('0xe'),_0x134115,_0x41162c[_0x5672('0x13')]['message']);return _0x4b373a(_0x41162c['error'][_0x5672('0x15')]);}else{logger['info'](_0x5672('0xe'),_0x134115,_0x5672('0x11'));_0x4b373a(_0x41162c[_0x5672('0x16')][_0x5672('0x15')]);}})['catch'](function(_0x1740af){logger[_0x5672('0x13')](_0x5672('0xe'),_0x134115,_0x1740af);_0x28c05b(_0x1740af);});});}