Built motion from commit 449495f6.|2.6.27
[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 _0x7e2c=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3c79d1,_0x1e55d4){var _0x1646e8=function(_0x278dfe){while(--_0x278dfe){_0x3c79d1['push'](_0x3c79d1['shift']());}};_0x1646e8(++_0x1e55d4);}(_0x7e2c,0x6c));var _0xc7e2=function(_0x4b25d8,_0x3f86c9){_0x4b25d8=_0x4b25d8-0x0;var _0x2d23e1=_0x7e2c[_0x4b25d8];return _0x2d23e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc7e2('0x0'));var BPromise=require(_0xc7e2('0x1'));var rs=require(_0xc7e2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc7e2('0x3'))['db'];var utils=require(_0xc7e2('0x4'));var logger=require(_0xc7e2('0x5'))(_0xc7e2('0x6'));var config=require(_0xc7e2('0x7'));var jayson=require(_0xc7e2('0x8'));var client=jayson[_0xc7e2('0x9')][_0xc7e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20d0b7,_0x577af1,_0x3d9f17){return new BPromise(function(_0x500065,_0x1755db){return client[_0xc7e2('0xb')](_0x20d0b7,_0x3d9f17)[_0xc7e2('0xc')](function(_0x13ef0b){logger[_0xc7e2('0xd')](_0xc7e2('0xe'),_0x577af1,_0xc7e2('0xf'));logger[_0xc7e2('0x10')](_0xc7e2('0x11'),_0x577af1,_0xc7e2('0xf'),JSON[_0xc7e2('0x12')](_0x13ef0b));if(_0x13ef0b[_0xc7e2('0x13')]){if(_0x13ef0b[_0xc7e2('0x13')][_0xc7e2('0x14')]===0x1f4){logger[_0xc7e2('0x13')](_0xc7e2('0xe'),_0x577af1,_0x13ef0b['error'][_0xc7e2('0x15')]);return _0x1755db(_0x13ef0b[_0xc7e2('0x13')][_0xc7e2('0x15')]);}logger[_0xc7e2('0x13')](_0xc7e2('0xe'),_0x577af1,_0x13ef0b[_0xc7e2('0x13')]['message']);return _0x500065(_0x13ef0b[_0xc7e2('0x13')][_0xc7e2('0x15')]);}else{logger['info'](_0xc7e2('0xe'),_0x577af1,_0xc7e2('0xf'));_0x500065(_0x13ef0b['result'][_0xc7e2('0x15')]);}})[_0xc7e2('0x16')](function(_0x57357e){logger[_0xc7e2('0x13')](_0xc7e2('0xe'),_0x577af1,_0x57357e);_0x1755db(_0x57357e);});});}