d79051742beec4b759f7918cf4d650f685678aff
[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 _0x028a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0x028a,0x16e));var _0xa028=function(_0x2f5f1d,_0x4ebf78){_0x2f5f1d=_0x2f5f1d-0x0;var _0x428b2e=_0x028a[_0x2f5f1d];return _0x428b2e;};'use strict';var _=require(_0xa028('0x0'));var util=require('util');var moment=require(_0xa028('0x1'));var BPromise=require(_0xa028('0x2'));var rs=require(_0xa028('0x3'));var fs=require('fs');var Redis=require(_0xa028('0x4'));var db=require(_0xa028('0x5'))['db'];var utils=require(_0xa028('0x6'));var logger=require(_0xa028('0x7'))(_0xa028('0x8'));var config=require(_0xa028('0x9'));var jayson=require(_0xa028('0xa'));var client=jayson[_0xa028('0xb')][_0xa028('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1bc172,_0x25c157,_0x17a63c){return new BPromise(function(_0x4ac778,_0x4c63e2){return client[_0xa028('0xd')](_0x1bc172,_0x17a63c)[_0xa028('0xe')](function(_0x9dc32f){logger[_0xa028('0xf')](_0xa028('0x10'),_0x25c157,_0xa028('0x11'));logger['debug'](_0xa028('0x12'),_0x25c157,_0xa028('0x11'),JSON['stringify'](_0x9dc32f));if(_0x9dc32f[_0xa028('0x13')]){if(_0x9dc32f[_0xa028('0x13')]['code']===0x1f4){logger[_0xa028('0x13')](_0xa028('0x10'),_0x25c157,_0x9dc32f[_0xa028('0x13')][_0xa028('0x14')]);return _0x4c63e2(_0x9dc32f[_0xa028('0x13')][_0xa028('0x14')]);}logger['error'](_0xa028('0x10'),_0x25c157,_0x9dc32f[_0xa028('0x13')][_0xa028('0x14')]);return _0x4ac778(_0x9dc32f[_0xa028('0x13')][_0xa028('0x14')]);}else{logger[_0xa028('0xf')](_0xa028('0x10'),_0x25c157,_0xa028('0x11'));_0x4ac778(_0x9dc32f[_0xa028('0x15')]['message']);}})[_0xa028('0x16')](function(_0x2da2c0){logger[_0xa028('0x13')](_0xa028('0x10'),_0x25c157,_0x2da2c0);_0x4c63e2(_0x2da2c0);});});}