diff options
Diffstat (limited to 'xpp/zap_debug.h')
-rw-r--r-- | xpp/zap_debug.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xpp/zap_debug.h b/xpp/zap_debug.h index ae5ee40..fb1ecc3 100644 --- a/xpp/zap_debug.h +++ b/xpp/zap_debug.h @@ -170,4 +170,21 @@ static inline char *sig2str(int sig) return "Unconfigured"; } +static inline char *alarmbit2str(int alarmbit) +{ + /* from zaptel.h */ + switch(1 << alarmbit) { + case ZT_ALARM_NONE: return "NONE"; + case ZT_ALARM_RECOVER: return "RECOVER"; + case ZT_ALARM_LOOPBACK: return "LOOPBACK"; + case ZT_ALARM_YELLOW: return "YELLOW"; + case ZT_ALARM_RED: return "RED"; + case ZT_ALARM_BLUE: return "BLUE"; + case ZT_ALARM_NOTOPEN: return "NOTOPEN"; + } + return "UNKNOWN"; +} + +void alarm2str(int alarm, char *buf, int buflen); + #endif /* ZAP_DEBUG_H */ |