From: Stefan Knoblich Date: Thu, 9 Feb 2012 11:56:02 +0000 (+0100) Subject: [ftmod_misdn] Fix a couple of ftdm_log() printf format errors X-Git-Tag: v1.2-rc1~19^2^2~68^2~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36b26c51aca57bf6497fe515971a9b98e8c9b109;p=thirdparty%2Ffreeswitch.git [ftmod_misdn] Fix a couple of ftdm_log() printf format errors Also adds a local ftdm_channel_get_type_str() helper. Signed-off-by: Stefan Knoblich --- diff --git a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c index 06caeef7ae..8d3bd8df28 100644 --- a/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c +++ b/libs/freetdm/src/ftmod/ftmod_misdn/ftmod_misdn.c @@ -211,6 +211,11 @@ struct misdn_chan_private { static ftdm_status_t misdn_handle_incoming(ftdm_channel_t *ftdmchan, const char *rbuf, const int size); static int misdn_handle_mph_information_ind(ftdm_channel_t *chan, const struct mISDNhead *hh, const void *data, const int data_len); +static const char *ftdm_channel_get_type_str(const ftdm_channel_t *chan) +{ + return ftdm_chan_type2str(ftdm_channel_get_type(chan)); +} + /*********************************************************************************** * mISDN interface functions ***********************************************************************************/ @@ -655,7 +660,7 @@ static int misdn_handle_mph_information_ind(ftdm_channel_t *chan, const struct m } bch_info = &info->bch[0]; - ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN port state:\n\tD-Chan state:\t%hu\n\tD-Chan flags:\t%#x\n\tD-Chan proto:\t%hu\n\tD-Chan active:\t%s\n", + ftdm_log_chan(chan, FTDM_LOG_DEBUG, "mISDN port state:\n\tD-Chan state:\t%hu\n\tD-Chan flags:\t%#lx\n\tD-Chan proto:\t%hu\n\tD-Chan active:\t%s\n", info->dch.state, info->dch.ch.Flags, info->dch.ch.protocol, info->dch.ch.Flags & (1 << 6) ? "yes" : "no"); /* TODO: try to translate this to a usable set of alarm flags */ @@ -792,7 +797,7 @@ static FIO_OPEN_FUNCTION(misdn_open) break; default: ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "mISDN invalid channel type '%s'\n", - ftdm_channel_get_type(ftdmchan)); + ftdm_channel_get_type_str(ftdmchan)); break; } return FTDM_SUCCESS;