Built motion from commit 9d0783e6.|2.6.13
[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 _0x52c8=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util'];(function(_0xfe9f9d,_0x399d13){var _0x4bb558=function(_0x58196b){while(--_0x58196b){_0xfe9f9d['push'](_0xfe9f9d['shift']());}};_0x4bb558(++_0x399d13);}(_0x52c8,0x164));var _0x852c=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x52c8[_0x37ffea];return _0x2e2615;};'use strict';var _=require('lodash');var util=require(_0x852c('0x0'));var moment=require('moment');var BPromise=require(_0x852c('0x1'));var rs=require(_0x852c('0x2'));var fs=require('fs');var Redis=require(_0x852c('0x3'));var db=require(_0x852c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x852c('0x5'));var config=require(_0x852c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x852c('0x7')][_0x852c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13298b,_0xc6aec,_0x92705c){return new BPromise(function(_0x4f4854,_0x2e1ea1){return client[_0x852c('0x9')](_0x13298b,_0x92705c)['then'](function(_0xc32a30){logger[_0x852c('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0xc6aec,_0x852c('0xb'));logger[_0x852c('0xc')](_0x852c('0xd'),_0xc6aec,_0x852c('0xb'),JSON[_0x852c('0xe')](_0xc32a30));if(_0xc32a30[_0x852c('0xf')]){if(_0xc32a30[_0x852c('0xf')][_0x852c('0x10')]===0x1f4){logger['error'](_0x852c('0x11'),_0xc6aec,_0xc32a30[_0x852c('0xf')][_0x852c('0x12')]);return _0x2e1ea1(_0xc32a30[_0x852c('0xf')]['message']);}logger[_0x852c('0xf')](_0x852c('0x11'),_0xc6aec,_0xc32a30[_0x852c('0xf')][_0x852c('0x12')]);return _0x4f4854(_0xc32a30[_0x852c('0xf')]['message']);}else{logger[_0x852c('0xa')](_0x852c('0x11'),_0xc6aec,_0x852c('0xb'));_0x4f4854(_0xc32a30[_0x852c('0x13')][_0x852c('0x12')]);}})[_0x852c('0x14')](function(_0x434a9c){logger[_0x852c('0xf')](_0x852c('0x11'),_0xc6aec,_0x434a9c);_0x2e1ea1(_0x434a9c);});});}