return -1;
}
- at_result = gsmopen_serial_read_AT(tech_pvt, 1, 100000, seconds, expected_string, expect_crlf); // minimum 1/10th sec timeout
+ at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // minimum half a sec timeout
UNLOCKA(tech_pvt->controldev_lock);
POPPA_UNLOCKA(tech_pvt->controldev_lock);
int gsmopen_call(private_t *tech_pvt, char *rdest, int timeout)
{
+ int result;
+
//gsmopen_sleep(5000);
DEBUGA_GSMOPEN("Calling GSM, rdest is: %s\n", GSMOPEN_P_LOG, rdest);
//gsmopen_signaling_write(tech_pvt, "SET AGC OFF");
//gsmopen_signaling_write(tech_pvt, "SET AEC OFF");
//gsmopen_sleep(10000);
- gsmopen_serial_call(tech_pvt, rdest);
+ result=gsmopen_serial_call(tech_pvt, rdest);
//ERRORA("failed to communicate with GSM client, now exit\n", GSMOPEN_P_LOG);
//return -1;
//}
- return 0;
+ return result;
}
int gsmopen_senddigit(private_t *tech_pvt, char digit)
switch_call_cause_t *cancel_cause)
{
private_t *tech_pvt = NULL;
+ int result;
+
if ((*new_session = switch_core_session_request(gsmopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, flags, pool)) != 0) {
switch_channel_t *channel = NULL;
switch_caller_profile_t *caller_profile;
switch_set_flag(tech_pvt, TFLAG_OUTBOUND);
switch_mutex_unlock(tech_pvt->flag_mutex);
switch_channel_set_state(channel, CS_INIT);
- gsmopen_call(tech_pvt, rdest, 30);
+ result=gsmopen_call(tech_pvt, rdest, 30);
switch_mutex_unlock(globals.mutex);
+ if(result != 0){
+ return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
+ }
return SWITCH_CAUSE_SUCCESS;
}