need to probe around inside the modem.
SPAN_DECLARE(void) t31_call_event(t31_state_t *s, int event);
+/*! Return the amount of free space in the AT COMMAND BUFFER.
+ \brief Return the amount of free space in the AT COMMAND BUFFER.
+ \param s The T.31 modem context.
+ \return The number of bytes of free space. */
+SPAN_DECLARE(int) t31_at_rx_free_space(t31_state_t *s);
+
SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len);
/*! Process a block of received T.31 modem audio samples.
/* The date and time of the version are in UTC form. */
-#define SPANDSP_RELEASE_DATE 20100724
+#define SPANDSP_RELEASE_DATE 20120902
#define SPANDSP_RELEASE_TIME 163333
-#define SPANDSP_RELEASE_DATETIME_STRING "20100724 163333"
+#define SPANDSP_RELEASE_DATETIME_STRING "20120902 163333"
#endif
/*- End of file ------------------------------------------------------------*/
}
/*- End of function --------------------------------------------------------*/
+SPAN_DECLARE(int) t31_at_rx_free_space(t31_state_t *s)
+{
+ return T31_TX_BUF_LEN - (s->tx.in_bytes - s->tx.out_bytes) - 1;
+}
+/*- End of function --------------------------------------------------------*/
+
SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len)
{
if (s->dte_data_timeout)
if (s->tx.out_bytes)
{
/* Make room for new data in existing data buffer. */
- s->tx.in_bytes = &s->tx.data[s->tx.in_bytes] - &s->tx.data[s->tx.out_bytes];
+ s->tx.in_bytes -= s->tx.out_bytes;
memmove(&s->tx.data[0], &s->tx.data[s->tx.out_bytes], s->tx.in_bytes);
s->tx.out_bytes = 0;
}
modem->last_event = switch_time_now();
}
- avail = sizeof(buf) - modem->t31_state->tx.in_bytes + modem->t31_state->tx.out_bytes - 1;
+ avail = t31_at_rx_free_space(modem->t31_state);
if (avail == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Buffer Full, retrying....\n");