Built motion from commit 9d0783e6.|2.6.13
[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 _0xa71a=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xa71a,0x1b8));var _0xaa71=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa71a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xaa71('0x0'));var util=require(_0xaa71('0x1'));var moment=require(_0xaa71('0x2'));var BPromise=require(_0xaa71('0x3'));var rs=require(_0xaa71('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa71('0x5'))['db'];var utils=require(_0xaa71('0x6'));var logger=require(_0xaa71('0x7'))('rpc');var config=require(_0xaa71('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaa71('0x9')][_0xaa71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8e8a,_0x47f5b7,_0x504b29){return new BPromise(function(_0x3c6f55,_0xdd6cf2){return client[_0xaa71('0xb')](_0x1c8e8a,_0x504b29)[_0xaa71('0xc')](function(_0x1e6350){logger[_0xaa71('0xd')](_0xaa71('0xe'),_0x47f5b7,_0xaa71('0xf'));logger[_0xaa71('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x47f5b7,'request\x20sent',JSON[_0xaa71('0x11')](_0x1e6350));if(_0x1e6350[_0xaa71('0x12')]){if(_0x1e6350[_0xaa71('0x12')]['code']===0x1f4){logger[_0xaa71('0x12')]('VoiceMail,\x20%s,\x20%s',_0x47f5b7,_0x1e6350[_0xaa71('0x12')][_0xaa71('0x13')]);return _0xdd6cf2(_0x1e6350[_0xaa71('0x12')][_0xaa71('0x13')]);}logger[_0xaa71('0x12')]('VoiceMail,\x20%s,\x20%s',_0x47f5b7,_0x1e6350[_0xaa71('0x12')][_0xaa71('0x13')]);return _0x3c6f55(_0x1e6350['error'][_0xaa71('0x13')]);}else{logger[_0xaa71('0xd')]('VoiceMail,\x20%s,\x20%s',_0x47f5b7,_0xaa71('0xf'));_0x3c6f55(_0x1e6350[_0xaa71('0x14')][_0xaa71('0x13')]);}})[_0xaa71('0x15')](function(_0x1e1e52){logger[_0xaa71('0x12')](_0xaa71('0xe'),_0x47f5b7,_0x1e1e52);_0xdd6cf2(_0x1e1e52);});});}