switch_t38_options_t *t38_options = switch_channel_get_private(channel, "t38_options");
int method = 2;
- if (!t38_options) {
+ if (!t38_options || !pvt || !pvt->t38_core) {
pvt->t38_mode = T38_MODE_REFUSED;
return pvt->t38_mode;
}
}
if (pvt->t38_mode == T38_MODE_REQUESTED) {
+ spanfax_init(pvt, T38_GATEWAY_MODE);
configure_t38(pvt);
pvt->t38_mode = T38_MODE_NEGOTIATED;
} else {
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
goto end_unlock;
}
- }
- spanfax_init(pvt, T38_GATEWAY_MODE);
+ spanfax_init(pvt, T38_GATEWAY_MODE);
+ }
/* This will change the rtp stack to udptl mode */
msg.from = __FILE__;