[asterisk-users] Get sip response code

Robert Lister robl at linx.net
Thu May 17 18:44:51 MST 2007


On Thu, May 17, 2007 at 12:11:48AM -0600, Ken Williams wrote:
> It's funny Robert would come looking for this tonight, as I've been 
> spending a fair amount of time trying to track this down today.  I then 
> went to the source and found what Andreas had found below.
>  
> However, I'm not a real programmer, but just a hack of a hack....I tried 
> to make my own variable but failed because I don't really know what the 
> hell I'm doing! :D
>  
> Here's one form of what I tried, though I did try lots of different ways, 
> but wasn't able to get it to compile without errors.  At best I got the 
> server to do nothing, at worse I crashed the server when trying to use it:

I asked the question on digium bugs, and I got back a response along the 
lines of: use ${HANGUPCAUSE}. They were not receptive to the idea of having 
a SIP response code variable, or willing to discuss it, or the fact that my 
original problem stems from the fact that "CONGESTION" is used for too many 
things, not just CONGESTION, so it makes it difficult. It should really have 
a FAIL response. (or just rename "CONGESTION" to "FAIL" since that's what it 
acually means.)

It does seem strange though that you can see every sip header with 
${SIP_HEADER(<header>)} but not the actul SIP response.

Hangupcause returns a value (including SIP channels) which is interpreted 
back into a "cause code" RFC3398.

I have since update the wiki docs, as this was all a bit non-obvious to me:

http://www.voip-info.org/wiki/view/Asterisk+Variable+DIALSTATUS
http://www.voip-info.org/wiki/view/Asterisk+Variable+HANGUPCAUSE


Rob



More information about the asterisk-users mailing list