Microphone selection problems with sipjs/simpleuser

182 views
Skip to first unread message

Kevin Eduardo Portillo Durán

unread,
Mar 30, 2021, 5:16:24 PM3/30/21
to SIP.js

Hi, hoping you have a good day. Actually I’m working on a webphone using SIP.JS demo with SimpleUser and I have the task of adding a microphone selector.  Can anyone help with this?



I already added the event 

to get the ID of the selected microphone using navigator.mediaDevices.enumerateDevices()
list_microphones.png
and also the new audio stream using the following code
eventlistener_list_microphones.png 
So, I have some questions for you:
  1. The overall question is How can I start a new call with the select microphone? 
    Related to that question:
  2. Does SimpleUser the API - or is it in parallel to the API?
  3. Is it possible to keep the simpleuser framework, but add this API call, or (related to question 1) do I have to rebuild all of the elements of SimpleUser with the API?
  4. Extending 1- if we have a call in progress and we want to change the selected microphone, is that easy/possible?

micselec.png

Eric Green

unread,
Apr 1, 2021, 6:26:57 PM4/1/21
to SIP.js
None of this is possible with SIP.js out of the box and we have no intention of adding any of it.

You will need your own SessionDescriptionHandler which you can extend ours or create your own. It can be passed in to the full API at runtime as a parameter. No need to compile SIP.js to take this approach. It is built to be swapped out by the user. The one we provide is very basic as we hope people will swap it out to suit the needs of their application.

SimpleUser is built on top of the public SIP.js API. So if you want to use it and change it to suit your needs you can do so. You should not need to rebuild SIP.js to make changes to it if you create your own.

Lastly, I believe it is possible to change audio sources during a call with replaceTrack. But you will have to test it out.

-Eric Green 
Reply all
Reply to author
Forward
0 new messages