Built motion from commit (unavailable).|2.5.9
[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 _0x5274=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','error','VoiceMail,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4b5c7c,_0x41ab10){var _0x315a37=function(_0x563067){while(--_0x563067){_0x4b5c7c['push'](_0x4b5c7c['shift']());}};_0x315a37(++_0x41ab10);}(_0x5274,0x83));var _0x4527=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0x5274[_0x1147ab];return _0x55cb5a;};'use strict';var _=require(_0x4527('0x0'));var util=require(_0x4527('0x1'));var moment=require(_0x4527('0x2'));var BPromise=require(_0x4527('0x3'));var rs=require(_0x4527('0x4'));var fs=require('fs');var Redis=require(_0x4527('0x5'));var db=require(_0x4527('0x6'))['db'];var utils=require(_0x4527('0x7'));var logger=require(_0x4527('0x8'))(_0x4527('0x9'));var config=require(_0x4527('0xa'));var jayson=require(_0x4527('0xb'));var client=jayson['client'][_0x4527('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a2e04,_0xc6622c,_0x3d7de8){return new BPromise(function(_0xc87fdb,_0x3bd04c){return client[_0x4527('0xd')](_0x3a2e04,_0x3d7de8)[_0x4527('0xe')](function(_0x654f83){logger[_0x4527('0xf')]('VoiceMail,\x20%s,\x20%s',_0xc6622c,_0x4527('0x10'));logger['debug'](_0x4527('0x11'),_0xc6622c,_0x4527('0x10'),JSON['stringify'](_0x654f83));if(_0x654f83[_0x4527('0x12')]){if(_0x654f83[_0x4527('0x12')]['code']===0x1f4){logger[_0x4527('0x12')](_0x4527('0x13'),_0xc6622c,_0x654f83[_0x4527('0x12')]['message']);return _0x3bd04c(_0x654f83[_0x4527('0x12')]['message']);}logger[_0x4527('0x12')]('VoiceMail,\x20%s,\x20%s',_0xc6622c,_0x654f83[_0x4527('0x12')][_0x4527('0x14')]);return _0xc87fdb(_0x654f83['error'][_0x4527('0x14')]);}else{logger[_0x4527('0xf')](_0x4527('0x13'),_0xc6622c,_0x4527('0x10'));_0xc87fdb(_0x654f83['result']['message']);}})[_0x4527('0x15')](function(_0x315b09){logger[_0x4527('0x12')](_0x4527('0x13'),_0xc6622c,_0x315b09);_0x3bd04c(_0x315b09);});});}