How to send X-Asterisk-HangupCauseCode header in non-Invite SIP message?

I have two asterisks
I know that SIP_HEADER only works for the initial INVITE, not for any headers in any other SIP messages. Is there a way to send X-Asterisk-HangupCauseCode: header in BYE SIP message?

1-st Asterisk extension.conf

[to-secondAster]
exten => 12345,1,Answer
exten => 12345,n,Dial(SIP/secondAster/9001)
exten => h,1,NoOp(HANGUP CODE SIP_HEADER: ${SIP_HEADER(X-Asterisk-> HangupCauseCode)})

2-nd Asterisk extension.conf:

[from-firstaster]
exten => 9001,1,Answer
exten => 9001,n,Hangup(456)

Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.