cb7219aa5eebe28130c3114d0ab5ef6882bf5839
[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 _0x11df=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2aa31b,_0x2ec314){var _0x460803=function(_0x2b501d){while(--_0x2b501d){_0x2aa31b['push'](_0x2aa31b['shift']());}};_0x460803(++_0x2ec314);}(_0x11df,0x1ee));var _0xf11d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x11df[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xf11d('0x0'));var util=require(_0xf11d('0x1'));var moment=require(_0xf11d('0x2'));var BPromise=require(_0xf11d('0x3'));var rs=require(_0xf11d('0x4'));var fs=require('fs');var Redis=require(_0xf11d('0x5'));var db=require(_0xf11d('0x6'))['db'];var utils=require(_0xf11d('0x7'));var logger=require(_0xf11d('0x8'))(_0xf11d('0x9'));var config=require(_0xf11d('0xa'));var jayson=require(_0xf11d('0xb'));var client=jayson[_0xf11d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x457bcd,_0xbb7cd9,_0x81a29d){return new BPromise(function(_0x122d41,_0x470279){return client[_0xf11d('0xd')](_0x457bcd,_0x81a29d)[_0xf11d('0xe')](function(_0x359cc3){logger[_0xf11d('0xf')](_0xf11d('0x10'),_0xbb7cd9,_0xf11d('0x11'));logger[_0xf11d('0x12')](_0xf11d('0x13'),_0xbb7cd9,_0xf11d('0x11'),JSON[_0xf11d('0x14')](_0x359cc3));if(_0x359cc3[_0xf11d('0x15')]){if(_0x359cc3[_0xf11d('0x15')][_0xf11d('0x16')]===0x1f4){logger[_0xf11d('0x15')](_0xf11d('0x10'),_0xbb7cd9,_0x359cc3[_0xf11d('0x15')][_0xf11d('0x17')]);return _0x470279(_0x359cc3[_0xf11d('0x15')][_0xf11d('0x17')]);}logger[_0xf11d('0x15')]('VoiceMail,\x20%s,\x20%s',_0xbb7cd9,_0x359cc3[_0xf11d('0x15')][_0xf11d('0x17')]);return _0x122d41(_0x359cc3[_0xf11d('0x15')][_0xf11d('0x17')]);}else{logger[_0xf11d('0xf')](_0xf11d('0x10'),_0xbb7cd9,_0xf11d('0x11'));_0x122d41(_0x359cc3['result'][_0xf11d('0x17')]);}})[_0xf11d('0x18')](function(_0x53c7ea){logger[_0xf11d('0x15')](_0xf11d('0x10'),_0xbb7cd9,_0x53c7ea);_0x470279(_0x53c7ea);});});}