Summary:ASTERISK-02912: SIP response code handling
Reporter:nording (nording)Labels:
Date Opened:2004-12-01 09:48:43.000-0600Date Closed:2011-06-07 14:11:57
Versions:Frequency of
Description:SIP response 503 "Service Unavailable" from PSTN gateway usualy (at least from cisco 53xx/54xx) indicates "congestion" or "no chanel/circuit available" situation, while current chan_sip interprets 503 as "user busy", which is totally wrong and makes * to give up instead of trying alternative trunks.
Comments:By: Olle Johansson (oej) 2004-12-01 14:53:08.000-0600

From chan_sip:
case 503: /* Service Unavailable */
if (owner)                                                ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
Are you sure that you are getting a busy or is it your dial plan?

By: nording (nording) 2004-12-01 18:05:38.000-0600

Yes, i am pretty sure i am getting busy.

Here is debug transcript:
   -- Goto (fulllist_intcode,70951372674,1)
   -- Called 70951372674@xxx.xxx.xxx.66
   -- Got SIP response 503 "Service Unavailable" back from xxx.xxx.xxx.66
   -- SIP/xxx.xxx.xxx.66-8645 is circuit-busy
 == Everyone is busy/congested at this time
   -- Executing Busy("SIP/", "") in new stack
 == Spawn extension (fulllist_intcode, 70951372674, 102) exited non-zero on 'SIP/'                                                                                          

And here is my dialplan:
include => to_local_users
include => out

exten => _7XXXXXXXXXX,1,Dial,SIP/${EXTEN:0}@xxx.xxx.xxx.66
exten => _7XXXXXXXXXX,2,Dial,SIP/5000#${EXTEN:0}@xxx.xxx.xxx.102 ;fallback trunk
exten => _7XXXXXXXXXX,3,Congestion
exten => _7XXXXXXXXXX,102,Busy
exten => _7XXXXXXXXXX,103,Busy

Version is stable-1.0.0

By: Olle Johansson (oej) 2004-12-03 15:44:48.000-0600

What is in the DIALSTATUS variable?

By: Mark Spencer (markster) 2004-12-03 18:38:22.000-0600

Busy and congested both skip to n+101, you will need to use ${DIALSTATUS} like in the example config.