Built motion from commit 9d0783e6.|2.6.13
[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 _0x24cc=['rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ae69c,_0x31267a){var _0x46ca50=function(_0x47a96e){while(--_0x47a96e){_0x3ae69c['push'](_0x3ae69c['shift']());}};_0x46ca50(++_0x31267a);}(_0x24cc,0x180));var _0xc24c=function(_0x537563,_0x49b366){_0x537563=_0x537563-0x0;var _0x27675f=_0x24cc[_0x537563];return _0x27675f;};'use strict';var _=require(_0xc24c('0x0'));var util=require(_0xc24c('0x1'));var moment=require(_0xc24c('0x2'));var BPromise=require('bluebird');var rs=require(_0xc24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc24c('0x4'))['db'];var utils=require(_0xc24c('0x5'));var logger=require(_0xc24c('0x6'))(_0xc24c('0x7'));var config=require(_0xc24c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc24c('0x9')][_0xc24c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4021a1,_0x227508,_0xc820a4){return new BPromise(function(_0x5c01ee,_0x45b868){return client[_0xc24c('0xb')](_0x4021a1,_0xc820a4)[_0xc24c('0xc')](function(_0x4effe3){logger[_0xc24c('0xd')](_0xc24c('0xe'),_0x227508,'request\x20sent');logger[_0xc24c('0xf')](_0xc24c('0x10'),_0x227508,_0xc24c('0x11'),JSON[_0xc24c('0x12')](_0x4effe3));if(_0x4effe3['error']){if(_0x4effe3['error'][_0xc24c('0x13')]===0x1f4){logger[_0xc24c('0x14')]('VoiceMail,\x20%s,\x20%s',_0x227508,_0x4effe3[_0xc24c('0x14')][_0xc24c('0x15')]);return _0x45b868(_0x4effe3['error']['message']);}logger[_0xc24c('0x14')](_0xc24c('0xe'),_0x227508,_0x4effe3[_0xc24c('0x14')]['message']);return _0x5c01ee(_0x4effe3['error']['message']);}else{logger[_0xc24c('0xd')](_0xc24c('0xe'),_0x227508,_0xc24c('0x11'));_0x5c01ee(_0x4effe3[_0xc24c('0x16')]['message']);}})['catch'](function(_0x509be6){logger[_0xc24c('0x14')](_0xc24c('0xe'),_0x227508,_0x509be6);_0x45b868(_0x509be6);});});}