Summary:ASTERISK-12166: If HANGUPCAUSE is 3 (No route to destination) why Asterisk replies a 503?
Reporter:Iñaki Baz Castillo (ibc)Labels:
Date Opened:2008-06-10 04:50:42Date Closed:2011-06-07 14:08:25
Versions:Frequency of
Description:From RFC 3398:

 ISUP Cause value                        SIP response
 ----------------                        ------------
 1  unallocated number                   404 Not Found
 2  no route to network                  404 Not found
 3  no route to destination              404 Not found

But if Asterisk does:

 exten => XXX,1,Dial(SIP/non_existing_peer)

it replies:

 SIP/2.0 503 Service Unavailable
 X-Asterisk-HangupCause: No route to destination
 X-Asterisk-HangupCauseCode: 3

Why not a 404 as RFC 3398 suggests?


Of course I can set manually the SIP response code with:

but why Asterisk is not more RFC compliant in this subject?
Comments:By: Joshua C. Colp (jcolp) 2008-06-10 07:32:37

chan_sip does correctly map that cause code to 404 Not Found. What I suspect is happening is that Congestion is being called on the channel which causes the 503 Service Unavailable to be sent back. Please attack a complete console output to confirm this.

By: Iñaki Baz Castillo (ibc) 2008-06-10 08:07:02

Is it enough with this CLI output?:

   -- Executing [555@pruebas:1] Dial("SIP/pruebas200-08186c00", "SIP/non_existing_peer") in new stack
[Jun 10 15:12:49] WARNING[25734]: chan_sip.c:2923 create_addr: No such host: non_existing_peer
Really destroying SIP dialog '76ab50685efa771700f227b95aa8897a@' Method: INVITE
[Jun 10 15:12:49] WARNING[25734]: app_dial.c:1183 dial_exec_full: Unable to create channel of type 'SIP' (cause 3 - No route to destination)
 == Everyone is busy/congested at this time (1:0/0/1)
 == Auto fallthrough, channel 'SIP/pruebas200-08186c00' status is 'CHANUNAVAIL'
Really destroying SIP dialog 'srhbqwsjwhgcfrp@ibc.lan' Method: ACK

By: Joshua C. Colp (jcolp) 2008-06-10 08:08:39

That auto fallthrough will call Congestion on the channel and send 503 Service Unavailable.

By: Iñaki Baz Castillo (ibc) 2008-06-10 08:12:19

but is it the expected or the correct behaviour? is it a bug?

By: Joshua C. Colp (jcolp) 2008-06-10 08:14:30

If Congestion is called on a channel, what do you expect it to do? For me I expect it to send back Congestion.

By: Iñaki Baz Castillo (ibc) 2008-06-10 08:54:10

Yes, maybe it's a limitation/issue in 'autofallthrough'.

By: Michiel van Baak (mvanbaak) 2008-06-14 05:05:48

This is expected behaviour.
Have a look at the default stdexten macro. It will act based on dialstatus and not auto-fallthrough