[asterisk-users] Getting SIP Response Code from HANGUPCAUSE

Raj Jain rj2807 at gmail.com
Sat Oct 27 13:29:21 CDT 2007


> > The only place where it is reasonable to customize is in the 
> > specification of the channel in the configuration file.  
> That is where 
> > you would customize, for example, whether DTMF is inband, 
> SIP INFO, or 
> > RFC 2833, as well as what codecs will be negotiated for that 
> > particular user/peer.
> > 
> 
> But you already have the SIP_HEADER function, which is quite 
> contradictory to what you say. This allows users who know 
> what they are doing to examine headers directly. We use this 
> a lot. What would be the harm in having a SIP_RESPONSE 
> function or something alike? 

I'd agree that SIP response code should be accessible from the dial plan.
Knowing the exact SIP response code could be critical for making call
processing decisions. The conversion of SIP response codes to Q.931 codes
(HANGUPCAUSE) is just too lossy. Building a truly protocol agnostic dial
plan API is a worthy goal. But, I think it is somewhat of an unsolvable
problem. The signaling protocols are very different and for various reasons
people have always wanted access to native information elements carried in
the protocol.

Perhaps, a very simple solution for this problem could be to support a
keyword such as "TOPLINE" in the SIP_HEADER function to fetch the topmost
line in a SIP message. This will not only get the caller the response code
for SIP response messages, but will also have the nice byproduct of making
the Request-URI available if the message in question is a SIP request.

- Raj




More information about the asterisk-users mailing list