Hangupcause changing problem

we are trying to implement a 3 tier voip stack

the top tier being the voip provider
the middle being an asterisk box to interface to the provider and the bottom tier are to be customers asterisk servers

in testing I have found that the SIP return values and hangupcause codes are changing. this means that the bottom tier is not getting the correct cause for the hangup.

here is an example

an extension on a test box calls an invalid number

the service provider returns 480 temporarily unavailable, hangupcause 19 (BUSY) - this is ok
the Gateway server receives this and then passes 503 Service Unavailable and hangupcause 19 (BUSY)
the last box is then treating this as 503 Service Unavailable and hangupcause 34 (CONGESTION)

so from the original 480/19 we get translated to 503/34
we really want the 480/19 to be understood by the last box so it can pass this via the AMI

cany anyone shed any light on this?

I think there was a bug report about subscriber busy getting transformed.

However, it important to understand that what Asterisk actually does is to translate 408 to 19, send the 19 to the incoming channel, and then translate back into a SIP code. As there isn’t a one to one mapping between SIP codes and ISDN ones, there will, inevibitably, be some changes in the process. This is because Asterisk is a back to back user agent, not a proxy, and, moreover, because it was first developed for non-VoIP use.