can I use indexDB to store sipml5 client objects

72 views Asked by At

regarding this problem: Call get disconnected while I am refreshing the SIPML5 demo page .

can be found here https://groups.google.com/forum/#!msg/doubango/BlAww-8Wq4U/79Rupoa4BwAJ;context-place=searchin/doubango/page$20refresh%7Csort:date

I am searching for a solution to keep the call going even if the client page get refreshed

I know that all variables lives inside the javascript file will be re-created when a page get refreshed but my question is :

can I use indexDB to store all the objects that sipml5 client use so the call never get disconnected on page refresh?

1

There are 1 answers

0
Rohith Murali On

Yes, you can store and retrieve sipml5 client objects from and to IndexedDB since it can store any type of objects and use Structured Cloning Algorithm to serialize the data. Basically it can save all javascript data types in plain object, in nested or in circular reference.

The structured clone algorithm is an algorithm defined by the HTML5 specification for copying complex JavaScript objects. It is used internally when transferring data to and from Workers via postMessage() or when storing objects with IndexedDB. It builds up a clone by recursing through the input object while maintaining a map of previously visited references in order to avoid infinitely traversing cycles. You can get more information from here