Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / voiceTransferReport / voiceTransferReport.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 _0x331e=['then','request\x20sent','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','info','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x331e,0x18a));var _0xe331=function(_0x174202,_0x5c5292){_0x174202=_0x174202-0x0;var _0x4daa4a=_0x331e[_0x174202];return _0x4daa4a;};'use strict';var _=require(_0xe331('0x0'));var util=require(_0xe331('0x1'));var moment=require(_0xe331('0x2'));var BPromise=require(_0xe331('0x3'));var rs=require(_0xe331('0x4'));var fs=require('fs');var Redis=require(_0xe331('0x5'));var db=require(_0xe331('0x6'))['db'];var utils=require(_0xe331('0x7'));var logger=require(_0xe331('0x8'))('rpc');var config=require(_0xe331('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe331('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4896e6,_0x446770,_0x52c619){return new BPromise(function(_0x53f47f,_0x33f1ce){return client[_0xe331('0xb')](_0x4896e6,_0x52c619)[_0xe331('0xc')](function(_0x211386){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x446770,_0xe331('0xd'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x446770,_0xe331('0xd'),JSON['stringify'](_0x211386));if(_0x211386[_0xe331('0xe')]){if(_0x211386['error'][_0xe331('0xf')]===0x1f4){logger[_0xe331('0xe')](_0xe331('0x10'),_0x446770,_0x211386[_0xe331('0xe')][_0xe331('0x11')]);return _0x33f1ce(_0x211386[_0xe331('0xe')][_0xe331('0x11')]);}logger[_0xe331('0xe')](_0xe331('0x10'),_0x446770,_0x211386[_0xe331('0xe')][_0xe331('0x11')]);return _0x53f47f(_0x211386['error'][_0xe331('0x11')]);}else{logger['info'](_0xe331('0x10'),_0x446770,'request\x20sent');_0x53f47f(_0x211386[_0xe331('0x12')][_0xe331('0x11')]);}})[_0xe331('0x13')](function(_0x200447){logger[_0xe331('0xe')](_0xe331('0x10'),_0x446770,_0x200447);_0x33f1ce(_0x200447);});});}exports[_0xe331('0x14')]=function(_0x2c1a53){var _0xd5eec5=this;return new Promise(function(_0x2a4f5f,_0x2d0354){return db[_0xe331('0x15')][_0xe331('0x16')](_0x2c1a53[_0xe331('0x17')],{'raw':_0x2c1a53[_0xe331('0x18')]?_0x2c1a53[_0xe331('0x18')][_0xe331('0x19')]===undefined?!![]:![]:!![]})[_0xe331('0xc')](function(_0x35c900){logger[_0xe331('0x1a')](_0xe331('0x14'),_0x2c1a53);logger[_0xe331('0x1b')]('CreateVoiceTransferReport',_0x2c1a53,JSON[_0xe331('0x1c')](_0x35c900));_0x2a4f5f(_0x35c900);})['catch'](function(_0x23991b){logger['error'](_0xe331('0x14'),_0x23991b[_0xe331('0x11')],_0x2c1a53);_0x2d0354(_0xd5eec5[_0xe331('0xe')](0x1f4,_0x23991b[_0xe331('0x11')]));});});};