Built motion from commit (unavailable).|2.5.14
[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 _0x5d52=['moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x2eacce,_0x3d2f13){var _0x3b4faa=function(_0x151152){while(--_0x151152){_0x2eacce['push'](_0x2eacce['shift']());}};_0x3b4faa(++_0x3d2f13);}(_0x5d52,0x1e1));var _0x25d5=function(_0x4f51f9,_0x5d5613){_0x4f51f9=_0x4f51f9-0x0;var _0x533984=_0x5d52[_0x4f51f9];return _0x533984;};'use strict';var _=require(_0x25d5('0x0'));var util=require(_0x25d5('0x1'));var moment=require(_0x25d5('0x2'));var BPromise=require(_0x25d5('0x3'));var rs=require(_0x25d5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x25d5('0x5'));var logger=require('../../config/logger')(_0x25d5('0x6'));var config=require(_0x25d5('0x7'));var jayson=require(_0x25d5('0x8'));var client=jayson[_0x25d5('0x9')][_0x25d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ddc57,_0xb36159,_0x10b204){return new BPromise(function(_0x1d9cc5,_0x2e6ac7){return client[_0x25d5('0xb')](_0x2ddc57,_0x10b204)[_0x25d5('0xc')](function(_0x1252aa){logger[_0x25d5('0xd')](_0x25d5('0xe'),_0xb36159,'request\x20sent');logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0xb36159,_0x25d5('0xf'),JSON[_0x25d5('0x10')](_0x1252aa));if(_0x1252aa[_0x25d5('0x11')]){if(_0x1252aa['error']['code']===0x1f4){logger[_0x25d5('0x11')](_0x25d5('0xe'),_0xb36159,_0x1252aa[_0x25d5('0x11')][_0x25d5('0x12')]);return _0x2e6ac7(_0x1252aa[_0x25d5('0x11')]['message']);}logger[_0x25d5('0x11')]('VoiceMail,\x20%s,\x20%s',_0xb36159,_0x1252aa[_0x25d5('0x11')][_0x25d5('0x12')]);return _0x1d9cc5(_0x1252aa['error'][_0x25d5('0x12')]);}else{logger[_0x25d5('0xd')](_0x25d5('0xe'),_0xb36159,'request\x20sent');_0x1d9cc5(_0x1252aa[_0x25d5('0x13')][_0x25d5('0x12')]);}})[_0x25d5('0x14')](function(_0x2fff16){logger[_0x25d5('0x11')](_0x25d5('0xe'),_0xb36159,_0x2fff16);_0x2e6ac7(_0x2fff16);});});}