Summary:ASTERISK-10595: Asterisk doesn't recognize a "408 Request Timeout"
Reporter:Iñaki Baz Castillo (ibc)Labels:
Date Opened:2007-10-23 04:57:55Date Closed:2011-06-07 14:02:45
Versions:Frequency of
Environment:Attachments:( 0) Asterisk-proxy_timeout-408-FAILS.txt
( 1) Asterisk-timeout_in_called-OK.txt
Description:If Asterisk calls a SIP user and receives from him a "480 User not responding" Asterisk hangups the call OK.

But in my case Asterisk calls a SIP user registered in a OpenSer, and this OpenSer cancels not responding calls after 60 seconds and replies with a "408 Request Timeout", but Asterisk ignores this reply and doesn't send the ACK. So the channel remains open.

About "408 Request Timeout" RFC 3261 says:

   21.4.9 408 Request Timeout

    The server could not produce a response within a suitable amount of
    time, for example, if it could not determine the location of the user
    in time.  The client MAY repeat the request without modifications at
    any later time.

I think Asterik should accept a "408" and terminate the call.

****** STEPS TO REPRODUCE ******

Just reply (using OpenSer or any SIP device) to an Asterisk INVITE with "408". Asterisk will ignore it.


I attach two files:

- "Asterisk-timeout_in_called-OK.txt" contains a trace where Asterisk has called a OpenSer user and the final device has sent "480 User not responding" after X secons and Asterisk has terminated the call.

- "Asterisk-proxy_timeout-487-FAILS.txt" contains a similar trace but in this case is the proxy OpenSer who terminates the call after X seconds by sending a CANCEL to called and "408 Request Timeout" to Asterisk. Note how this reply is ignored by Asterisk so the channel remains open.
Comments:By: Iñaki Baz Castillo (ibc) 2007-10-23 05:01:45

Sorry, the name of second attached file is obviosly:
instead of:

By: Iñaki Baz Castillo (ibc) 2007-10-23 08:26:18

I think I've detected the problem, is "pedantic=yes" and To_tag headers related:

I use "pedantic=yes" and because OpenSer allow pararell forking the replies generated by OpenSer (as this 408) have a new To_tag different from any To_Tag of previous responses (180) of ringing clients.

The same occurs with CANCEL. I reported this bug in OpenSer but it seems to be related to this same issue: the To_tag in "pedantic" mode:

So this is not a problem with 408 reply, but with TO_tag in pedantic mode.

By: Olle Johansson (oej) 2007-11-08 11:11:49.000-0600

Ok, since I can't see the issue as a bug in Asterisk (we do handle 408's) it needs to be fixed on the OpenSer side.

By: Iñaki Baz Castillo (ibc) 2007-11-12 02:31:40.000-0600

IMHO this is not a bug in OpenSer. I can put another example:

- pedantic=yes
- Asterisk INVITE's a OpenSer user.
- Asterisk CANCEL's the INVITE.
- The phone stops ringing and return a "487: Request Terminated".
- Asterisk doesn't accept the "487" and resends the CANCEL again and again.
- In fact CLI says during long time (after a CANCEL timeout):
 CLI> sip show channels
 Peer       User/ANR  Call ID      Seq (Tx/Rx)  Form  Hold  Last Message ibc       534f49530ce  00103/00000  unkn  No    Tx: CANCEL

I attach now the above example as "pedantic_mode_fails_CANCEL.txt".

PD: I asked this question in "SIP implementators" and confirmed that this is not an OpenSer's bug, but Asterisk's one:

By: Olle Johansson (oej) 2007-11-15 05:38:19.000-0600

That's a different issue. We do accept 408, but now you report that we don't support 487.

We do in fact hangup if we receive a 487.

When you add a log file here, we need a full SIP debug with debug and verbosity set to 4, so we can see what's going on in your Asterisk (please read the bug guidelines).  Without this data, it's very hard to determine what the problem really is. Thanks.

By: Iñaki Baz Castillo (ibc) 2007-11-15 05:51:45.000-0600

> That's a different issue. We do accept 408, but now you report that
> we don't support 487.

Not in fact. I report that in pedantic mode Asterisk doesn't recognize replies of UAS through a SIP proxy (as OpenSer).

Anyway note that this report is some extrange: first I reported a thing and later I changed it completely XD

Please, let me some time to prepare a good debug for it. If you want, you can close this bug as INVALID and I'll open a new one (better).


By: Olle Johansson (oej) 2007-11-15 05:56:12.000-0600

Let's keep this bug open. We do handle those messages, but maybe have a problem with your forking scenario. Please give me a proper debug file to work with, thank you.

By: Iñaki Baz Castillo (ibc) 2007-12-13 07:03:51.000-0600

Hi, I've opened a new bug ASTERISK-11026 for this "pedantic mode" related issue:

Maybe the present report could be closed since Asterisk does recognize "408 Request Timeout".