Built motion from commit (unavailable).|2.5.22
[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 _0x64c4=['request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x64c4,0xdd));var _0x464c=function(_0x4386e1,_0xf1b15d){_0x4386e1=_0x4386e1-0x0;var _0xd3ce47=_0x64c4[_0x4386e1];return _0xd3ce47;};'use strict';var _=require(_0x464c('0x0'));var util=require(_0x464c('0x1'));var moment=require(_0x464c('0x2'));var BPromise=require(_0x464c('0x3'));var rs=require(_0x464c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x464c('0x5'));var logger=require(_0x464c('0x6'))(_0x464c('0x7'));var config=require(_0x464c('0x8'));var jayson=require(_0x464c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26e18b,_0x2d5e98,_0x2aa80c){return new BPromise(function(_0x18db51,_0x222b54){return client[_0x464c('0xa')](_0x26e18b,_0x2aa80c)['then'](function(_0x270d89){logger[_0x464c('0xb')](_0x464c('0xc'),_0x2d5e98,_0x464c('0xd'));logger[_0x464c('0xe')](_0x464c('0xf'),_0x2d5e98,_0x464c('0xd'),JSON[_0x464c('0x10')](_0x270d89));if(_0x270d89[_0x464c('0x11')]){if(_0x270d89['error'][_0x464c('0x12')]===0x1f4){logger['error'](_0x464c('0xc'),_0x2d5e98,_0x270d89[_0x464c('0x11')][_0x464c('0x13')]);return _0x222b54(_0x270d89[_0x464c('0x11')][_0x464c('0x13')]);}logger[_0x464c('0x11')](_0x464c('0xc'),_0x2d5e98,_0x270d89[_0x464c('0x11')][_0x464c('0x13')]);return _0x18db51(_0x270d89[_0x464c('0x11')][_0x464c('0x13')]);}else{logger[_0x464c('0xb')](_0x464c('0xc'),_0x2d5e98,_0x464c('0xd'));_0x18db51(_0x270d89['result'][_0x464c('0x13')]);}})[_0x464c('0x14')](function(_0x102ba1){logger[_0x464c('0x11')]('VoiceMail,\x20%s,\x20%s',_0x2d5e98,_0x102ba1);_0x222b54(_0x102ba1);});});}