mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 23:24:18 +00:00
Merge remote branch 'fsorig/master'
Conflicts: libs/freetdm/src/testsangomaboost.c
This commit is contained in:
commit
1ee94f343a
15 files changed
+367
-39
No files matched your search
@@ -491,9 +491,10 @@ static void *ftdm_analog_channel_run(ftdm_thread_t *me, void *obj)
|
||||
ftdm_channel_command(ftdmchan, FTDM_COMMAND_GENERATE_RING_OFF, NULL);
|
||||
}
|
||||
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) &&
|
||||
if (ftdmchan->type == FTDM_CHAN_TYPE_FXS &&
|
||||
ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) &&
|
||||
(ftdmchan->last_state == FTDM_CHANNEL_STATE_RINGING || ftdmchan->last_state == FTDM_CHANNEL_STATE_DIALTONE
|
||||
|| ftdmchan->last_state >= FTDM_CHANNEL_STATE_RING)) {
|
||||
|| ftdmchan->last_state == FTDM_CHANNEL_STATE_RING)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
ftdmchan->caller_data.hangup_cause = FTDM_CAUSE_NORMAL_CLEARING;
|
||||
|
||||
@@ -329,8 +329,8 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
|
||||
{
|
||||
if (state_counter > 500) {
|
||||
if (ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OFFHOOK) &&
|
||||
(ftdmchan->last_state == FTDM_CHANNEL_STATE_RING || ftdmchan->last_state == FTDM_CHANNEL_STATE_DIALTONE
|
||||
|| ftdmchan->last_state >= FTDM_CHANNEL_STATE_IDLE)) {
|
||||
(ftdmchan->last_state == FTDM_CHANNEL_STATE_RINGING || ftdmchan->last_state == FTDM_CHANNEL_STATE_DIALTONE
|
||||
|| ftdmchan->last_state == FTDM_CHANNEL_STATE_RING)) {
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
|
||||
} else {
|
||||
ftdmchan->caller_data.hangup_cause = FTDM_CAUSE_NORMAL_CLEARING;
|
||||
@@ -340,7 +340,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_UP:
|
||||
case FTDM_CHANNEL_STATE_IDLE:
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
{
|
||||
ftdm_sleep(interval);
|
||||
continue;
|
||||
@@ -386,7 +386,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
|
||||
ftdm_channel_use(ftdmchan);
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_IDLE:
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
{
|
||||
ftdm_channel_use(ftdmchan);
|
||||
|
||||
@@ -421,7 +421,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
|
||||
ftdm_channel_command(ftdmchan, FTDM_COMMAND_WINK, NULL);
|
||||
}
|
||||
break;
|
||||
case FTDM_CHANNEL_STATE_RING:
|
||||
case FTDM_CHANNEL_STATE_RINGING:
|
||||
{
|
||||
ftdm_buffer_zero(dt_buffer);
|
||||
teletone_run(&ts, ftdmchan->span->tone_map[FTDM_TONEMAP_RING]);
|
||||
@@ -477,7 +477,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
|
||||
|
||||
if (last_digit && (!collecting || ((elapsed - last_digit > analog_data->digit_timeout) || strlen(dtmf) > analog_data->max_dialstr))) {
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Number obtained [%s]\n", dtmf);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_IDLE);
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_RING);
|
||||
last_digit = 0;
|
||||
collecting = 0;
|
||||
}
|
||||
|
||||
@@ -134,17 +134,18 @@ static int __pri_lpwrap_read(struct pri *pri, void *buf, int buflen)
|
||||
spri->errs = 0;
|
||||
res = (int)len;
|
||||
|
||||
memset(&((unsigned char*)buf)[res], 0, 2);
|
||||
res += 2;
|
||||
|
||||
if (res > 0) {
|
||||
memset(&((unsigned char*)buf)[res], 0, 2);
|
||||
res += 2;
|
||||
#ifdef IODEBUG
|
||||
{
|
||||
char bb[2048] = { 0 };
|
||||
{
|
||||
char bb[2048] = { 0 };
|
||||
|
||||
print_hex_bytes(buf, res - 2, bb, sizeof(bb));
|
||||
ftdm_log(FTDM_LOG_DEBUG, "READ %d\n", res - 2);
|
||||
}
|
||||
print_hex_bytes(buf, res - 2, bb, sizeof(bb));
|
||||
ftdm_log(FTDM_LOG_DEBUG, "READ %d\n", res - 2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -1976,7 +1976,7 @@ static int ftmod_ss7_fill_in_self_route(int spc, int linkType, int switchType, i
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[0].name, "self-route");
|
||||
strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[0].name, "self-rt");
|
||||
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].id = 0;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].dpc = spc;
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
#include "private/ftdm_core.h"
|
||||
#include "ftmod_zt.h"
|
||||
|
||||
/* used by dahdi to indicate there is no data available, but events to read */
|
||||
#ifndef ELAST
|
||||
#define ELAST 500
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Zaptel globals
|
||||
*/
|
||||
@@ -1081,7 +1086,6 @@ FIO_SPAN_NEXT_EVENT_FUNCTION(zt_next_event)
|
||||
}
|
||||
|
||||
return FTDM_FAIL;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1100,12 +1104,19 @@ static FIO_READ_FUNCTION(zt_read)
|
||||
if ((r = read(ftdmchan->sockfd, data, *datalen)) > 0) {
|
||||
break;
|
||||
}
|
||||
ftdm_sleep(10);
|
||||
if (r == 0) {
|
||||
errs--;
|
||||
else if (r == 0) {
|
||||
ftdm_sleep(10);
|
||||
if (errs) errs--;
|
||||
}
|
||||
else {
|
||||
if (errno == EAGAIN || errno == EINTR)
|
||||
continue;
|
||||
if (errno == ELAST)
|
||||
break;
|
||||
|
||||
ftdm_log(FTDM_LOG_ERROR, "read failed: %s\n", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
if (r > 0) {
|
||||
*datalen = r;
|
||||
if (ftdmchan->type == FTDM_CHAN_TYPE_DQ921) {
|
||||
@@ -1113,7 +1124,9 @@ static FIO_READ_FUNCTION(zt_read)
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
else if (errno == ELAST) {
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
return r == 0 ? FTDM_TIMEOUT : FTDM_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user