Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1-way Audio on Local App, but 2-way working on Sip.js Demo Phone #57

Closed
lylepratt opened this issue Jul 4, 2014 · 9 comments
Closed

Comments

@lylepratt
Copy link

Hi Guys. What version is the SIP.js demo phone running? When I use it to accept a call from PSTN->FreeSWITCH->DemoPhone it works great and I get 2-way audio. However, when I go from PSTN->FreeSWITCH->MyLocalApp I'm only getting 1-way audio (PSTN side can hear me, but browser side can't hear them).

My Local App is running "sip.js": "0.5.0+bower". I've looked at the code from the Demo Phone and can't find anything significantly different that could be causing this.

Any tips?

@josephfrazier
Copy link
Contributor

Hmm, I'm actually not sure which version the demo phone runs. I doubt the problem would be a due to a version difference, but if you want to be sure, you could run the demo phone locally and have it use 0.5.0+bower.

However, if it's the same Freeswitch in both cases, it sounds like your app might be receiving media, but not rendering it correctly. You can use chrome://webrtc-internals/ or Wireshark to determine whether or not media is flowing in.

@lylepratt
Copy link
Author

Yep, same FreeSWITCH and same Browser. Thats why its so weird!

I'll try out those tools later. Thanks for the pointers.

@lylepratt
Copy link
Author

Progress! I didn't realize that I actually had to manually attach the stream to a video element. Is that really necessary or am I missing something?

After I did this I get sound:

        var element = $(".video_container video")[0];
        var stream = this.mediaHandler.getRemoteStreams()[0];

        if (typeof element.srcObject !== 'undefined') {
          element.srcObject = stream;
        } else if (typeof element.mozSrcObject !== 'undefined') {
          element.mozSrcObject = stream;
        } else if (typeof element.src !== 'undefined') {
          element.src = URL.createObjectURL(stream);
        } else {
          console.log('Error attaching stream to element.');
        }

Can you use an audio element instead of a video element? Is there a more programatic way of doing this using something like SoundManager2?

@josephfrazier
Copy link
Contributor

(Typing on phone) you can use this if you build from source: 4096365

@lylepratt
Copy link
Author

Cool! TY for your help (especially on this holiday weekend). I'll mark this as closed.

@lylepratt
Copy link
Author

Hey just curious: is there a reason why the Bower version isn't pulling in the latest? Or why there isn't a Bower version that does? Having trouble getting the PhoneRTCMediaHandler to work with Bower version, so I'm assuming I need to build.

@egreenmachine
Copy link
Collaborator

It is not surprising that PhoneRTCMediaHandler does not work with 0.5.0. We are preparing to release 0.6.0 very soon, and that will be on Bower. We do not include dist files on GitHub so we cannot make a bower release for the latest version at any given point.

@lylepratt
Copy link
Author

I see. Thanks for the clarification! I'll build from source for now.

@egreenmachine
Copy link
Collaborator

Just wanted to give you an update that we have released 0.6.0. It should be available on Bower now as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants