Built motion from commit b5413ace.|2.6.9
[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 _0x8c9d=['VoiceMail,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x5851b4,_0x41c354){var _0x54e3c1=function(_0x108a91){while(--_0x108a91){_0x5851b4['push'](_0x5851b4['shift']());}};_0x54e3c1(++_0x41c354);}(_0x8c9d,0x1d1));var _0xd8c9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c9d[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xd8c9('0x0'));var util=require(_0xd8c9('0x1'));var moment=require(_0xd8c9('0x2'));var BPromise=require(_0xd8c9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8c9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd8c9('0x5'));var logger=require(_0xd8c9('0x6'))(_0xd8c9('0x7'));var config=require(_0xd8c9('0x8'));var jayson=require(_0xd8c9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19b563,_0x29bbf8,_0x1df552){return new BPromise(function(_0x3e29f2,_0x461a7b){return client[_0xd8c9('0xa')](_0x19b563,_0x1df552)[_0xd8c9('0xb')](function(_0x2ac078){logger[_0xd8c9('0xc')]('VoiceMail,\x20%s,\x20%s',_0x29bbf8,_0xd8c9('0xd'));logger[_0xd8c9('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x29bbf8,_0xd8c9('0xd'),JSON[_0xd8c9('0xf')](_0x2ac078));if(_0x2ac078[_0xd8c9('0x10')]){if(_0x2ac078['error'][_0xd8c9('0x11')]===0x1f4){logger[_0xd8c9('0x10')](_0xd8c9('0x12'),_0x29bbf8,_0x2ac078[_0xd8c9('0x10')][_0xd8c9('0x13')]);return _0x461a7b(_0x2ac078['error']['message']);}logger['error'](_0xd8c9('0x12'),_0x29bbf8,_0x2ac078['error'][_0xd8c9('0x13')]);return _0x3e29f2(_0x2ac078['error'][_0xd8c9('0x13')]);}else{logger[_0xd8c9('0xc')]('VoiceMail,\x20%s,\x20%s',_0x29bbf8,'request\x20sent');_0x3e29f2(_0x2ac078[_0xd8c9('0x14')][_0xd8c9('0x13')]);}})['catch'](function(_0x1a593b){logger[_0xd8c9('0x10')](_0xd8c9('0x12'),_0x29bbf8,_0x1a593b);_0x461a7b(_0x1a593b);});});}