e453d2a5350fe48bea5b35f76dfb0cbd6b29d330
[motion2.git] / server / api / voiceMail / voiceMail.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 _0xf4c2=['request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0xf4c2,0x17d));var _0x2f4c=function(_0x9857ae,_0x45b607){_0x9857ae=_0x9857ae-0x0;var _0x32a480=_0xf4c2[_0x9857ae];return _0x32a480;};'use strict';var _=require(_0x2f4c('0x0'));var util=require('util');var moment=require(_0x2f4c('0x1'));var BPromise=require(_0x2f4c('0x2'));var rs=require(_0x2f4c('0x3'));var fs=require('fs');var Redis=require(_0x2f4c('0x4'));var db=require(_0x2f4c('0x5'))['db'];var utils=require(_0x2f4c('0x6'));var logger=require(_0x2f4c('0x7'))(_0x2f4c('0x8'));var config=require(_0x2f4c('0x9'));var jayson=require(_0x2f4c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcb8276,_0x268748,_0x5a0946){return new BPromise(function(_0x44b95c,_0x1d0f9b){return client[_0x2f4c('0xb')](_0xcb8276,_0x5a0946)[_0x2f4c('0xc')](function(_0x1b1f0a){logger[_0x2f4c('0xd')](_0x2f4c('0xe'),_0x268748,_0x2f4c('0xf'));logger['debug'](_0x2f4c('0x10'),_0x268748,_0x2f4c('0xf'),JSON[_0x2f4c('0x11')](_0x1b1f0a));if(_0x1b1f0a['error']){if(_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x13')]===0x1f4){logger['error'](_0x2f4c('0xe'),_0x268748,_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x14')]);return _0x1d0f9b(_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x14')]);}logger[_0x2f4c('0x12')](_0x2f4c('0xe'),_0x268748,_0x1b1f0a[_0x2f4c('0x12')]['message']);return _0x44b95c(_0x1b1f0a[_0x2f4c('0x12')][_0x2f4c('0x14')]);}else{logger[_0x2f4c('0xd')](_0x2f4c('0xe'),_0x268748,_0x2f4c('0xf'));_0x44b95c(_0x1b1f0a['result'][_0x2f4c('0x14')]);}})[_0x2f4c('0x15')](function(_0x52ba57){logger[_0x2f4c('0x12')](_0x2f4c('0xe'),_0x268748,_0x52ba57);_0x1d0f9b(_0x52ba57);});});}