Built motion from commit 97153652.|2.6.26
[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 _0xe1bf=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird'];(function(_0x14b944,_0x541124){var _0x467250=function(_0x81fd3d){while(--_0x81fd3d){_0x14b944['push'](_0x14b944['shift']());}};_0x467250(++_0x541124);}(_0xe1bf,0x18c));var _0xfe1b=function(_0x2fcf4f,_0xf3009d){_0x2fcf4f=_0x2fcf4f-0x0;var _0x2e3b3e=_0xe1bf[_0x2fcf4f];return _0x2e3b3e;};'use strict';var _=require('lodash');var util=require(_0xfe1b('0x0'));var moment=require(_0xfe1b('0x1'));var BPromise=require(_0xfe1b('0x2'));var rs=require(_0xfe1b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe1b('0x4'))['db'];var utils=require(_0xfe1b('0x5'));var logger=require(_0xfe1b('0x6'))('rpc');var config=require(_0xfe1b('0x7'));var jayson=require(_0xfe1b('0x8'));var client=jayson[_0xfe1b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17a860,_0x4bd01,_0x101c65){return new BPromise(function(_0x4037f9,_0x1dbea5){return client[_0xfe1b('0xa')](_0x17a860,_0x101c65)[_0xfe1b('0xb')](function(_0x4ac373){logger['info'](_0xfe1b('0xc'),_0x4bd01,_0xfe1b('0xd'));logger['debug'](_0xfe1b('0xe'),_0x4bd01,_0xfe1b('0xd'),JSON[_0xfe1b('0xf')](_0x4ac373));if(_0x4ac373[_0xfe1b('0x10')]){if(_0x4ac373[_0xfe1b('0x10')][_0xfe1b('0x11')]===0x1f4){logger[_0xfe1b('0x10')](_0xfe1b('0xc'),_0x4bd01,_0x4ac373['error'][_0xfe1b('0x12')]);return _0x1dbea5(_0x4ac373[_0xfe1b('0x10')]['message']);}logger[_0xfe1b('0x10')](_0xfe1b('0xc'),_0x4bd01,_0x4ac373['error'][_0xfe1b('0x12')]);return _0x4037f9(_0x4ac373['error'][_0xfe1b('0x12')]);}else{logger['info'](_0xfe1b('0xc'),_0x4bd01,_0xfe1b('0xd'));_0x4037f9(_0x4ac373[_0xfe1b('0x13')][_0xfe1b('0x12')]);}})[_0xfe1b('0x14')](function(_0x51d37b){logger[_0xfe1b('0x10')](_0xfe1b('0xc'),_0x4bd01,_0x51d37b);_0x1dbea5(_0x51d37b);});});}