Built motion from commit c738b9ac.|2.6.25
[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 _0x3773=['http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3773,0x116));var _0x3377=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x3773[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x3377('0x0'));var util=require(_0x3377('0x1'));var moment=require(_0x3377('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3377('0x3'));var logger=require(_0x3377('0x4'))('rpc');var config=require(_0x3377('0x5'));var jayson=require(_0x3377('0x6'));var client=jayson['client'][_0x3377('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c772a,_0x59f844,_0x366716){return new BPromise(function(_0xf5ab2a,_0x4610ca){return client[_0x3377('0x8')](_0x5c772a,_0x366716)['then'](function(_0x37c2e4){logger['info'](_0x3377('0x9'),_0x59f844,_0x3377('0xa'));logger[_0x3377('0xb')](_0x3377('0xc'),_0x59f844,_0x3377('0xa'),JSON[_0x3377('0xd')](_0x37c2e4));if(_0x37c2e4['error']){if(_0x37c2e4['error']['code']===0x1f4){logger[_0x3377('0xe')](_0x3377('0x9'),_0x59f844,_0x37c2e4[_0x3377('0xe')][_0x3377('0xf')]);return _0x4610ca(_0x37c2e4[_0x3377('0xe')][_0x3377('0xf')]);}logger[_0x3377('0xe')](_0x3377('0x9'),_0x59f844,_0x37c2e4[_0x3377('0xe')][_0x3377('0xf')]);return _0xf5ab2a(_0x37c2e4['error'][_0x3377('0xf')]);}else{logger[_0x3377('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x59f844,_0x3377('0xa'));_0xf5ab2a(_0x37c2e4[_0x3377('0x11')]['message']);}})[_0x3377('0x12')](function(_0x14c0bd){logger[_0x3377('0xe')](_0x3377('0x9'),_0x59f844,_0x14c0bd);_0x4610ca(_0x14c0bd);});});}