Built motion from commit 85328c08.|2.5.50
[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 _0x67e2=['moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceTransferReport','create','body','options','raw','lodash','util'];(function(_0x28ae24,_0x5741c0){var _0x4e22c5=function(_0x1256d6){while(--_0x1256d6){_0x28ae24['push'](_0x28ae24['shift']());}};_0x4e22c5(++_0x5741c0);}(_0x67e2,0x116));var _0x267e=function(_0x37d19b,_0x4cf238){_0x37d19b=_0x37d19b-0x0;var _0x5661ea=_0x67e2[_0x37d19b];return _0x5661ea;};'use strict';var _=require(_0x267e('0x0'));var util=require(_0x267e('0x1'));var moment=require(_0x267e('0x2'));var BPromise=require(_0x267e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x267e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x267e('0x5'))(_0x267e('0x6'));var config=require(_0x267e('0x7'));var jayson=require(_0x267e('0x8'));var client=jayson[_0x267e('0x9')][_0x267e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55accd,_0x492b01,_0x26a648){return new BPromise(function(_0x3baed9,_0x2459db){return client[_0x267e('0xb')](_0x55accd,_0x26a648)[_0x267e('0xc')](function(_0x4c7e7c){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x492b01,_0x267e('0xd'));logger[_0x267e('0xe')](_0x267e('0xf'),_0x492b01,_0x267e('0xd'),JSON[_0x267e('0x10')](_0x4c7e7c));if(_0x4c7e7c[_0x267e('0x11')]){if(_0x4c7e7c[_0x267e('0x11')]['code']===0x1f4){logger[_0x267e('0x11')](_0x267e('0x12'),_0x492b01,_0x4c7e7c[_0x267e('0x11')][_0x267e('0x13')]);return _0x2459db(_0x4c7e7c[_0x267e('0x11')][_0x267e('0x13')]);}logger[_0x267e('0x11')](_0x267e('0x12'),_0x492b01,_0x4c7e7c[_0x267e('0x11')]['message']);return _0x3baed9(_0x4c7e7c[_0x267e('0x11')][_0x267e('0x13')]);}else{logger[_0x267e('0x14')](_0x267e('0x12'),_0x492b01,_0x267e('0xd'));_0x3baed9(_0x4c7e7c[_0x267e('0x15')][_0x267e('0x13')]);}})[_0x267e('0x16')](function(_0x5e1133){logger[_0x267e('0x11')](_0x267e('0x12'),_0x492b01,_0x5e1133);_0x2459db(_0x5e1133);});});}exports[_0x267e('0x17')]=function(_0x1f31d5){var _0x1fb403=this;return new Promise(function(_0x48575d,_0x317e74){return db['VoiceTransferReport'][_0x267e('0x18')](_0x1f31d5[_0x267e('0x19')],{'raw':_0x1f31d5[_0x267e('0x1a')]?_0x1f31d5[_0x267e('0x1a')][_0x267e('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x57c4d1){logger[_0x267e('0x14')]('CreateVoiceTransferReport',_0x1f31d5);logger[_0x267e('0xe')](_0x267e('0x17'),_0x1f31d5,JSON[_0x267e('0x10')](_0x57c4d1));_0x48575d(_0x57c4d1);})[_0x267e('0x16')](function(_0x3e7a15){logger[_0x267e('0x11')](_0x267e('0x17'),_0x3e7a15[_0x267e('0x13')],_0x1f31d5);_0x317e74(_0x1fb403[_0x267e('0x11')](0x1f4,_0x3e7a15[_0x267e('0x13')]));});});};