Built motion from commit 9e1399f3.|2.5.37
[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 _0x5139=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util'];(function(_0x30cbb9,_0x226d5d){var _0x52be29=function(_0x1e805d){while(--_0x1e805d){_0x30cbb9['push'](_0x30cbb9['shift']());}};_0x52be29(++_0x226d5d);}(_0x5139,0xe4));var _0x9513=function(_0x10655d,_0x4fa617){_0x10655d=_0x10655d-0x0;var _0x517ad6=_0x5139[_0x10655d];return _0x517ad6;};'use strict';var _=require(_0x9513('0x0'));var util=require(_0x9513('0x1'));var moment=require(_0x9513('0x2'));var BPromise=require(_0x9513('0x3'));var rs=require(_0x9513('0x4'));var fs=require('fs');var Redis=require(_0x9513('0x5'));var db=require(_0x9513('0x6'))['db'];var utils=require(_0x9513('0x7'));var logger=require('../../config/logger')(_0x9513('0x8'));var config=require(_0x9513('0x9'));var jayson=require(_0x9513('0xa'));var client=jayson[_0x9513('0xb')][_0x9513('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d16d1,_0x40b9d8,_0x1d369c){return new BPromise(function(_0x51d956,_0x27b6af){return client[_0x9513('0xd')](_0x2d16d1,_0x1d369c)[_0x9513('0xe')](function(_0x4e180d){logger[_0x9513('0xf')](_0x9513('0x10'),_0x40b9d8,_0x9513('0x11'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x40b9d8,'request\x20sent',JSON['stringify'](_0x4e180d));if(_0x4e180d[_0x9513('0x12')]){if(_0x4e180d[_0x9513('0x12')][_0x9513('0x13')]===0x1f4){logger['error'](_0x9513('0x10'),_0x40b9d8,_0x4e180d['error'][_0x9513('0x14')]);return _0x27b6af(_0x4e180d[_0x9513('0x12')][_0x9513('0x14')]);}logger['error'](_0x9513('0x10'),_0x40b9d8,_0x4e180d[_0x9513('0x12')]['message']);return _0x51d956(_0x4e180d['error'][_0x9513('0x14')]);}else{logger[_0x9513('0xf')]('VoiceMail,\x20%s,\x20%s',_0x40b9d8,_0x9513('0x11'));_0x51d956(_0x4e180d[_0x9513('0x15')][_0x9513('0x14')]);}})[_0x9513('0x16')](function(_0x23e5f8){logger[_0x9513('0x12')](_0x9513('0x10'),_0x40b9d8,_0x23e5f8);_0x27b6af(_0x23e5f8);});});}