diff --git a/libpri.h b/libpri.h index e4e7252..cd83a23 100755 --- a/libpri.h +++ b/libpri.h @@ -408,6 +408,9 @@ extern void pri_set_nsf(struct pri *pri, int nsf); /* Set debug parameters on PRI -- see above debug definitions */ extern void pri_set_debug(struct pri *pri, int debug); +/* Get debug parameters on PRI -- see above debug definitions */ +extern int pri_get_debug(struct pri *pri); + /* Run PRI on the given D-channel, taking care of any events that need to be handled. If block is set, it will block until an event occurs which needs to be handled */ diff --git a/pri.c b/pri.c index 6ce8f98..709e8c2 100755 --- a/pri.c +++ b/pri.c @@ -391,6 +391,15 @@ void pri_set_debug(struct pri *pri, int debug) pri_set_debug(pri->subchannel, debug); } +int pri_get_debug(struct pri *pri) +{ + if (!pri) + return -1; + if (pri->subchannel) + return pri_get_debug(pri->subchannel); + return pri->debug; +} + int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info) { if (!pri || !call)