Built motion from commit (unavailable).|2.5.4
[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 _0xb2c8=['info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x57a75a,_0x19c9c3){var _0x501768=function(_0x49c77f){while(--_0x49c77f){_0x57a75a['push'](_0x57a75a['shift']());}};_0x501768(++_0x19c9c3);}(_0xb2c8,0x10c));var _0x8b2c=function(_0x10dc4d,_0x5ba9f1){_0x10dc4d=_0x10dc4d-0x0;var _0x55307c=_0xb2c8[_0x10dc4d];return _0x55307c;};'use strict';var _=require(_0x8b2c('0x0'));var util=require('util');var moment=require(_0x8b2c('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b2c('0x2'));var fs=require('fs');var Redis=require(_0x8b2c('0x3'));var db=require(_0x8b2c('0x4'))['db'];var utils=require(_0x8b2c('0x5'));var logger=require(_0x8b2c('0x6'))('rpc');var config=require(_0x8b2c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b2c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3133d0,_0x56f5ba,_0x450bfd){return new BPromise(function(_0x45c287,_0x311f7b){return client[_0x8b2c('0x9')](_0x3133d0,_0x450bfd)['then'](function(_0x46bb43){logger['info'](_0x8b2c('0xa'),_0x56f5ba,_0x8b2c('0xb'));logger[_0x8b2c('0xc')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x56f5ba,_0x8b2c('0xb'),JSON[_0x8b2c('0xd')](_0x46bb43));if(_0x46bb43['error']){if(_0x46bb43[_0x8b2c('0xe')][_0x8b2c('0xf')]===0x1f4){logger[_0x8b2c('0xe')](_0x8b2c('0xa'),_0x56f5ba,_0x46bb43[_0x8b2c('0xe')][_0x8b2c('0x10')]);return _0x311f7b(_0x46bb43[_0x8b2c('0xe')][_0x8b2c('0x10')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x56f5ba,_0x46bb43[_0x8b2c('0xe')][_0x8b2c('0x10')]);return _0x45c287(_0x46bb43[_0x8b2c('0xe')][_0x8b2c('0x10')]);}else{logger[_0x8b2c('0x11')]('VoiceMail,\x20%s,\x20%s',_0x56f5ba,_0x8b2c('0xb'));_0x45c287(_0x46bb43['result']['message']);}})[_0x8b2c('0x12')](function(_0x348c97){logger[_0x8b2c('0xe')](_0x8b2c('0xa'),_0x56f5ba,_0x348c97);_0x311f7b(_0x348c97);});});}