Built motion from commit (unavailable).|2.5.0
[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 _0x8f91=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','util','moment','bluebird','randomstring'];(function(_0x4ef7ee,_0x16e755){var _0x5e2a5d=function(_0x1757b8){while(--_0x1757b8){_0x4ef7ee['push'](_0x4ef7ee['shift']());}};_0x5e2a5d(++_0x16e755);}(_0x8f91,0x172));var _0x18f9=function(_0x133668,_0x3c1585){_0x133668=_0x133668-0x0;var _0x140884=_0x8f91[_0x133668];return _0x140884;};'use strict';var _=require('lodash');var util=require(_0x18f9('0x0'));var moment=require(_0x18f9('0x1'));var BPromise=require(_0x18f9('0x2'));var rs=require(_0x18f9('0x3'));var fs=require('fs');var Redis=require(_0x18f9('0x4'));var db=require(_0x18f9('0x5'))['db'];var utils=require(_0x18f9('0x6'));var logger=require(_0x18f9('0x7'))(_0x18f9('0x8'));var config=require(_0x18f9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x18f9('0xa')][_0x18f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ff6d9,_0x1c0d03,_0x4bf4e9){return new BPromise(function(_0x191809,_0x2dc739){return client['request'](_0x3ff6d9,_0x4bf4e9)['then'](function(_0x2f379e){logger[_0x18f9('0xc')]('VoiceMail,\x20%s,\x20%s',_0x1c0d03,_0x18f9('0xd'));logger[_0x18f9('0xe')](_0x18f9('0xf'),_0x1c0d03,_0x18f9('0xd'),JSON[_0x18f9('0x10')](_0x2f379e));if(_0x2f379e[_0x18f9('0x11')]){if(_0x2f379e[_0x18f9('0x11')][_0x18f9('0x12')]===0x1f4){logger[_0x18f9('0x11')]('VoiceMail,\x20%s,\x20%s',_0x1c0d03,_0x2f379e[_0x18f9('0x11')][_0x18f9('0x13')]);return _0x2dc739(_0x2f379e[_0x18f9('0x11')][_0x18f9('0x13')]);}logger['error'](_0x18f9('0x14'),_0x1c0d03,_0x2f379e[_0x18f9('0x11')][_0x18f9('0x13')]);return _0x191809(_0x2f379e[_0x18f9('0x11')][_0x18f9('0x13')]);}else{logger[_0x18f9('0xc')]('VoiceMail,\x20%s,\x20%s',_0x1c0d03,'request\x20sent');_0x191809(_0x2f379e[_0x18f9('0x15')][_0x18f9('0x13')]);}})['catch'](function(_0xf84b1){logger[_0x18f9('0x11')](_0x18f9('0x14'),_0x1c0d03,_0xf84b1);_0x2dc739(_0xf84b1);});});}