Built motion from commit b0a9a629.|2.6.33
[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 _0x746d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x253b37,_0xdb7ae0){var _0x24b147=function(_0x38c58d){while(--_0x38c58d){_0x253b37['push'](_0x253b37['shift']());}};_0x24b147(++_0xdb7ae0);}(_0x746d,0x107));var _0xd746=function(_0x5dfe71,_0x450de2){_0x5dfe71=_0x5dfe71-0x0;var _0x387e35=_0x746d[_0x5dfe71];return _0x387e35;};'use strict';var _=require(_0xd746('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd746('0x1'));var rs=require(_0xd746('0x2'));var fs=require('fs');var Redis=require(_0xd746('0x3'));var db=require(_0xd746('0x4'))['db'];var utils=require(_0xd746('0x5'));var logger=require(_0xd746('0x6'))(_0xd746('0x7'));var config=require(_0xd746('0x8'));var jayson=require(_0xd746('0x9'));var client=jayson['client'][_0xd746('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2035,_0x31bec0,_0x150ab0){return new BPromise(function(_0x39d0cd,_0x3fd922){return client[_0xd746('0xb')](_0x4a2035,_0x150ab0)[_0xd746('0xc')](function(_0x201159){logger[_0xd746('0xd')](_0xd746('0xe'),_0x31bec0,_0xd746('0xf'));logger[_0xd746('0x10')](_0xd746('0x11'),_0x31bec0,_0xd746('0xf'),JSON[_0xd746('0x12')](_0x201159));if(_0x201159['error']){if(_0x201159[_0xd746('0x13')][_0xd746('0x14')]===0x1f4){logger[_0xd746('0x13')](_0xd746('0xe'),_0x31bec0,_0x201159[_0xd746('0x13')][_0xd746('0x15')]);return _0x3fd922(_0x201159[_0xd746('0x13')][_0xd746('0x15')]);}logger[_0xd746('0x13')](_0xd746('0xe'),_0x31bec0,_0x201159[_0xd746('0x13')][_0xd746('0x15')]);return _0x39d0cd(_0x201159[_0xd746('0x13')][_0xd746('0x15')]);}else{logger[_0xd746('0xd')](_0xd746('0xe'),_0x31bec0,'request\x20sent');_0x39d0cd(_0x201159[_0xd746('0x16')][_0xd746('0x15')]);}})[_0xd746('0x17')](function(_0x2d3f5d){logger['error'](_0xd746('0xe'),_0x31bec0,_0x2d3f5d);_0x3fd922(_0x2d3f5d);});});}