UNPKG

@nethesis/phone-island

Version:
3 lines (2 loc) 1.21 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),t=require("../store/index.js");exports.getCallRecording=function(r){return e.__awaiter(this,void 0,void 0,(function(){var s,n,a,o,c;return e.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),s=t.store.getState().fetchDefaults,n=s.baseURL,a=s.headers,[4,fetch("".concat(n,"/historycall/listen_callrec/").concat(r),{headers:e.__assign({},a)})];case 1:if(!(o=i.sent()).ok)throw new Error(o.statusText);return[4,o.json()];case 2:return[2,i.sent()];case 3:throw c=i.sent(),new Error(c);case 4:return[2]}}))}))},exports.getRecordingFileName=function(r){return e.__awaiter(this,void 0,void 0,(function(){var s,n,a,o,c;return e.__generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),s=t.store.getState().fetchDefaults,n=s.baseURL,a=s.headers,[4,fetch("".concat(n,"/historycall/down_callrec/").concat(r),{headers:e.__assign({},a)})];case 1:if(!(o=i.sent()).ok)throw new Error(o.statusText);return[4,o.json()];case 2:return[2,i.sent()];case 3:throw c=i.sent(),new Error(c);case 4:return[2]}}))}))}; //# sourceMappingURL=history_call.js.map