Built motion from commit (unavailable).|2.3.1
[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 _0xa7c5=['jayson/promise','client','http','request','info','request\x20sent','debug','error','message','VoiceMailMessage,\x20%s,\x20%s','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3fb5c3,_0x5b134d){var _0x2f3dbc=function(_0x49066d){while(--_0x49066d){_0x3fb5c3['push'](_0x3fb5c3['shift']());}};_0x2f3dbc(++_0x5b134d);}(_0xa7c5,0x8a));var _0x5a7c=function(_0xffe87b,_0x3daf3f){_0xffe87b=_0xffe87b-0x0;var _0xfdcc47=_0xa7c5[_0xffe87b];return _0xfdcc47;};'use strict';var _=require(_0x5a7c('0x0'));var util=require(_0x5a7c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a7c('0x2'));var fs=require('fs');var Redis=require(_0x5a7c('0x3'));var db=require(_0x5a7c('0x4'))['db'];var utils=require(_0x5a7c('0x5'));var logger=require(_0x5a7c('0x6'))(_0x5a7c('0x7'));var config=require(_0x5a7c('0x8'));var jayson=require(_0x5a7c('0x9'));var client=jayson[_0x5a7c('0xa')][_0x5a7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4573c7,_0x57ec6c,_0x45992b){return new BPromise(function(_0x4d4cd0,_0xc9ab25){return client[_0x5a7c('0xc')](_0x4573c7,_0x45992b)['then'](function(_0x1e89c2){logger[_0x5a7c('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x57ec6c,_0x5a7c('0xe'));logger[_0x5a7c('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x57ec6c,'request\x20sent',JSON['stringify'](_0x1e89c2));if(_0x1e89c2[_0x5a7c('0x10')]){if(_0x1e89c2[_0x5a7c('0x10')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x57ec6c,_0x1e89c2[_0x5a7c('0x10')]['message']);return _0xc9ab25(_0x1e89c2[_0x5a7c('0x10')][_0x5a7c('0x11')]);}logger[_0x5a7c('0x10')](_0x5a7c('0x12'),_0x57ec6c,_0x1e89c2[_0x5a7c('0x10')][_0x5a7c('0x11')]);return _0x4d4cd0(_0x1e89c2['error']['message']);}else{logger[_0x5a7c('0xd')](_0x5a7c('0x12'),_0x57ec6c,_0x5a7c('0xe'));_0x4d4cd0(_0x1e89c2[_0x5a7c('0x13')][_0x5a7c('0x11')]);}})[_0x5a7c('0x14')](function(_0x1c96da){logger[_0x5a7c('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x57ec6c,_0x1c96da);_0xc9ab25(_0x1c96da);});});}