a12ec0e929d670e49a217b4ea3d60f4f3c7618d4
[motion2.git] / server / api / voiceMailMessage / voiceMailMessage.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 _0x94bd=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x94bd,0x1a0));var _0xd94b=function(_0x82335b,_0x323175){_0x82335b=_0x82335b-0x0;var _0x530cff=_0x94bd[_0x82335b];return _0x530cff;};'use strict';var _=require('lodash');var util=require(_0xd94b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd94b('0x1'));var fs=require('fs');var Redis=require(_0xd94b('0x2'));var db=require(_0xd94b('0x3'))['db'];var utils=require(_0xd94b('0x4'));var logger=require(_0xd94b('0x5'))(_0xd94b('0x6'));var config=require(_0xd94b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd94b('0x8')][_0xd94b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xecf431,_0x501b6d,_0x4e26b9){return new BPromise(function(_0x5ed55e,_0x180042){return client['request'](_0xecf431,_0x4e26b9)[_0xd94b('0xa')](function(_0x1cab6b){logger[_0xd94b('0xb')](_0xd94b('0xc'),_0x501b6d,'request\x20sent');logger['debug']('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x501b6d,_0xd94b('0xd'),JSON[_0xd94b('0xe')](_0x1cab6b));if(_0x1cab6b[_0xd94b('0xf')]){if(_0x1cab6b[_0xd94b('0xf')][_0xd94b('0x10')]===0x1f4){logger[_0xd94b('0xf')](_0xd94b('0xc'),_0x501b6d,_0x1cab6b['error']['message']);return _0x180042(_0x1cab6b[_0xd94b('0xf')][_0xd94b('0x11')]);}logger[_0xd94b('0xf')](_0xd94b('0xc'),_0x501b6d,_0x1cab6b['error']['message']);return _0x5ed55e(_0x1cab6b['error']['message']);}else{logger[_0xd94b('0xb')](_0xd94b('0xc'),_0x501b6d,'request\x20sent');_0x5ed55e(_0x1cab6b[_0xd94b('0x12')][_0xd94b('0x11')]);}})[_0xd94b('0x13')](function(_0x540df2){logger[_0xd94b('0xf')](_0xd94b('0xc'),_0x501b6d,_0x540df2);_0x180042(_0x540df2);});});}