Built motion from commit bab6f49e.|2.6.17
[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 _0x2713=['../../config/utils','rpc','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4eb56d,_0x279574){var _0x259951=function(_0x573710){while(--_0x573710){_0x4eb56d['push'](_0x4eb56d['shift']());}};_0x259951(++_0x279574);}(_0x2713,0x117));var _0x3271=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2713[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3271('0x0'));var util=require(_0x3271('0x1'));var moment=require(_0x3271('0x2'));var BPromise=require('bluebird');var rs=require(_0x3271('0x3'));var fs=require('fs');var Redis=require(_0x3271('0x4'));var db=require(_0x3271('0x5'))['db'];var utils=require(_0x3271('0x6'));var logger=require('../../config/logger')(_0x3271('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3271('0x8')][_0x3271('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e8190,_0x2fe30b,_0x2907da){return new BPromise(function(_0x266387,_0x2038d4){return client[_0x3271('0xa')](_0x5e8190,_0x2907da)[_0x3271('0xb')](function(_0x52e074){logger[_0x3271('0xc')](_0x3271('0xd'),_0x2fe30b,_0x3271('0xe'));logger['debug'](_0x3271('0xf'),_0x2fe30b,_0x3271('0xe'),JSON[_0x3271('0x10')](_0x52e074));if(_0x52e074[_0x3271('0x11')]){if(_0x52e074[_0x3271('0x11')]['code']===0x1f4){logger[_0x3271('0x11')](_0x3271('0xd'),_0x2fe30b,_0x52e074[_0x3271('0x11')][_0x3271('0x12')]);return _0x2038d4(_0x52e074[_0x3271('0x11')][_0x3271('0x12')]);}logger[_0x3271('0x11')](_0x3271('0xd'),_0x2fe30b,_0x52e074[_0x3271('0x11')][_0x3271('0x12')]);return _0x266387(_0x52e074[_0x3271('0x11')][_0x3271('0x12')]);}else{logger[_0x3271('0xc')](_0x3271('0xd'),_0x2fe30b,_0x3271('0xe'));_0x266387(_0x52e074['result'][_0x3271('0x12')]);}})['catch'](function(_0x2844f7){logger[_0x3271('0x11')](_0x3271('0xd'),_0x2fe30b,_0x2844f7);_0x2038d4(_0x2844f7);});});}