Capturing SIP Response Code in ARI on channel hangup

How to capture SIP Response code on hangup like 4XX ane 5XX SIP Response code along with the text SIP Reason key in ARI?

We are using Node ARI client. We do receive cause code and cause text which represents the Q.850 cause code. We also wish to capture the SIP Response code on channel hangup.

Kindly suggest how can we do the same once the channel is hanged up?

Have you tried the same way as you would do it in dial plan? (HANGUPCAUSE function.)

If by reason key, you mean the human friendly text after the status code, I’m not aware that that is preserved anywhere, and it shouldn’t provide any more information.