From: Stefan Knoblich Date: Thu, 11 Nov 2010 21:17:09 +0000 (+0100) Subject: ftmod_libpri: Dereference facility event correctly, add debug message. X-Git-Tag: v1.2-rc1~265^2~11^2~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0961aee3a46001633c51053f6fca71317d2265b;p=thirdparty%2Ffreeswitch.git ftmod_libpri: Dereference facility event correctly, add debug message. Signed-off-by: Stefan Knoblich --- diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c index 787e995ecc..69e007d7bb 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c @@ -1187,12 +1187,14 @@ static int handle_facility_aoc_e(const struct pri_subcmd_aoc_e *aoc_e) */ static int on_facility(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event *pevent) { - struct pri_event_facility *pfac = (struct pri_event_facility *)pevent; + struct pri_event_facility *pfac = (struct pri_event_facility *)&pevent->facility; int i = 0; if (!pevent) return 0; + ftdm_log(FTDM_LOG_DEBUG, "Got a FACILITY event on span %d:%d\n", ftdm_span_get_id(spri->span), pfac->channel); + if (!pfac->subcmds || pfac->subcmds->counter_subcmd <= 0) return 0;