Built motion from commit (unavailable).|2.5.30
[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 _0xa59c=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x584b1a,_0x5b4d87){var _0x1a72aa=function(_0x20d216){while(--_0x20d216){_0x584b1a['push'](_0x584b1a['shift']());}};_0x1a72aa(++_0x5b4d87);}(_0xa59c,0x71));var _0xca59=function(_0x15118e,_0x3aecc3){_0x15118e=_0x15118e-0x0;var _0x35a467=_0xa59c[_0x15118e];return _0x35a467;};'use strict';var _=require(_0xca59('0x0'));var util=require(_0xca59('0x1'));var moment=require('moment');var BPromise=require(_0xca59('0x2'));var rs=require(_0xca59('0x3'));var fs=require('fs');var Redis=require(_0xca59('0x4'));var db=require(_0xca59('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xca59('0x6'));var config=require(_0xca59('0x7'));var jayson=require(_0xca59('0x8'));var client=jayson[_0xca59('0x9')][_0xca59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13e75b,_0x3012ce,_0x1f3e15){return new BPromise(function(_0x152cf5,_0x46e9d8){return client[_0xca59('0xb')](_0x13e75b,_0x1f3e15)[_0xca59('0xc')](function(_0x3f8316){logger[_0xca59('0xd')](_0xca59('0xe'),_0x3012ce,_0xca59('0xf'));logger[_0xca59('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x3012ce,'request\x20sent',JSON[_0xca59('0x11')](_0x3f8316));if(_0x3f8316[_0xca59('0x12')]){if(_0x3f8316[_0xca59('0x12')][_0xca59('0x13')]===0x1f4){logger['error'](_0xca59('0xe'),_0x3012ce,_0x3f8316[_0xca59('0x12')][_0xca59('0x14')]);return _0x46e9d8(_0x3f8316['error'][_0xca59('0x14')]);}logger[_0xca59('0x12')]('VoiceMail,\x20%s,\x20%s',_0x3012ce,_0x3f8316['error'][_0xca59('0x14')]);return _0x152cf5(_0x3f8316[_0xca59('0x12')]['message']);}else{logger[_0xca59('0xd')](_0xca59('0xe'),_0x3012ce,_0xca59('0xf'));_0x152cf5(_0x3f8316[_0xca59('0x15')][_0xca59('0x14')]);}})[_0xca59('0x16')](function(_0x360be1){logger[_0xca59('0x12')](_0xca59('0xe'),_0x3012ce,_0x360be1);_0x46e9d8(_0x360be1);});});}