Built motion from commit (unavailable).|2.5.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 _0x7013=['../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger'];(function(_0x5d9f8d,_0x5e8efd){var _0x44b665=function(_0x1673ce){while(--_0x1673ce){_0x5d9f8d['push'](_0x5d9f8d['shift']());}};_0x44b665(++_0x5e8efd);}(_0x7013,0x1b3));var _0x3701=function(_0x3c5a06,_0x551423){_0x3c5a06=_0x3c5a06-0x0;var _0x11f290=_0x7013[_0x3c5a06];return _0x11f290;};'use strict';var _=require(_0x3701('0x0'));var util=require(_0x3701('0x1'));var moment=require(_0x3701('0x2'));var BPromise=require(_0x3701('0x3'));var rs=require(_0x3701('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3701('0x5'))('rpc');var config=require(_0x3701('0x6'));var jayson=require(_0x3701('0x7'));var client=jayson[_0x3701('0x8')][_0x3701('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f54be,_0x5c2ed0,_0x4c08a8){return new BPromise(function(_0x12ae5c,_0x551d90){return client[_0x3701('0xa')](_0x2f54be,_0x4c08a8)[_0x3701('0xb')](function(_0x555540){logger[_0x3701('0xc')](_0x3701('0xd'),_0x5c2ed0,_0x3701('0xe'));logger[_0x3701('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5c2ed0,_0x3701('0xe'),JSON['stringify'](_0x555540));if(_0x555540[_0x3701('0x10')]){if(_0x555540[_0x3701('0x10')][_0x3701('0x11')]===0x1f4){logger['error'](_0x3701('0xd'),_0x5c2ed0,_0x555540['error'][_0x3701('0x12')]);return _0x551d90(_0x555540[_0x3701('0x10')][_0x3701('0x12')]);}logger[_0x3701('0x10')]('VoiceMail,\x20%s,\x20%s',_0x5c2ed0,_0x555540['error'][_0x3701('0x12')]);return _0x12ae5c(_0x555540[_0x3701('0x10')]['message']);}else{logger[_0x3701('0xc')](_0x3701('0xd'),_0x5c2ed0,_0x3701('0xe'));_0x12ae5c(_0x555540[_0x3701('0x13')][_0x3701('0x12')]);}})[_0x3701('0x14')](function(_0x588ebd){logger[_0x3701('0x10')]('VoiceMail,\x20%s,\x20%s',_0x5c2ed0,_0x588ebd);_0x551d90(_0x588ebd);});});}