Вопрос не простой. 11 лет назад такой вопрос возникал,
https://asterisk-dev.digium.narkive.com ... ause-codes
и на него был получен ответ:
The only reason we implemented the passing back of the
raw SIP code in the dialplan is that the conversion to cause is lossy.
That is, several SIP status codes all map back to a single ISUP cause code,
and there are legitimate reasons for wanting to know which status code
was received. What SHOULD happen is that if use_q850_reason is set, then
the cause sent to the core should simply be the cause code in this header,
which you should be able to read in ${HANGUPCAUSE}.
Те есть несколько статусов SIP мапятся на один и тот же ISDN (ISUP) код, и, если включена поддержка Q.850, в ядро должен отправляться тот код отбоя, который содержиться в переменной ${HANGUPCAUSE}.