Built motion from commit f6d7e26c.|2.6.14
[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 _0xf696=['raw','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options'];(function(_0x13283f,_0x34efb4){var _0x5ec63a=function(_0x48f499){while(--_0x48f499){_0x13283f['push'](_0x13283f['shift']());}};_0x5ec63a(++_0x34efb4);}(_0xf696,0x1c3));var _0x6f69=function(_0x2c7514,_0x4caeb9){_0x2c7514=_0x2c7514-0x0;var _0x182d8a=_0xf696[_0x2c7514];return _0x182d8a;};'use strict';var _=require(_0x6f69('0x0'));var util=require(_0x6f69('0x1'));var moment=require(_0x6f69('0x2'));var BPromise=require(_0x6f69('0x3'));var rs=require(_0x6f69('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6f69('0x5'))['db'];var utils=require(_0x6f69('0x6'));var logger=require(_0x6f69('0x7'))(_0x6f69('0x8'));var config=require(_0x6f69('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6f69('0xa')][_0x6f69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x336c10,_0x2d0da7,_0x2d8f09){return new BPromise(function(_0x56e2cc,_0x22b838){return client[_0x6f69('0xc')](_0x336c10,_0x2d8f09)['then'](function(_0x271472){logger['info'](_0x6f69('0xd'),_0x2d0da7,'request\x20sent');logger[_0x6f69('0xe')](_0x6f69('0xf'),_0x2d0da7,_0x6f69('0x10'),JSON['stringify'](_0x271472));if(_0x271472['error']){if(_0x271472[_0x6f69('0x11')]['code']===0x1f4){logger[_0x6f69('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2d0da7,_0x271472[_0x6f69('0x11')][_0x6f69('0x12')]);return _0x22b838(_0x271472[_0x6f69('0x11')]['message']);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2d0da7,_0x271472[_0x6f69('0x11')]['message']);return _0x56e2cc(_0x271472[_0x6f69('0x11')][_0x6f69('0x12')]);}else{logger[_0x6f69('0x13')](_0x6f69('0xd'),_0x2d0da7,'request\x20sent');_0x56e2cc(_0x271472['result']['message']);}})[_0x6f69('0x14')](function(_0x4f9f08){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x2d0da7,_0x4f9f08);_0x22b838(_0x4f9f08);});});}exports[_0x6f69('0x15')]=function(_0x3624da){var _0x47b5ee=this;return new Promise(function(_0xee6b8d,_0x23ca35){return db[_0x6f69('0x16')][_0x6f69('0x17')](_0x3624da['body'],{'raw':_0x3624da[_0x6f69('0x18')]?_0x3624da[_0x6f69('0x18')][_0x6f69('0x19')]===undefined?!![]:![]:!![]})[_0x6f69('0x1a')](function(_0x337b0d){logger[_0x6f69('0x13')](_0x6f69('0x15'),_0x3624da);logger[_0x6f69('0xe')](_0x6f69('0x15'),_0x3624da,JSON[_0x6f69('0x1b')](_0x337b0d));_0xee6b8d(_0x337b0d);})[_0x6f69('0x14')](function(_0x406470){logger[_0x6f69('0x11')](_0x6f69('0x15'),_0x406470[_0x6f69('0x12')],_0x3624da);_0x23ca35(_0x47b5ee[_0x6f69('0x11')](0x1f4,_0x406470['message']));});});};