Built motion from commit da617fac.|2.6.6
[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 _0x0d06=['client','http','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2ebb38,_0x1ae950){var _0xc4f063=function(_0x2616e0){while(--_0x2616e0){_0x2ebb38['push'](_0x2ebb38['shift']());}};_0xc4f063(++_0x1ae950);}(_0x0d06,0xa8));var _0x60d0=function(_0x49b076,_0x4fb74e){_0x49b076=_0x49b076-0x0;var _0xa3609=_0x0d06[_0x49b076];return _0xa3609;};'use strict';var _=require(_0x60d0('0x0'));var util=require(_0x60d0('0x1'));var moment=require(_0x60d0('0x2'));var BPromise=require(_0x60d0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x60d0('0x4'))['db'];var utils=require(_0x60d0('0x5'));var logger=require(_0x60d0('0x6'))('rpc');var config=require(_0x60d0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x60d0('0x8')][_0x60d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12da81,_0x543eac,_0x1ab0af){return new BPromise(function(_0x1aea2f,_0xc75190){return client['request'](_0x12da81,_0x1ab0af)[_0x60d0('0xa')](function(_0x522a1b){logger['info'](_0x60d0('0xb'),_0x543eac,_0x60d0('0xc'));logger[_0x60d0('0xd')](_0x60d0('0xe'),_0x543eac,'request\x20sent',JSON[_0x60d0('0xf')](_0x522a1b));if(_0x522a1b['error']){if(_0x522a1b['error'][_0x60d0('0x10')]===0x1f4){logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x522a1b['error'][_0x60d0('0x12')]);return _0xc75190(_0x522a1b[_0x60d0('0x11')][_0x60d0('0x12')]);}logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x522a1b[_0x60d0('0x11')][_0x60d0('0x12')]);return _0x1aea2f(_0x522a1b[_0x60d0('0x11')]['message']);}else{logger[_0x60d0('0x13')]('VoiceMail,\x20%s,\x20%s',_0x543eac,_0x60d0('0xc'));_0x1aea2f(_0x522a1b[_0x60d0('0x14')][_0x60d0('0x12')]);}})[_0x60d0('0x15')](function(_0x4fd2e8){logger[_0x60d0('0x11')](_0x60d0('0xb'),_0x543eac,_0x4fd2e8);_0xc75190(_0x4fd2e8);});});}