Built motion from commit ffdca78c.|2.6.24
[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 _0xfe21=['VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x353af4,_0x114c45){var _0x1375b0=function(_0x4db7a6){while(--_0x4db7a6){_0x353af4['push'](_0x353af4['shift']());}};_0x1375b0(++_0x114c45);}(_0xfe21,0x1d3));var _0x1fe2=function(_0x1635db,_0x4a27cc){_0x1635db=_0x1635db-0x0;var _0x27215c=_0xfe21[_0x1635db];return _0x27215c;};'use strict';var _=require(_0x1fe2('0x0'));var util=require(_0x1fe2('0x1'));var moment=require('moment');var BPromise=require(_0x1fe2('0x2'));var rs=require(_0x1fe2('0x3'));var fs=require('fs');var Redis=require(_0x1fe2('0x4'));var db=require(_0x1fe2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1fe2('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1fe2('0x7'));var client=jayson[_0x1fe2('0x8')][_0x1fe2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2abc54,_0x141e87,_0x33f878){return new BPromise(function(_0x31a12c,_0x5dbeec){return client[_0x1fe2('0xa')](_0x2abc54,_0x33f878)[_0x1fe2('0xb')](function(_0x53d56b){logger[_0x1fe2('0xc')](_0x1fe2('0xd'),_0x141e87,_0x1fe2('0xe'));logger[_0x1fe2('0xf')](_0x1fe2('0x10'),_0x141e87,_0x1fe2('0xe'),JSON['stringify'](_0x53d56b));if(_0x53d56b[_0x1fe2('0x11')]){if(_0x53d56b[_0x1fe2('0x11')]['code']===0x1f4){logger[_0x1fe2('0x11')]('VoiceMail,\x20%s,\x20%s',_0x141e87,_0x53d56b[_0x1fe2('0x11')]['message']);return _0x5dbeec(_0x53d56b[_0x1fe2('0x11')][_0x1fe2('0x12')]);}logger[_0x1fe2('0x11')](_0x1fe2('0xd'),_0x141e87,_0x53d56b[_0x1fe2('0x11')]['message']);return _0x31a12c(_0x53d56b[_0x1fe2('0x11')][_0x1fe2('0x12')]);}else{logger[_0x1fe2('0xc')]('VoiceMail,\x20%s,\x20%s',_0x141e87,_0x1fe2('0xe'));_0x31a12c(_0x53d56b['result'][_0x1fe2('0x12')]);}})[_0x1fe2('0x13')](function(_0x3480ef){logger[_0x1fe2('0x11')]('VoiceMail,\x20%s,\x20%s',_0x141e87,_0x3480ef);_0x5dbeec(_0x3480ef);});});}