Built motion from commit (unavailable).|2.5.2
[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 _0x5fdb=['message','result','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x547e20,_0x284545){var _0x359171=function(_0x590250){while(--_0x590250){_0x547e20['push'](_0x547e20['shift']());}};_0x359171(++_0x284545);}(_0x5fdb,0x192));var _0xb5fd=function(_0x5f24db,_0x32ea78){_0x5f24db=_0x5f24db-0x0;var _0x3c25bf=_0x5fdb[_0x5f24db];return _0x3c25bf;};'use strict';var _=require(_0xb5fd('0x0'));var util=require('util');var moment=require(_0xb5fd('0x1'));var BPromise=require(_0xb5fd('0x2'));var rs=require(_0xb5fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb5fd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb5fd('0x5'));var jayson=require(_0xb5fd('0x6'));var client=jayson[_0xb5fd('0x7')][_0xb5fd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xda489e,_0x19cc1e,_0x1ec464){return new BPromise(function(_0x269c22,_0x1619bd){return client['request'](_0xda489e,_0x1ec464)[_0xb5fd('0x9')](function(_0x79ca84){logger[_0xb5fd('0xa')](_0xb5fd('0xb'),_0x19cc1e,_0xb5fd('0xc'));logger[_0xb5fd('0xd')](_0xb5fd('0xe'),_0x19cc1e,'request\x20sent',JSON[_0xb5fd('0xf')](_0x79ca84));if(_0x79ca84[_0xb5fd('0x10')]){if(_0x79ca84['error'][_0xb5fd('0x11')]===0x1f4){logger[_0xb5fd('0x10')](_0xb5fd('0xb'),_0x19cc1e,_0x79ca84[_0xb5fd('0x10')][_0xb5fd('0x12')]);return _0x1619bd(_0x79ca84['error'][_0xb5fd('0x12')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x19cc1e,_0x79ca84['error'][_0xb5fd('0x12')]);return _0x269c22(_0x79ca84[_0xb5fd('0x10')][_0xb5fd('0x12')]);}else{logger[_0xb5fd('0xa')](_0xb5fd('0xb'),_0x19cc1e,_0xb5fd('0xc'));_0x269c22(_0x79ca84[_0xb5fd('0x13')][_0xb5fd('0x12')]);}})[_0xb5fd('0x14')](function(_0x295390){logger[_0xb5fd('0x10')](_0xb5fd('0xb'),_0x19cc1e,_0x295390);_0x1619bd(_0x295390);});});}