Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / voiceMailMessage / voiceMailMessage.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 _0xae01=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xae01,0x12c));var _0x1ae0=function(_0x176837,_0x461f51){_0x176837=_0x176837-0x0;var _0x44d97b=_0xae01[_0x176837];return _0x44d97b;};'use strict';var _=require(_0x1ae0('0x0'));var util=require(_0x1ae0('0x1'));var moment=require(_0x1ae0('0x2'));var BPromise=require(_0x1ae0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1ae0('0x4'));var logger=require(_0x1ae0('0x5'))(_0x1ae0('0x6'));var config=require(_0x1ae0('0x7'));var jayson=require(_0x1ae0('0x8'));var client=jayson[_0x1ae0('0x9')][_0x1ae0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c4752,_0x31202f,_0x2779b6){return new BPromise(function(_0x2b8e82,_0x766ccd){return client[_0x1ae0('0xb')](_0x4c4752,_0x2779b6)[_0x1ae0('0xc')](function(_0x51c6cc){logger[_0x1ae0('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x31202f,_0x1ae0('0xe'));logger['debug'](_0x1ae0('0xf'),_0x31202f,_0x1ae0('0xe'),JSON[_0x1ae0('0x10')](_0x51c6cc));if(_0x51c6cc[_0x1ae0('0x11')]){if(_0x51c6cc[_0x1ae0('0x11')]['code']===0x1f4){logger[_0x1ae0('0x11')](_0x1ae0('0x12'),_0x31202f,_0x51c6cc[_0x1ae0('0x11')][_0x1ae0('0x13')]);return _0x766ccd(_0x51c6cc[_0x1ae0('0x11')][_0x1ae0('0x13')]);}logger[_0x1ae0('0x11')](_0x1ae0('0x12'),_0x31202f,_0x51c6cc[_0x1ae0('0x11')][_0x1ae0('0x13')]);return _0x2b8e82(_0x51c6cc[_0x1ae0('0x11')]['message']);}else{logger[_0x1ae0('0xd')](_0x1ae0('0x12'),_0x31202f,'request\x20sent');_0x2b8e82(_0x51c6cc['result']['message']);}})[_0x1ae0('0x14')](function(_0x20705a){logger[_0x1ae0('0x11')](_0x1ae0('0x12'),_0x31202f,_0x20705a);_0x766ccd(_0x20705a);});});}