static int spandsp_v21_new(struct spandsp_pvt *p);
static void session_destroy(struct spandsp_pvt *p);
static int t38_tx_packet_handler(t38_core_state_t *t38_core_state, void *data, const uint8_t *buf, int len, int count);
-static void t30_phase_e_handler(t30_state_t *t30_state, void *data, int completion_code);
-static void spandsp_log(int level, const char *msg);
static int update_stats(struct spandsp_pvt *p, int completion_code);
static int spandsp_modems(struct ast_fax_session_details *details);
+#if SPANDSP_RELEASE_DATE >= 20120902
+/* for spandsp shaphots 3.0.0 and higher */
+static void t30_phase_e_handler(void *data, int completion_code);
+static void spandsp_log(void *user_data, int level, const char *msg);
+#else
+/* for spandsp release 0.0.6 */
+static void t30_phase_e_handler(t30_state_t *t30_state, void *data, int completion_code);
+static void spandsp_log(int level, const char *msg);
+#endif
static void set_logging(logging_state_t *state, struct ast_fax_session_details *details);
static void set_local_info(t30_state_t *t30_state, struct ast_fax_session_details *details);
* This function pulls stats from the spandsp stack and stores them for res_fax
* to use later.
*/
+#if SPANDSP_RELEASE_DATE >= 20120902
+/* for spandsp shaphots 3.0.0 and higher */
+static void t30_phase_e_handler(void *data, int completion_code)
+#else
+/* for spandsp release 0.0.6 */
static void t30_phase_e_handler(t30_state_t *t30_state, void *data, int completion_code)
+#endif
{
struct ast_fax_session *s = data;
struct spandsp_pvt *p = s->tech_pvt;
char headerinfo[T30_MAX_PAGE_HEADER_INFO + 1];
const char *c;
t30_stats_t stats;
+#if SPANDSP_RELEASE_DATE >= 20120902
+ /* for spandsp shaphots 3.0.0 and higher */
+ t30_state_t *t30_state = p->t30_state;
+#endif
ast_debug(5, "FAX session '%u' entering phase E\n", s->id);
*
* \note This function is a callback function called by spandsp.
*/
+#if SPANDSP_RELEASE_DATE >= 20120902
+/* for spandsp shaphots 3.0.0 and higher */
+static void spandsp_log(void *user_data, int level, const char *msg)
+#else
+/* for spandsp release 0.0.6 */
static void spandsp_log(int level, const char *msg)
+#endif
{
if (level == SPAN_LOG_ERROR) {
ast_log(LOG_ERROR, "%s", msg);
level = SPAN_LOG_DEBUG_3;
}
+#if SPANDSP_RELEASE_DATE >= 20120902
+ /* for spandsp shaphots 3.0.0 and higher */
+ span_log_set_message_handler(state, spandsp_log, NULL);
+#else
+ /* for spandsp release 0.0.6 */
span_log_set_message_handler(state, spandsp_log);
+#endif
span_log_set_level(state, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | level);
}
static void set_ecm(t30_state_t *t30_state, struct ast_fax_session_details *details)
{
t30_set_ecm_capability(t30_state, details->option.ecm);
+#if SPANDSP_RELEASE_DATE >= 20120902
+ /* for spandsp shaphots 3.0.0 and higher */
+ t30_set_supported_compressions(t30_state, T4_COMPRESSION_T4_1D | T4_COMPRESSION_T4_2D | T4_COMPRESSION_T6);
+#else
+ /* for spandsp release 0.0.6 */
t30_set_supported_compressions(t30_state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION);
+#endif
}
static int spandsp_v21_new(struct spandsp_pvt *p)
}
/* prevent logging to stderr */
+#if SPANDSP_RELEASE_DATE >= 20120902
+ /* for spandsp shaphots 3.0.0 and higher */
+ span_set_message_handler(NULL, NULL);
+#else
+ /* for spandsp release 0.0.6 */
span_set_message_handler(NULL);
+#endif
return AST_MODULE_LOAD_SUCCESS;
}