6c657450d6dee53788911df06407d182abfdfc11
[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 _0x98ec=['message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','VoiceMail,\x20%s,\x20%s'];(function(_0xab726d,_0x2adbe5){var _0x4f9768=function(_0x46f0e7){while(--_0x46f0e7){_0xab726d['push'](_0xab726d['shift']());}};_0x4f9768(++_0x2adbe5);}(_0x98ec,0x161));var _0xc98e=function(_0x22ca59,_0x33db1f){_0x22ca59=_0x22ca59-0x0;var _0x4c875d=_0x98ec[_0x22ca59];return _0x4c875d;};'use strict';var _=require(_0xc98e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc98e('0x1'));var rs=require(_0xc98e('0x2'));var fs=require('fs');var Redis=require(_0xc98e('0x3'));var db=require(_0xc98e('0x4'))['db'];var utils=require(_0xc98e('0x5'));var logger=require(_0xc98e('0x6'))(_0xc98e('0x7'));var config=require(_0xc98e('0x8'));var jayson=require(_0xc98e('0x9'));var client=jayson[_0xc98e('0xa')][_0xc98e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf32dae,_0x3e9317,_0x255085){return new BPromise(function(_0x752f33,_0x52c2bf){return client[_0xc98e('0xc')](_0xf32dae,_0x255085)[_0xc98e('0xd')](function(_0x4b0c99){logger[_0xc98e('0xe')]('VoiceMail,\x20%s,\x20%s',_0x3e9317,_0xc98e('0xf'));logger[_0xc98e('0x10')](_0xc98e('0x11'),_0x3e9317,'request\x20sent',JSON['stringify'](_0x4b0c99));if(_0x4b0c99[_0xc98e('0x12')]){if(_0x4b0c99[_0xc98e('0x12')][_0xc98e('0x13')]===0x1f4){logger['error'](_0xc98e('0x14'),_0x3e9317,_0x4b0c99[_0xc98e('0x12')][_0xc98e('0x15')]);return _0x52c2bf(_0x4b0c99[_0xc98e('0x12')]['message']);}logger[_0xc98e('0x12')](_0xc98e('0x14'),_0x3e9317,_0x4b0c99[_0xc98e('0x12')][_0xc98e('0x15')]);return _0x752f33(_0x4b0c99[_0xc98e('0x12')][_0xc98e('0x15')]);}else{logger[_0xc98e('0xe')](_0xc98e('0x14'),_0x3e9317,_0xc98e('0xf'));_0x752f33(_0x4b0c99['result'][_0xc98e('0x15')]);}})['catch'](function(_0x140074){logger[_0xc98e('0x12')](_0xc98e('0x14'),_0x3e9317,_0x140074);_0x52c2bf(_0x140074);});});}