[Home]

Summary:ASTERISK-29699: ConfBridge doesn't detect disconnect from webrtc
Reporter:Dennis Haney (CineCine)Labels:webrtc
Date Opened:2021-10-22 03:07:31Date Closed:2021-10-22 06:07:44
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip Core/Bridging
Versions:18.7.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Linux asteriskcloudpjsip 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux Attachments:
Description:It seems that ConfBridge doesn't detect when the user has crashed/disconnected or otherwise closed the wss connection.

 == WebSocket connection from 'me:1247' closed
   -- Removed contact 'sips:mylogin@me:1247;transport=ws;rtcweb-breaker=no' from AOR 'mylogin@someuniquevalueforyoumachine.mydomain.com' due to shutdown
 == Contact mylogin@someuniquevalueforyoumachine.mydomain.com/sips:mylogin@me:1247;transport=ws;rtcweb-breaker=no has been deleted

Checking state of the confbridge user was in at the time:

asteriskcloudpjsip*CLI> confbridge list 6f22d552eec54391951519ef4b9665bf
Channel                        Flags  User Profile     Bridge Profile   Menu             CallerID
============================== ====== ================ ================ ================ ================
PJSIP/mylogin.someuniquevalueforyoumachine.mydomain.com-00000001 M      interviewer      default_bridge   default_menu     <unknown>

asteriskcloudpjsip*CLI> pjsip show channels

 Channel:  <ChannelId........................................>  <State.....>  <Time.....>
     Exten: <DialedExten.............>  CLCID: <ConnectedLineCID.......>
==========================================================================================

 Channel: PJSIP/mylogin.someuniquevalueforyoumachine.mydomain Up            00:14:28
     Exten: 1                           CLCID: "someuniquevalueforyoumachine.mydomain.com" <>

This never gets cleaned up.

asteriskcloudpjsip*CLI> pjsip show channelstats like my

                                            ...........Receive......... .........Transmit..........
BridgeId ChannelId ........ UpTime.. Codec.   Count    Lost Pct  Jitter   Count    Lost Pct  Jitter RTT....
===========================================================================================================

f3bd17e0 mylogin.someuni 00:14:57 opus      140       0    0   0.000  44841       0    0   0.003   0.000


Objects found: 1

Furthermore, Transmit never detects it is sending packets into the void and marks them as dropped.

Comments:By: Asterisk Team (asteriskteam) 2021-10-22 03:07:34.486-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Joshua C. Colp (jcolp) 2021-10-22 04:24:37.975-0500

This is not a bug. ConfBridge itself doesn't detect such things. It's up to the channel driver (chan_pjsip) to detect it and then hang up the channel. There are various options on the PJSIP endpoint, such as rtp_timeout, which can be used for this. There are also session timers which do it from a SIP protocol level, which are done using the "timers" option..

If these aren't set then the channel will continue.

By: Dennis Haney (CineCine) 2021-10-22 06:00:04.179-0500

Thanks for your prompt reply.

Where is the option to do so when the wss tcp connection is lost?

"Timers" settings in pjsip seems to be mostly undocumented? The only mention I can find is
https://wiki.asterisk.org/wiki/display/AST/Asterisk+18+Configuration_res_pjsip#Asterisk18Configuration_res_pjsip-endpoint_timers
What do they actually do? I don't want to just randomly hangup in the middle on someones conference call because they "talked to long".

Reconnecting with max_contacts=1 also doesn't invalidate former open channels.

rtp_timeout is still pretty useless, because I cannot figure out a way to detect if the conference contains an old dead channel, or I need to reinvite the user again.
Even if i DO reinvite the user again to the same channel, there is now 2 users of the same name and I get an AMI ConfbridgeLeave/Hangup despite still being in the conference with a live connection.
MusicOnHold also doesn't play when the same user joins twice.

By: Asterisk Team (asteriskteam) 2021-10-22 06:00:04.694-0500

This issue has been reopened as a result of your commenting on it as the reporter. It will be triaged once again as applicable.

By: Joshua C. Colp (jcolp) 2021-10-22 06:07:37.277-0500

There is no option currently to terminate channels if an underlying TCP/TLS/WSS connection is lost. Session timers send a periodic SIP request to check that the SIP signaling is alive, if it's not then the channel is hung up. I don't understand why RTP timeout doesn't work for you - it hangs up the channel (the same as if there were an option to hang up the channel if the connection was lost) when media stops flowing for a period of time. It sounds like you're expecting some kind of event or notification that a channel has "died". That doesn't exist currently for anything. All options just hang the channel up.

I'd suggest raising this on the community forum instead[1] as this really seems to be centered around your usage and the options available.

[1] https://community.asterisk.org/