[asterisk-bugs] [JIRA] (ASTERISK-28718) chan_sip: Returns 403 if RTP ports are depleted, should return 503

Friendly Automation (JIRA) noreply at issues.asterisk.org
Thu Feb 6 07:25:25 CST 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=249679#comment-249679 ] 

Friendly Automation commented on ASTERISK-28718:
------------------------------------------------

Change 13678 merged by Joshua Colp:
chan_sip: Return 503 if we're out of RTP ports

[https://gerrit.asterisk.org/c/asterisk/+/13678|https://gerrit.asterisk.org/c/asterisk/+/13678]

> chan_sip: Returns 403 if RTP ports are depleted, should return 503
> ------------------------------------------------------------------
>
>                 Key: ASTERISK-28718
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28718
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/Interoperability
>    Affects Versions: 13.29.1
>            Reporter: Walter Doekes
>            Assignee: Walter Doekes
>
> If you're out of RTP ports, you get this:
> {noformat}
> [2014-08-12 09:14:06] ERROR[23808] res_rtp_asterisk.c:
>   Oh dear... we couldn't allocate a port for RTP instance '0x7f73e04d9098'
> [2014-08-12 09:14:06] NOTICE[23808] chan_sip.c:
>   Failed to authenticate device '<sip:XXX>;tag=XXX' (x.x.x.x:5060)
> {noformat}
> That in turn causes a 403 to be sent (because of the "AUTH_RTP_FAILED"), and the call will fail:
> {code}
>                if (res < 0) { /* Something failed in authentication */
>                        ast_log(LOG_NOTICE, "Failed to authenticate device %s\n", sip_get_header(req, "From"));
>                        transmit_response_reliable(p, "403 Forbidden", req);
> {code}
> What chan_sip _should_ do, is either be silent, or return a 5xx error, so the caller can choose a different machine to retry the call on.
> *And, pjsip, for completeness sake*
> I did take a quick peek at what pjsip does, and there, it seems a 488 is returned:
> {code}
> static int handle_incoming_sdp(struct ast_sip_session *session, const pjmedia_sdp_session *sdp)
> ...
>                         res = handler->negotiate_incoming_sdp_stream(session, session_media, sdp, i, stream);
>                         if (res < 0) {
>                                 /* Catastrophic failure. Abort! */
>                                 return -1;
> ...
>         if (!handled) {
>                 return -1;
>         }
> {code}
> {code}
>                 if (handle_incoming_sdp(invite->session, sdp_info->sdp)) {
>                         tdata = NULL;
>                         if (pjsip_inv_end_session(invite->session->inv_session, 488, NULL, &tdata) == PJ_SUCCESS
> {code}
> That does make sense in the (general) {{!handled}} case: a codec mismatch should indeed get a 488. But an out-of-memory/ports situation may benefit from a different status.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list