[asterisk-dev] [Code Review] SIP: incorrect usage of 503 message

Olle E. Johansson oej at edvina.net
Tue Aug 25 01:42:29 CDT 2009


25 aug 2009 kl. 01.59 skrev David Vossel:

> A 503 message tells a client it should try and forward the request  
> to an alternate server and should not forward any other requests to  
> the initial server for a certain time-out period.  When Asterisk  
> receives a 503 message it passes that as a AST_CONTROL_CONGESTION  
> frame.  If the other side is SIP, the AST_CONTROL_CONGESTION frame  
> is converted back to a 503 message and sent to the client.  The  
> client may then attempt to fall back to an alternate server when  
> nothing was wrong with asterisk to begin with... Asterisk was  
> essentially just forwarding the 503.
>
> This patch simply translates AST_CONTROL_CONGESTION into a 500 error  
> rather than a 503.  In most cases I believe this is correct, but I  
> don't fully understand the implications of such a change.   
> AST_CONTROL_CONGESTION is used for many things.  Could this change  
> actually adversely affect failover in any way?
>
> I also changed a few explicit 503 errors to 500 errors where I felt  
> a 500 was more appropriate.

Isn't this something that could be handled in the dialplan? We have  
the ability to set hangup causes. The server in between can catch the  
congestion and set a specific hangup cause that generates a proper SIP  
message. We can add a custom hangup cause if the current ones doesn't  
do what you want.

  The way you change it today, will cause Asterisk to send 500 when we  
get congestion from ISDN or other channels, which we don't want to  
happen.

You're also changing a lot of other 503's to 500 which doesn't really  
make sense. One of them should be something totally different - the  
503 for call pickup - but the others should propably be untouched or  
you have to explain why you are changing all of them.

Something we should do, however, is adding a retry-after heading to  
the 503.

/O





More information about the asterisk-dev mailing list