Built motion from commit 1ea47bf4.|2.6.34
[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 _0x9829=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x5356ab,_0xe1a471){var _0x366faa=function(_0x422329){while(--_0x422329){_0x5356ab['push'](_0x5356ab['shift']());}};_0x366faa(++_0xe1a471);}(_0x9829,0x1b1));var _0x9982=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0x9829[_0x237f8b];return _0x423f94;};'use strict';var _=require('lodash');var util=require(_0x9982('0x0'));var moment=require(_0x9982('0x1'));var BPromise=require(_0x9982('0x2'));var rs=require(_0x9982('0x3'));var fs=require('fs');var Redis=require(_0x9982('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9982('0x5'))(_0x9982('0x6'));var config=require(_0x9982('0x7'));var jayson=require(_0x9982('0x8'));var client=jayson[_0x9982('0x9')][_0x9982('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41db9e,_0x4996b0,_0x10b236){return new BPromise(function(_0x1d77d2,_0x1b4b62){return client[_0x9982('0xb')](_0x41db9e,_0x10b236)[_0x9982('0xc')](function(_0x53ed2a){logger[_0x9982('0xd')](_0x9982('0xe'),_0x4996b0,_0x9982('0xf'));logger[_0x9982('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x4996b0,'request\x20sent',JSON[_0x9982('0x11')](_0x53ed2a));if(_0x53ed2a[_0x9982('0x12')]){if(_0x53ed2a[_0x9982('0x12')][_0x9982('0x13')]===0x1f4){logger[_0x9982('0x12')](_0x9982('0xe'),_0x4996b0,_0x53ed2a[_0x9982('0x12')][_0x9982('0x14')]);return _0x1b4b62(_0x53ed2a[_0x9982('0x12')][_0x9982('0x14')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4996b0,_0x53ed2a[_0x9982('0x12')][_0x9982('0x14')]);return _0x1d77d2(_0x53ed2a['error'][_0x9982('0x14')]);}else{logger[_0x9982('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x4996b0,_0x9982('0xf'));_0x1d77d2(_0x53ed2a['result']['message']);}})[_0x9982('0x15')](function(_0xeab547){logger[_0x9982('0x12')](_0x9982('0xe'),_0x4996b0,_0xeab547);_0x1b4b62(_0xeab547);});});}