27e581635e0e7245bb40391290df1313cb00018c
[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 _0x7446=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x593f3c,_0x1e4ba1){var _0x16d9dc=function(_0x29f23e){while(--_0x29f23e){_0x593f3c['push'](_0x593f3c['shift']());}};_0x16d9dc(++_0x1e4ba1);}(_0x7446,0x19f));var _0x6744=function(_0x2bbb02,_0x15ded2){_0x2bbb02=_0x2bbb02-0x0;var _0x4f1193=_0x7446[_0x2bbb02];return _0x4f1193;};'use strict';var _=require(_0x6744('0x0'));var util=require(_0x6744('0x1'));var moment=require(_0x6744('0x2'));var BPromise=require(_0x6744('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6744('0x4'));var db=require(_0x6744('0x5'))['db'];var utils=require(_0x6744('0x6'));var logger=require(_0x6744('0x7'))(_0x6744('0x8'));var config=require(_0x6744('0x9'));var jayson=require(_0x6744('0xa'));var client=jayson[_0x6744('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5959,_0x3f06ac,_0x3e0321){return new BPromise(function(_0x10c3c0,_0x821b37){return client['request'](_0x1c5959,_0x3e0321)[_0x6744('0xc')](function(_0x28ee92){logger[_0x6744('0xd')](_0x6744('0xe'),_0x3f06ac,_0x6744('0xf'));logger['debug'](_0x6744('0x10'),_0x3f06ac,_0x6744('0xf'),JSON['stringify'](_0x28ee92));if(_0x28ee92[_0x6744('0x11')]){if(_0x28ee92[_0x6744('0x11')][_0x6744('0x12')]===0x1f4){logger['error'](_0x6744('0xe'),_0x3f06ac,_0x28ee92[_0x6744('0x11')][_0x6744('0x13')]);return _0x821b37(_0x28ee92[_0x6744('0x11')][_0x6744('0x13')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x3f06ac,_0x28ee92[_0x6744('0x11')][_0x6744('0x13')]);return _0x10c3c0(_0x28ee92[_0x6744('0x11')][_0x6744('0x13')]);}else{logger[_0x6744('0xd')]('VoiceMail,\x20%s,\x20%s',_0x3f06ac,_0x6744('0xf'));_0x10c3c0(_0x28ee92[_0x6744('0x14')][_0x6744('0x13')]);}})[_0x6744('0x15')](function(_0x34456f){logger[_0x6744('0x11')](_0x6744('0xe'),_0x3f06ac,_0x34456f);_0x821b37(_0x34456f);});});}