emkei / sipml5

Automatically exported from code.google.com/p/sipml5
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

"Cache the media stream" checkbox not working #130

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
a) Before posting your issue you MUST answer to the questions otherwise it
will be rejected (invalid status) by us
b) Please check the issue tacker to avoid duplication
c) Please provide network capture (Wireshark) or Javascript console log
if you want quick response

What steps will reproduce the problem?
1. Open expert mode
2. check "Cache the media stream" 
3. save
4. reload page
5. call to extension
6. call again

What is the expected output? What do you see instead?
I see: firefox asks me to share microphone for both calls
expect: firefox ask me only once

What version of the product are you using? On what operating system?
simpl5 svn=203
firefox 23.0
gentoo linux 3.1.10-r1

Please provide any additional information below.
In  src/tinySIP/src/dialogs/tsip_dialog_invite.js in function new_msession_mgr 
used value of this.get_stack().network.b_cache_stream to set "cache-stream" but 
in src/tinySIP/src/tsip_stack.js this value is stored in 
this.media.b_cache_stream. Caching itself seems to be working fine.

Original issue reported on code.google.com by sts...@gmail.com on 17 Oct 2013 at 8:58

GoogleCodeExporter commented 9 years ago
This is expected to on chome only for now.

Original comment by boss...@yahoo.fr on 30 Jan 2014 at 12:31

GoogleCodeExporter commented 9 years ago
Issue 152 has been merged into this issue.

Original comment by boss...@yahoo.fr on 30 Jan 2014 at 12:31

GoogleCodeExporter commented 9 years ago

Hi! I have a question.
Issue 152 
Status:     Duplicate
Merged:     issue 130
Owner:   ----
Closed:      Jan 30

Is it fixed or closed? I haven't seen any code submission and the bug still 
exists.

Original comment by iskomor...@gmail.com on 25 Mar 2014 at 10:36

GoogleCodeExporter commented 9 years ago
Well, I have found the reason why sipml don't cache media streams. It's because 
of copy & paste (I guess). The bug is at:

tsip_dialog_invite.prototype.new_msession_mgr = function(e_type, s_addr, 
b_ipv6, b_offerer){
    ...
   o_msession_mgr.set(
            tmedia_session_mgr.prototype.SetParamSession(o_msession_mgr.e_type, "ice-servers", this.get_stack().network.ao_ice_servers),
            tmedia_session_mgr.prototype.SetParamSession(o_msession_mgr.e_type, "cache-stream", this.get_stack().network.b_cache_stream),
            tmedia_session_mgr.prototype.SetParamSession(o_msession_mgr.e_type, "bandwidth", this.get_session().media.o_bandwidth),
            tmedia_session_mgr.prototype.SetParamSession(o_msession_mgr.e_type, "video-size", this.get_session().media.o_video_size)

But b_cache_stream isn't stored in this.get_stack().network. It is stored in 
this.get_stack().media.
The solution is obvious - to change this.get_stack().network.b_cache_stream 
with this.get_stack().media.b_cache_stream

Original comment by iskomor...@gmail.com on 20 Aug 2014 at 8:10

GoogleCodeExporter commented 9 years ago
I would like to endorse above solution, and it seems there is a mix up in the 
SIPML5 between the flags this.get_stack().media.b_cache_stream and 
this.get_stack().media.b_cache_stream

This is how i got this working. you need to implement the above snippet first, 
and i had to introduce a delay 
 here
(Line number can differ, so i prefer you search for this code snippet.)
  if (this.e_type == tmedia_type_e.AUDIO && (this.b_cache_stream && __o_jsep_stream_audio)) {
   tmedia_session_jsep01.onGetUserMediaSuccess(__o_jsep_stream_audio, c)
  }

so i had to change it too, to this

if (this.e_type == tmedia_type_e.AUDIO && (this.b_cache_stream && 
__o_jsep_stream_audio)) {
      setTimeout(function () {
          tmedia_session_jsep01.onGetUserMediaSuccess(__o_jsep_stream_audio, c)
      }, 1000);
  }

this got everything working fine , but i do accept that set time out is not a 
nice solution to this problem. So if any one suggest something better than that 
would be great.

Original comment by arifimra...@gmail.com on 31 Dec 2014 at 2:09