Built motion from commit (unavailable).|2.5.6
[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 _0x2a41=['CreateVoiceTransferReport','VoiceTransferReport','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0xbfc001,_0x417027){var _0x5592bc=function(_0x5558e0){while(--_0x5558e0){_0xbfc001['push'](_0xbfc001['shift']());}};_0x5592bc(++_0x417027);}(_0x2a41,0x126));var _0x12a4=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0x2a41[_0x34df4a];return _0x145c69;};'use strict';var _=require(_0x12a4('0x0'));var util=require('util');var moment=require(_0x12a4('0x1'));var BPromise=require(_0x12a4('0x2'));var rs=require(_0x12a4('0x3'));var fs=require('fs');var Redis=require(_0x12a4('0x4'));var db=require(_0x12a4('0x5'))['db'];var utils=require(_0x12a4('0x6'));var logger=require(_0x12a4('0x7'))(_0x12a4('0x8'));var config=require(_0x12a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x12a4('0xa')][_0x12a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58fffc,_0x5d2353,_0x2042cc){return new BPromise(function(_0x5ae867,_0x23bb59){return client[_0x12a4('0xc')](_0x58fffc,_0x2042cc)[_0x12a4('0xd')](function(_0x38d894){logger[_0x12a4('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x5d2353,_0x12a4('0xf'));logger[_0x12a4('0x10')](_0x12a4('0x11'),_0x5d2353,_0x12a4('0xf'),JSON[_0x12a4('0x12')](_0x38d894));if(_0x38d894[_0x12a4('0x13')]){if(_0x38d894[_0x12a4('0x13')][_0x12a4('0x14')]===0x1f4){logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x38d894[_0x12a4('0x13')][_0x12a4('0x16')]);return _0x23bb59(_0x38d894['error'][_0x12a4('0x16')]);}logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x38d894[_0x12a4('0x13')][_0x12a4('0x16')]);return _0x5ae867(_0x38d894['error']['message']);}else{logger[_0x12a4('0xe')](_0x12a4('0x15'),_0x5d2353,_0x12a4('0xf'));_0x5ae867(_0x38d894[_0x12a4('0x17')]['message']);}})[_0x12a4('0x18')](function(_0x28d311){logger[_0x12a4('0x13')](_0x12a4('0x15'),_0x5d2353,_0x28d311);_0x23bb59(_0x28d311);});});}exports[_0x12a4('0x19')]=function(_0xe274e1){var _0x4d7c49=this;return new Promise(function(_0x1a6bbe,_0x3a783c){return db[_0x12a4('0x1a')]['create'](_0xe274e1['body'],{'raw':_0xe274e1[_0x12a4('0x1b')]?_0xe274e1[_0x12a4('0x1b')][_0x12a4('0x1c')]===undefined?!![]:![]:!![]})[_0x12a4('0xd')](function(_0x1a35d3){logger['info'](_0x12a4('0x19'),_0xe274e1);logger['debug'](_0x12a4('0x19'),_0xe274e1,JSON[_0x12a4('0x12')](_0x1a35d3));_0x1a6bbe(_0x1a35d3);})[_0x12a4('0x18')](function(_0x475939){logger[_0x12a4('0x13')]('CreateVoiceTransferReport',_0x475939[_0x12a4('0x16')],_0xe274e1);_0x3a783c(_0x4d7c49[_0x12a4('0x13')](0x1f4,_0x475939[_0x12a4('0x16')]));});});};