FreeTDM: Fix format string errors in ftmod_analog, ftmod_wanpipe and ftmod_sangoma_isdn.
Signed-off-by: Stefan Knoblich <stkn@openisdn.net>
This commit is contained in:
parent
90d299cd7a
commit
ee2a5a33f3
|
@ -473,7 +473,7 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
|||
sig.span_id = ftdmchan->span_id;
|
||||
sig.channel = ftdmchan;
|
||||
|
||||
ftdm_assert(interval != 0, NULL);
|
||||
ftdm_assert(interval != 0, "Invalid interval");
|
||||
|
||||
if (!dial_timeout) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Not waiting for dial tone to dial number %s\n", ftdmchan->caller_data.dnis.digits);
|
||||
|
|
|
@ -452,17 +452,17 @@ static void *ftdm_sangoma_isdn_run(ftdm_thread_t *me, void *obj)
|
|||
|
||||
/* get an interrupt queue for this span */
|
||||
if (ftdm_queue_get_interrupt(span->pendingchans, &ftdm_sangoma_isdn_int[0]) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_CRIT, "%s:Failed to get a ftdm_interrupt for span = %s!\n", span->name);
|
||||
ftdm_log(FTDM_LOG_CRIT, "Failed to get a ftdm_interrupt for span = %s!\n", span->name);
|
||||
goto ftdm_sangoma_isdn_run_exit;
|
||||
}
|
||||
|
||||
if (ftdm_queue_get_interrupt(span->pendingsignals, &ftdm_sangoma_isdn_int[1]) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_CRIT, "%s:Failed to get a signal interrupt for span = %s!\n", span->name);
|
||||
ftdm_log(FTDM_LOG_CRIT, "Failed to get a signal interrupt for span = %s!\n", span->name);
|
||||
goto ftdm_sangoma_isdn_run_exit;
|
||||
}
|
||||
|
||||
if (ftdm_queue_get_interrupt(signal_data->event_queue, &ftdm_sangoma_isdn_int[2]) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_CRIT, "%s:Failed to get a event interrupt for span = %s!\n", span->name);
|
||||
ftdm_log(FTDM_LOG_CRIT, "Failed to get a event interrupt for span = %s!\n", span->name);
|
||||
goto ftdm_sangoma_isdn_run_exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ static ftdm_status_t parse_switchtype(const char* switch_name, ftdm_span_t *span
|
|||
/* can be > 1 for some BRI variants */
|
||||
break;
|
||||
default:
|
||||
ftdm_log(FTDM_LOG_ERROR, "%s:Unsupported trunktype:%s\n", span->name, switch_name, ftdm_trunk_type2str(span->trunk_type));
|
||||
ftdm_log(FTDM_LOG_ERROR, "%s:Unsupported trunktype:%s\n", span->name, ftdm_trunk_type2str(span->trunk_type));
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
/* see if we have profile with this switch_type already */
|
||||
|
|
|
@ -1181,7 +1181,7 @@ uint8_t sng_isdn_stack_switchtype(sngisdn_switchtype_t switchtype)
|
|||
case SNGISDN_SWITCH_INSNET:
|
||||
return SW_INSNET;
|
||||
case SNGISDN_SWITCH_INVALID:
|
||||
ftdm_log(FTDM_LOG_ERROR, "%s:Invalid switchtype:%d\n", switchtype);
|
||||
ftdm_log(FTDM_LOG_ERROR, "Invalid switchtype: %d\n", switchtype);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -234,7 +234,7 @@ ftdm_status_t sngisdn_activate_trace(ftdm_span_t *span, sngisdn_tracetype_t trac
|
|||
sngisdn_clear_trace_flag(signal_data, SNGISDN_TRACE_Q921);
|
||||
|
||||
if (sngisdn_cntrl_q921(span, ADISIMM, SATRC) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to disable q921 trace\n");
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to disable q921 trace\n", signal_data->link_id);
|
||||
}
|
||||
}
|
||||
if (sngisdn_test_trace_flag(signal_data, SNGISDN_TRACE_Q931)) {
|
||||
|
@ -242,7 +242,7 @@ ftdm_status_t sngisdn_activate_trace(ftdm_span_t *span, sngisdn_tracetype_t trac
|
|||
sngisdn_clear_trace_flag(signal_data, SNGISDN_TRACE_Q931);
|
||||
|
||||
if (sngisdn_cntrl_q931(span, ADISIMM, SATRC) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to disable q931 trace\n");
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to disable q931 trace\n", signal_data->link_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -252,7 +252,7 @@ ftdm_status_t sngisdn_activate_trace(ftdm_span_t *span, sngisdn_tracetype_t trac
|
|||
sngisdn_set_trace_flag(signal_data, SNGISDN_TRACE_Q921);
|
||||
|
||||
if (sngisdn_cntrl_q921(span, AENA, SATRC) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to enable q921 trace\n");
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to enable q921 trace\n", signal_data->link_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -262,7 +262,7 @@ ftdm_status_t sngisdn_activate_trace(ftdm_span_t *span, sngisdn_tracetype_t trac
|
|||
sngisdn_set_trace_flag(signal_data, SNGISDN_TRACE_Q931);
|
||||
|
||||
if (sngisdn_cntrl_q931(span, AENA, SATRC) != FTDM_SUCCESS) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to enable q931 trace\n");
|
||||
ftdm_log(FTDM_LOG_ERROR, "s%d Failed to enable q931 trace\n", signal_data->link_id);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -480,7 +480,7 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
|||
if (cnStEvnt->sndCmplt.eh.pres || num_digits >= min_digits) {
|
||||
ftdm_set_state(ftdmchan, FTDM_CHANNEL_STATE_RING);
|
||||
} else {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "received %d of %d digits\n", num_digits, min_digits);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "received %"FTDM_SIZE_FMT" of %"FTDM_SIZE_FMT" digits\n", num_digits, min_digits);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -496,7 +496,7 @@ void sngisdn_process_cnst_ind (sngisdn_event_data_t *sngisdn_event)
|
|||
ftdm_log_chan_msg(ftdmchan, FTDM_LOG_DEBUG, "Processing SETUP but channel in RESET state, ignoring\n");
|
||||
break;
|
||||
default:
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "\n", suId, suInstId, spInstId);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Unhandled INFO (suId:%u suInstId:%u spInstId:%u)\n", suId, suInstId, spInstId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -453,7 +453,7 @@ ftdm_status_t get_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad)
|
|||
}
|
||||
memset(subaddress, 0, sizeof(subaddress));
|
||||
if(cgPtySad->sadInfo.len >= sizeof(subaddress)) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Calling Party Subaddress exceeds local size limit (len:%d max:%d)\n", cgPtySad->sadInfo.len, sizeof(subaddress));
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_WARNING, "Calling Party Subaddress exceeds local size limit (len:%d max:%"FTDM_SIZE_FMT")\n", cgPtySad->sadInfo.len, sizeof(subaddress));
|
||||
cgPtySad->sadInfo.len = sizeof(subaddress)-1;
|
||||
}
|
||||
|
||||
|
@ -1190,7 +1190,7 @@ void sngisdn_restart_timeout(void *p_signal_data)
|
|||
ftdm_iterator_t *chaniter = NULL;
|
||||
ftdm_iterator_t *curr = NULL;
|
||||
|
||||
ftdm_log(FTDM_LOG_DEBUG, "s%d:Did not receive a RESTART from remote switch in %d ms - restarting\n", span->name, signal_data->restart_timeout);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "s%s:Did not receive a RESTART from remote switch in %d ms - restarting\n", span->name, signal_data->restart_timeout);
|
||||
|
||||
chaniter = ftdm_span_get_chan_iterator(span, NULL);
|
||||
for (curr = chaniter; curr; curr = ftdm_iterator_next(curr)) {
|
||||
|
|
|
@ -152,7 +152,7 @@ static ftdm_status_t att_courtesy_vru(ftdm_channel_t *ftdmchan, sngisdn_transfer
|
|||
goto done;
|
||||
}
|
||||
if (strlen(val) > COURTESY_TRANSFER_MAX_DATA_SIZE) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Data exceeds max size (len:%d max:%d), cannot perform transfer\n", strlen(val), COURTESY_TRANSFER_MAX_DATA_SIZE);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_ERROR, "Data exceeds max size (len:%"FTDM_SIZE_FMT" max:%d), cannot perform transfer\n", strlen(val), COURTESY_TRANSFER_MAX_DATA_SIZE);
|
||||
goto done;
|
||||
}
|
||||
memcpy(sngisdn_info->transfer_data.tdata.att_courtesy_vru.data, val, strlen(val));
|
||||
|
|
|
@ -910,7 +910,7 @@ static void wanpipe_write_stats(ftdm_channel_t *ftdmchan, wp_tdm_api_tx_hdr_t *t
|
|||
}
|
||||
|
||||
if (!ftdmchan->iostats.tx.packets) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "First packet write stats: Tx queue len: %d, Tx queue size: %d, Tx idle: %d\n",
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "First packet write stats: Tx queue len: %d, Tx queue size: %d, Tx idle: %"FTDM_UINT64_FMT"\n",
|
||||
ftdmchan->iostats.tx.queue_len,
|
||||
ftdmchan->iostats.tx.queue_size,
|
||||
ftdmchan->iostats.tx.idle_packets);
|
||||
|
@ -956,11 +956,11 @@ static void wanpipe_read_stats(ftdm_channel_t *ftdmchan, wp_tdm_api_rx_hdr_t *rx
|
|||
}
|
||||
|
||||
if (ftdmchan->iostats.rx.queue_len >= (0.8 * ftdmchan->iostats.rx.queue_size)) {
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Rx Queue length exceeded 80% threshold (%d/%d)\n",
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Rx Queue length exceeded 80%% threshold (%d/%d)\n",
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.rx.queue_size);
|
||||
ftdm_set_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_THRES);
|
||||
} else if (ftdm_test_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_THRES)){
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Rx Queue length reduced 80% threshold (%d/%d)\n",
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Rx Queue length reduced 80%% threshold (%d/%d)\n",
|
||||
ftdmchan->iostats.rx.queue_len, ftdmchan->iostats.rx.queue_size);
|
||||
ftdm_clear_flag(&(ftdmchan->iostats.rx), FTDM_IOSTATS_ERROR_QUEUE_THRES);
|
||||
}
|
||||
|
@ -1516,10 +1516,10 @@ static __inline__ ftdm_status_t wanpipe_channel_process_event(ftdm_channel_t *fc
|
|||
if (fchan->dtmfdetect.duration_ms) {
|
||||
ftdm_time_t diff = ftdm_current_time_in_ms() - fchan->dtmfdetect.start_time;
|
||||
if (diff > fchan->dtmfdetect.duration_ms) {
|
||||
ftdm_log_chan(fchan, FTDM_LOG_DEBUG, "Queuing wanpipe DTMF: %c (duration:%d min:%d)\n", tmp_dtmf[0], diff, fchan->dtmfdetect.duration_ms);
|
||||
ftdm_log_chan(fchan, FTDM_LOG_DEBUG, "Queuing wanpipe DTMF: %c (duration:%"FTDM_TIME_FMT" min:%d)\n", tmp_dtmf[0], diff, fchan->dtmfdetect.duration_ms);
|
||||
ftdm_channel_queue_dtmf(fchan, tmp_dtmf);
|
||||
} else {
|
||||
ftdm_log_chan(fchan, FTDM_LOG_DEBUG, "Ignoring wanpipe DTMF: %c (duration:%d min:%d)\n", tmp_dtmf[0], diff, fchan->dtmfdetect.duration_ms);
|
||||
ftdm_log_chan(fchan, FTDM_LOG_DEBUG, "Ignoring wanpipe DTMF: %c (duration:%"FTDM_TIME_FMT" min:%d)\n", tmp_dtmf[0], diff, fchan->dtmfdetect.duration_ms);
|
||||
}
|
||||
} else if (!fchan->dtmfdetect.trigger_on_start) {
|
||||
ftdm_log_chan(fchan, FTDM_LOG_DEBUG, "Queuing wanpipe DTMF: %c\n", tmp_dtmf[0]);
|
||||
|
@ -1617,7 +1617,7 @@ FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_span_next_event)
|
|||
ftdm_clear_flag_locked(span->channels[i], FTDM_CHANNEL_FLASH);
|
||||
ftdm_set_flag_locked(span->channels[i], FTDM_CHANNEL_OFFHOOK);
|
||||
event_id = FTDM_OOB_OFFHOOK;
|
||||
ftdm_log_chan(span->channels[i], FTDM_LOG_DEBUG, "Diff since last event = %llums, delivering %s now\n", diff, ftdm_oob_event2str(event_id));
|
||||
ftdm_log_chan(span->channels[i], FTDM_LOG_DEBUG, "Diff since last event = %"FTDM_TIME_FMT" ms, delivering %s now\n", diff, ftdm_oob_event2str(event_id));
|
||||
goto event;
|
||||
}
|
||||
}
|
||||
|
@ -1636,7 +1636,7 @@ FIO_SPAN_NEXT_EVENT_FUNCTION(wanpipe_span_next_event)
|
|||
|
||||
sangoma_tdm_txsig_onhook(ftdmchan->sockfd,&tdm_api);
|
||||
}
|
||||
ftdm_log_chan(span->channels[i], FTDM_LOG_DEBUG, "Diff since last event = %llums, delivering %s now\n", diff, ftdm_oob_event2str(event_id));
|
||||
ftdm_log_chan(span->channels[i], FTDM_LOG_DEBUG, "Diff since last event = %"FTDM_TIME_FMT" ms, delivering %s now\n", diff, ftdm_oob_event2str(event_id));
|
||||
goto event;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue