Built motion from commit (unavailable).|2.5.3
[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 _0x4ea0=['then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x5835a5,_0x3f6244){var _0x2e137e=function(_0x59781a){while(--_0x59781a){_0x5835a5['push'](_0x5835a5['shift']());}};_0x2e137e(++_0x3f6244);}(_0x4ea0,0xc7));var _0x04ea=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x4ea0[_0x5a9c0c];return _0x53c77d;};'use strict';var _=require(_0x04ea('0x0'));var util=require('util');var moment=require(_0x04ea('0x1'));var BPromise=require(_0x04ea('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04ea('0x3'));var db=require(_0x04ea('0x4'))['db'];var utils=require(_0x04ea('0x5'));var logger=require('../../config/logger')(_0x04ea('0x6'));var config=require('../../config/environment');var jayson=require(_0x04ea('0x7'));var client=jayson[_0x04ea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x366968,_0x10c36b,_0x2892eb){return new BPromise(function(_0x47c0e7,_0x1117e2){return client[_0x04ea('0x9')](_0x366968,_0x2892eb)[_0x04ea('0xa')](function(_0x21a4e5){logger[_0x04ea('0xb')](_0x04ea('0xc'),_0x10c36b,'request\x20sent');logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x10c36b,_0x04ea('0xd'),JSON[_0x04ea('0xe')](_0x21a4e5));if(_0x21a4e5[_0x04ea('0xf')]){if(_0x21a4e5[_0x04ea('0xf')][_0x04ea('0x10')]===0x1f4){logger[_0x04ea('0xf')](_0x04ea('0xc'),_0x10c36b,_0x21a4e5[_0x04ea('0xf')][_0x04ea('0x11')]);return _0x1117e2(_0x21a4e5[_0x04ea('0xf')][_0x04ea('0x11')]);}logger[_0x04ea('0xf')](_0x04ea('0xc'),_0x10c36b,_0x21a4e5[_0x04ea('0xf')][_0x04ea('0x11')]);return _0x47c0e7(_0x21a4e5['error']['message']);}else{logger[_0x04ea('0xb')](_0x04ea('0xc'),_0x10c36b,_0x04ea('0xd'));_0x47c0e7(_0x21a4e5['result'][_0x04ea('0x11')]);}})[_0x04ea('0x12')](function(_0x4c745e){logger['error'](_0x04ea('0xc'),_0x10c36b,_0x4c745e);_0x1117e2(_0x4c745e);});});}