[asterisk-users] evaluate SIP response codes in dialplan

Alex Balashov abalashov at evaristesys.com
Wed Jan 14 08:17:16 CST 2009


The simple answer is that Asterisk is too high-level.

But you can change the response handlers in chan_sip.c to set various 
channel variables to achieve what you want pretty easily.

Klaus Darilion wrote:

> Hi!
> 
> Is it somehow possible to evaluate the SIP response code inside the 
> dialplan?
> 
> I have an Asterisk server which forwards requests to various PSTN 
> gateways with SIP. If the Dial() attempt is not successful I want to 
> differ at least these 3 options:
> - called destination is busy (486): e.g. activate auto-redial
> - called destination does not exist, unassigned number (404)
> - gateway is broken, error, circuit busy (e.g. 503)
> 
> 486 is mapped to DIALSTATUS=BUSY
> but both 503 and 404 is mapped to DIALSTATUS=CONGESTION
> 
> As when Asterisk forwards the response with SIP to the caller the same 
> response code is used, I suspect this information must be stored 
> somewhere inside the channel variable. So, are there any means to access it?
> 
> thanks
> klaus
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users


-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775



More information about the asterisk-users mailing list