Built motion from commit 00bf23f6.|2.6.16
[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 _0x9dc3=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x9dc3,0x84));var _0x39dc=function(_0x15298e,_0x591c53){_0x15298e=_0x15298e-0x0;var _0x2d1d1a=_0x9dc3[_0x15298e];return _0x2d1d1a;};'use strict';var _=require(_0x39dc('0x0'));var util=require(_0x39dc('0x1'));var moment=require(_0x39dc('0x2'));var BPromise=require(_0x39dc('0x3'));var rs=require(_0x39dc('0x4'));var fs=require('fs');var Redis=require(_0x39dc('0x5'));var db=require(_0x39dc('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x39dc('0x7'));var config=require(_0x39dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x39dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d5a45,_0x509ba4,_0x2ce268){return new BPromise(function(_0x28e3a2,_0x54bc14){return client['request'](_0x2d5a45,_0x2ce268)[_0x39dc('0xa')](function(_0x2f371e){logger[_0x39dc('0xb')](_0x39dc('0xc'),_0x509ba4,_0x39dc('0xd'));logger[_0x39dc('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x509ba4,_0x39dc('0xd'),JSON[_0x39dc('0xf')](_0x2f371e));if(_0x2f371e[_0x39dc('0x10')]){if(_0x2f371e[_0x39dc('0x10')][_0x39dc('0x11')]===0x1f4){logger[_0x39dc('0x10')](_0x39dc('0xc'),_0x509ba4,_0x2f371e[_0x39dc('0x10')]['message']);return _0x54bc14(_0x2f371e[_0x39dc('0x10')][_0x39dc('0x12')]);}logger[_0x39dc('0x10')](_0x39dc('0xc'),_0x509ba4,_0x2f371e[_0x39dc('0x10')][_0x39dc('0x12')]);return _0x28e3a2(_0x2f371e['error']['message']);}else{logger[_0x39dc('0xb')](_0x39dc('0xc'),_0x509ba4,'request\x20sent');_0x28e3a2(_0x2f371e[_0x39dc('0x13')][_0x39dc('0x12')]);}})[_0x39dc('0x14')](function(_0x30971d){logger[_0x39dc('0x10')]('VoiceMail,\x20%s,\x20%s',_0x509ba4,_0x30971d);_0x54bc14(_0x30971d);});});}