Handling multipe RTCSessions

72 views
Skip to first unread message

rene.so...@gmail.com

unread,
Aug 8, 2022, 1:47:37 PM8/8/22
to JsSIP
Hi

I'm trying to make it possible for my app to handle multiple lines. I tried making a div with data on it's session.

I have one <audio></audio> on the page. And my plan was to switch the stream when needed.

My problem though, is that the session.connection.addEventListener('addstream', ...) only gets called once, and I'm unsure if I can trigger it again somehow, if at all...

I'm guessing I would have the same problem on incoming calls as well.

I have looked at and tried renegotiate() but it doesn't seem to do anything, or I am using it wrongly of course :D

Any hints to the right direction would be much appreciated!

Thanks in advance :)

Regards René

Bill Kervaski

unread,
Aug 8, 2022, 1:49:16 PM8/8/22
to js...@googlegroups.com
It works be easier and use less bandwidth to just place the additional calls on hold.

From: js...@googlegroups.com <js...@googlegroups.com> on behalf of rene.so...@gmail.com <rene.so...@gmail.com>
Sent: Monday, August 8, 2022 12:47:37 PM
To: JsSIP <js...@googlegroups.com>
Subject: [JsSIP] Handling multipe RTCSessions
 
--
You received this message because you are subscribed to the Google Groups "JsSIP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jssip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/bc7a0ba6-2baf-4001-84b8-3f7811d9b9d6n%40googlegroups.com.

Alex Balashov

unread,
Aug 8, 2022, 1:50:25 PM8/8/22
to 'Juha Heinanen' via JsSIP
Hi René,

It seems to me the right way to go here is to place “backgrounded” calls on hold instead.

— Alex
> --
> You received this message because you are subscribed to the Google Groups "JsSIP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jssip+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/bc7a0ba6-2baf-4001-84b8-3f7811d9b9d6n%40googlegroups.com.

--
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

rene.so...@gmail.com

unread,
Aug 8, 2022, 1:54:33 PM8/8/22
to JsSIP
If I made 2 outgoing calls, where I put the first on hold, they would both share the audio-tag, right?

Wouldn't you get the music on hold while you're talking with the second outgoing?

- René

Alex Balashov

unread,
Aug 8, 2022, 2:00:17 PM8/8/22
to 'Juha Heinanen' via JsSIP
Hi,

They would indeed share the audio tag, but I think the ’track’ event is the only one you need to worry about handling:

https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/track_event

— Alex

> On Aug 8, 2022, at 1:54 PM, rene.so...@gmail.com <rene.so...@gmail.com> wrote:
>
> If I made 2 outgoing calls, where I put the first on hold, they would both share the audio-tag, right?
>
> Wouldn't you get the music on hold while you're talking with the second outgoing?
>
> - René
>
> mandag den 8. august 2022 kl. 19.49.16 UTC+2 skrev bker...@heavylogic.com:
> It works be easier and use less bandwidth to just place the additional calls on hold.
> From: js...@googlegroups.com <js...@googlegroups.com> on behalf of rene.so...@gmail.com <rene.so...@gmail.com>
> Sent: Monday, August 8, 2022 12:47:37 PM
> To: JsSIP <js...@googlegroups.com>
> Subject: [JsSIP] Handling multipe RTCSessions
>
> Hi
>
> I'm trying to make it possible for my app to handle multiple lines. I tried making a div with data on it's session.
>
> I have one <audio></audio> on the page. And my plan was to switch the stream when needed.
>
> My problem though, is that the session.connection.addEventListener('addstream', ...) only gets called once, and I'm unsure if I can trigger it again somehow, if at all...
>
> I'm guessing I would have the same problem on incoming calls as well.
>
> I have looked at and tried renegotiate() but it doesn't seem to do anything, or I am using it wrongly of course :D
>
> Any hints to the right direction would be much appreciated!
>
> Thanks in advance :)
>
> Regards René
>
> --
> You received this message because you are subscribed to the Google Groups "JsSIP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jssip+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/bc7a0ba6-2baf-4001-84b8-3f7811d9b9d6n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "JsSIP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jssip+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/c12ff48a-ff2e-4349-9386-f51fb36fc782n%40googlegroups.com.

rene.so...@gmail.com

unread,
Aug 8, 2022, 2:04:00 PM8/8/22
to js...@googlegroups.com
Hi Alex

I'll go over the tracks-part again and see if I can see the answer!

Thank you very much for your time and help! 😊

- René

-----Oprindelig meddelelse-----
Fra: js...@googlegroups.com <js...@googlegroups.com> På vegne af Alex Balashov
Sendt: 8. august 2022 20:00
Til: 'Juha Heinanen' via JsSIP <js...@googlegroups.com>
Emne: Re: [JsSIP] Handling multipe RTCSessions
You received this message because you are subscribed to a topic in the Google Groups "JsSIP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jssip/65pwb9hgN4w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jssip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jssip/45FE330A-2D29-45BE-BB43-56874BB2F526%40evaristesys.com.

Iñaki Baz Castillo

unread,
Aug 8, 2022, 2:08:21 PM8/8/22
to js...@googlegroups.com
If you handle  N JsSIP sessions, each session has its own PeerConnection with its own remote streams and track events. No idea why the discussion here is about getting different remote tracks from a SINGLE PeerConnection.

--
Iñaki Baz Castillo
<i...@aliax.net>

Alex Balashov

unread,
Aug 8, 2022, 2:09:17 PM8/8/22
to js...@googlegroups.com
I did not mean to imply that with the discussion. 

Sent from mobile, with due apologies for brevity and errors.

On Aug 8, 2022, at 2:08 PM, 'Iñaki Baz Castillo' via JsSIP <js...@googlegroups.com> wrote:



rene.so...@gmail.com

unread,
Aug 8, 2022, 2:15:09 PM8/8/22
to js...@googlegroups.com

It’s not about getting remote tracks from a single connection, rather getting the remote track from a specific session.

 

If I have 3 calls (1 active, 2 on hold) and wish to switch to call number 2 and set the first on hold I would need to attach the remote track to my audio-tag – Which is what I’m having difficulties at 😊

 

- René

 

Fra: 'Iñaki Baz Castillo' via JsSIP <js...@googlegroups.com>
Sendt: 8. august 2022 20:08
Til: js...@googlegroups.com
Emne: Re: [JsSIP] Handling multipe RTCSessions

 

If you handle  N JsSIP sessions, each session has its own PeerConnection with its own remote streams and track events. No idea why the discussion here is about getting different remote tracks from a SINGLE PeerConnection.

Iñaki Baz Castillo

unread,
Aug 8, 2022, 2:18:29 PM8/8/22
to js...@googlegroups.com
What’s the problem? You get the remote audio track from the corresponding PeerConnection, you create a MediaStream, you attach the remote track to it, then set that MediaStream into the audio tag. That’s basically all.

Reply all
Reply to author
Forward
0 new messages