eb320ae038793f4a789a7bd3f94e87f97dcaab73
[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 _0x7645=['http','request','then','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4e3558,_0x53aa25){var _0x52324b=function(_0x4d79d9){while(--_0x4d79d9){_0x4e3558['push'](_0x4e3558['shift']());}};_0x52324b(++_0x53aa25);}(_0x7645,0x1d5));var _0x5764=function(_0x5b71b3,_0x4ad845){_0x5b71b3=_0x5b71b3-0x0;var _0x2bee43=_0x7645[_0x5b71b3];return _0x2bee43;};'use strict';var _=require(_0x5764('0x0'));var util=require(_0x5764('0x1'));var moment=require(_0x5764('0x2'));var BPromise=require(_0x5764('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5764('0x4'));var db=require(_0x5764('0x5'))['db'];var utils=require(_0x5764('0x6'));var logger=require(_0x5764('0x7'))(_0x5764('0x8'));var config=require('../../config/environment');var jayson=require(_0x5764('0x9'));var client=jayson[_0x5764('0xa')][_0x5764('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c5380,_0x1a6a19,_0x3447ab){return new BPromise(function(_0x7063d,_0x12b336){return client[_0x5764('0xc')](_0x4c5380,_0x3447ab)[_0x5764('0xd')](function(_0x24f0e6){logger['info'](_0x5764('0xe'),_0x1a6a19,'request\x20sent');logger[_0x5764('0xf')](_0x5764('0x10'),_0x1a6a19,'request\x20sent',JSON[_0x5764('0x11')](_0x24f0e6));if(_0x24f0e6['error']){if(_0x24f0e6['error'][_0x5764('0x12')]===0x1f4){logger[_0x5764('0x13')]('VoiceMail,\x20%s,\x20%s',_0x1a6a19,_0x24f0e6[_0x5764('0x13')]['message']);return _0x12b336(_0x24f0e6['error'][_0x5764('0x14')]);}logger[_0x5764('0x13')](_0x5764('0xe'),_0x1a6a19,_0x24f0e6[_0x5764('0x13')][_0x5764('0x14')]);return _0x7063d(_0x24f0e6[_0x5764('0x13')][_0x5764('0x14')]);}else{logger[_0x5764('0x15')](_0x5764('0xe'),_0x1a6a19,'request\x20sent');_0x7063d(_0x24f0e6[_0x5764('0x16')][_0x5764('0x14')]);}})[_0x5764('0x17')](function(_0x21f88d){logger['error'](_0x5764('0xe'),_0x1a6a19,_0x21f88d);_0x12b336(_0x21f88d);});});}