da95a587f376680b374a86b62110bd08747411b7
[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 _0x9a0e=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9a0e,0x1f2));var _0xe9a0=function(_0x503659,_0xfb8b2a){_0x503659=_0x503659-0x0;var _0x9ab53=_0x9a0e[_0x503659];return _0x9ab53;};'use strict';var _=require(_0xe9a0('0x0'));var util=require(_0xe9a0('0x1'));var moment=require(_0xe9a0('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9a0('0x3'));var fs=require('fs');var Redis=require(_0xe9a0('0x4'));var db=require(_0xe9a0('0x5'))['db'];var utils=require(_0xe9a0('0x6'));var logger=require('../../config/logger')(_0xe9a0('0x7'));var config=require(_0xe9a0('0x8'));var jayson=require(_0xe9a0('0x9'));var client=jayson[_0xe9a0('0xa')][_0xe9a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eef4d,_0x33b9c2,_0x35f84a){return new BPromise(function(_0x296871,_0x345d4c){return client[_0xe9a0('0xc')](_0x2eef4d,_0x35f84a)['then'](function(_0x2adabc){logger['info'](_0xe9a0('0xd'),_0x33b9c2,'request\x20sent');logger[_0xe9a0('0xe')](_0xe9a0('0xf'),_0x33b9c2,_0xe9a0('0x10'),JSON[_0xe9a0('0x11')](_0x2adabc));if(_0x2adabc[_0xe9a0('0x12')]){if(_0x2adabc[_0xe9a0('0x12')][_0xe9a0('0x13')]===0x1f4){logger[_0xe9a0('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x33b9c2,_0x2adabc[_0xe9a0('0x12')]['message']);return _0x345d4c(_0x2adabc[_0xe9a0('0x12')][_0xe9a0('0x14')]);}logger[_0xe9a0('0x12')](_0xe9a0('0xd'),_0x33b9c2,_0x2adabc['error'][_0xe9a0('0x14')]);return _0x296871(_0x2adabc[_0xe9a0('0x12')][_0xe9a0('0x14')]);}else{logger[_0xe9a0('0x15')](_0xe9a0('0xd'),_0x33b9c2,_0xe9a0('0x10'));_0x296871(_0x2adabc[_0xe9a0('0x16')][_0xe9a0('0x14')]);}})[_0xe9a0('0x17')](function(_0x4f2f77){logger[_0xe9a0('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x33b9c2,_0x4f2f77);_0x345d4c(_0x4f2f77);});});}