[Home]

Summary:ASTERISK-28543: When Asterisk cannot connect to SIP socket it starts to flood with "Bad descriptor" errors and hangs
Reporter:John Smith (user1)Labels:pjsip
Date Opened:2019-09-18 02:39:27Date Closed:2020-09-30 12:41:01
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:16.3.0 16.5.1 Frequency of
Occurrence
Frequent
Related
Issues:
duplicatesASTERISK-28430 res_rtp_asterisk.c: FRACK!, Failed assertion errno != EBADF
Environment: CentOS Linux release 7.6.1810 (Core) x64 Attachments:( 0) 2019-09-18_10-4303.png
( 1) MobaXterm_Personal_11.1_2019-09-16_21-2648.png
Description:    When some endpoint goes offline the following messages appear in the console:

ERROR[2889]: tcptls.c:553 ast_tcptls_client_start: Unable to connect SIP socket to IP:5060: Connection refused

followed by

ERROR[2751]: iostream.c:569 ast_iostream_close: close() failed: Bad file descriptor

Error occurs only for endpoints with protocol=tcp in sip.conf (and probably tls) after some time calls started to drop with "Bad file descriptor" errors and finally after some time Asterisk becomes unresponsible: all endpoints lose their registrations, no calls can be made/received.
Service restart does not help.
Server restart can help for a short time.
Workaround is to remove offline endpoint from sip.conf

sip.conf example:

[phone1]
type=friend
host=10.10.8.8
port=5060
dtmfmode=rfc2833
context=office
directmedia=no
qualify=yes
transport=tcp
allow=!all,alaw,ulaw,g722

checked versions:
16.3.0
16.5.1
Comments:By: Asterisk Team (asteriskteam) 2019-09-18 02:39:28.490-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.

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.

By: Kevin Harwell (kharwell) 2019-09-18 13:57:59.265-0500

The chan_sip channel driver is in 'extended' support status and is supported only by community members.  Your issue is in the queue. Your patience is appreciated as a community developer may work the issue when time and resources become available.

Asterisk is an open source project and community members work the issues on a voluntary basis. You are welcome to develop your own patches and submit them to the project.[1]

If you are not a programmer and you are in a hurry to see a patch provided then you might try rallying support on the Asterisk users mailing list or forums.[2] Another alternative is offering a bug bounty on the asterisk-dev mailing list.[3] Often a little incentive can go a long way.

[1]: https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process
[2]: http://www.asterisk.org/community/discuss
[3]: https://wiki.asterisk.org/wiki/display/AST/Asterisk+Bug+Bounties



By: Kevin Harwell (kharwell) 2019-09-18 14:01:14.037-0500

See comment about _chan_sip_ above. However, if you can reproduce similar results using _chan_pjsip_ (especially if Asterisk eventually becomes unresponsive) do please let us know and we'll reevaluate this issue.