How to get hangup reason?

Hi,

i have two asterisk servers connected via iax trunk. Users are logged via SIP to first server. Second server have Sangoma card. Calls looks like this:

USER<–SIP–>Asterisk1<–IAXTRUNK–>Asterisk2<—>SangomaA102<–>PSTN

Many calls getting hangup:

-- Zap/11-1  is proceeding passing it to IAX2/192.168.2.8:4569-6025

== Spawn extension (default, 601XXXXXX, 1) exited non-zero on ‘IAX2/192.168.2.8:4569-6025’
– Hungup ‘IAX2/192.168.2.8:4569-6025’

How can i debug to get reason of this hangups? Its something about 60%.
Wehn i try many times sometimes it works on 1 try sometime on after 8 tries.

Best regards

Hello,

I am in the same (more or less) situation. I have a lot of hang ups and I want to know the reason. I am using the manager to see the hangup codes.
voip-info.org/wiki/index.php … angupcause

But I want to add this variable to de cdr. Is this posible? How?

Thank you

exten => h,1,Set(CDR(userfield)=Hangupcause:${HANGUPCAUSE})