Built motion from commit (unavailable).|2.3.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 _0x16f9=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','VoiceMail,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird'];(function(_0x156578,_0x180b06){var _0x3d4cee=function(_0x5e0c58){while(--_0x5e0c58){_0x156578['push'](_0x156578['shift']());}};_0x3d4cee(++_0x180b06);}(_0x16f9,0x89));var _0x916f=function(_0x4baa4f,_0x9b3d37){_0x4baa4f=_0x4baa4f-0x0;var _0x8a206d=_0x16f9[_0x4baa4f];return _0x8a206d;};'use strict';var _=require('lodash');var util=require(_0x916f('0x0'));var moment=require(_0x916f('0x1'));var BPromise=require(_0x916f('0x2'));var rs=require(_0x916f('0x3'));var fs=require('fs');var Redis=require(_0x916f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x916f('0x5'))(_0x916f('0x6'));var config=require(_0x916f('0x7'));var jayson=require(_0x916f('0x8'));var client=jayson[_0x916f('0x9')][_0x916f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x229005,_0x41e359,_0x3fede6){return new BPromise(function(_0x5e7072,_0x229224){return client[_0x916f('0xb')](_0x229005,_0x3fede6)[_0x916f('0xc')](function(_0x37b95b){logger['info']('VoiceMail,\x20%s,\x20%s',_0x41e359,'request\x20sent');logger['debug'](_0x916f('0xd'),_0x41e359,'request\x20sent',JSON['stringify'](_0x37b95b));if(_0x37b95b[_0x916f('0xe')]){if(_0x37b95b[_0x916f('0xe')][_0x916f('0xf')]===0x1f4){logger[_0x916f('0xe')](_0x916f('0x10'),_0x41e359,_0x37b95b['error'][_0x916f('0x11')]);return _0x229224(_0x37b95b['error'][_0x916f('0x11')]);}logger[_0x916f('0xe')](_0x916f('0x10'),_0x41e359,_0x37b95b['error'][_0x916f('0x11')]);return _0x5e7072(_0x37b95b['error'][_0x916f('0x11')]);}else{logger['info'](_0x916f('0x10'),_0x41e359,_0x916f('0x12'));_0x5e7072(_0x37b95b['result'][_0x916f('0x11')]);}})[_0x916f('0x13')](function(_0x44c083){logger['error'](_0x916f('0x10'),_0x41e359,_0x44c083);_0x229224(_0x44c083);});});}