Merge branch 'master' of git.freeswitch.org:freeswitch
This commit is contained in:
commit
f8d8a395cc
|
@ -281,6 +281,7 @@ static dm_match_t switch_ivr_dmachine_check_match(switch_ivr_dmachine_t *dmachin
|
||||||
if (!exact_bp && !strcmp(bp->digits, dmachine->digits)) {
|
if (!exact_bp && !strcmp(bp->digits, dmachine->digits)) {
|
||||||
best = DM_MATCH_EXACT;
|
best = DM_MATCH_EXACT;
|
||||||
exact_bp = bp;
|
exact_bp = bp;
|
||||||
|
if (dmachine->cur_digit_len == dmachine->max_digit_len) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(both_bp && partial_bp) && !strncmp(dmachine->digits, bp->digits, strlen(dmachine->digits))) {
|
if (!(both_bp && partial_bp) && !strncmp(dmachine->digits, bp->digits, strlen(dmachine->digits))) {
|
||||||
|
@ -382,7 +383,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
||||||
|
|
||||||
if (dmachine->last_matching_binding->callback) {
|
if (dmachine->last_matching_binding->callback) {
|
||||||
s = dmachine->last_matching_binding->callback(&dmachine->match);
|
s = dmachine->last_matching_binding->callback(&dmachine->match);
|
||||||
|
|
||||||
switch(s) {
|
switch(s) {
|
||||||
case SWITCH_STATUS_CONTINUE:
|
case SWITCH_STATUS_CONTINUE:
|
||||||
r = SWITCH_STATUS_SUCCESS;
|
r = SWITCH_STATUS_SUCCESS;
|
||||||
|
@ -390,7 +391,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
||||||
case SWITCH_STATUS_SUCCESS:
|
case SWITCH_STATUS_SUCCESS:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
r = SWITCH_STATUS_NOTFOUND;
|
r = SWITCH_STATUS_BREAK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,7 +407,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
||||||
case SWITCH_STATUS_SUCCESS:
|
case SWITCH_STATUS_SUCCESS:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
r = SWITCH_STATUS_NOTFOUND;
|
r = SWITCH_STATUS_BREAK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,7 +422,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
||||||
r = SWITCH_STATUS_SUCCESS;
|
r = SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r != SWITCH_STATUS_FOUND && r != SWITCH_STATUS_SUCCESS) {
|
if (r != SWITCH_STATUS_FOUND && r != SWITCH_STATUS_SUCCESS && r != SWITCH_STATUS_BREAK) {
|
||||||
switch_set_string(dmachine->last_failed_digits, dmachine->digits);
|
switch_set_string(dmachine->last_failed_digits, dmachine->digits);
|
||||||
dmachine->match.match_digits = dmachine->last_failed_digits;
|
dmachine->match.match_digits = dmachine->last_failed_digits;
|
||||||
|
|
||||||
|
@ -438,7 +439,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_dmachine_ping(switch_ivr_dmachine_t *
|
||||||
case SWITCH_STATUS_SUCCESS:
|
case SWITCH_STATUS_SUCCESS:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
r = SWITCH_STATUS_NOTFOUND;
|
r = SWITCH_STATUS_BREAK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1130,6 +1130,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||||
uint32_t pos = 0;
|
uint32_t pos = 0;
|
||||||
switch_core_file_seek(fh, &pos, 0, SEEK_SET);
|
switch_core_file_seek(fh, &pos, 0, SEEK_SET);
|
||||||
switch_core_file_seek(fh, &pos, sample_start, SEEK_CUR);
|
switch_core_file_seek(fh, &pos, sample_start, SEEK_CUR);
|
||||||
|
switch_clear_flag(fh, SWITCH_FILE_SEEK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_TITLE, &p) == SWITCH_STATUS_SUCCESS) {
|
if (switch_core_file_get_string(fh, SWITCH_AUDIO_COL_STR_TITLE, &p) == SWITCH_STATUS_SUCCESS) {
|
||||||
|
@ -1319,6 +1320,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fh->offset_pos += asis ? bread : bread / 2;
|
||||||
|
|
||||||
if (bread < framelen) {
|
if (bread < framelen) {
|
||||||
memset(abuf + bread, 255, framelen - bread);
|
memset(abuf + bread, 255, framelen - bread);
|
||||||
}
|
}
|
||||||
|
@ -1338,9 +1341,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
switch_buffer_write(fh->audio_buffer, abuf, asis ? olen : olen * 2);
|
switch_buffer_write(fh->audio_buffer, abuf, asis ? olen : olen * 2);
|
||||||
olen = switch_buffer_read(fh->audio_buffer, abuf, framelen);
|
olen = switch_buffer_read(fh->audio_buffer, abuf, framelen);
|
||||||
|
fh->offset_pos += olen / 2;
|
||||||
|
|
||||||
if (!asis) {
|
if (!asis) {
|
||||||
olen /= 2;
|
olen /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (done || olen <= 0) {
|
if (done || olen <= 0) {
|
||||||
|
@ -1455,7 +1461,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||||
}
|
}
|
||||||
|
|
||||||
more_data = 0;
|
more_data = 0;
|
||||||
|
|
||||||
write_frame.samples = (uint32_t) olen;
|
write_frame.samples = (uint32_t) olen;
|
||||||
|
|
||||||
if (asis) {
|
if (asis) {
|
||||||
|
@ -1480,7 +1485,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
|
||||||
switch_change_sln_volume(write_frame.data, write_frame.datalen / 2, fh->vol);
|
switch_change_sln_volume(write_frame.data, write_frame.datalen / 2, fh->vol);
|
||||||
}
|
}
|
||||||
|
|
||||||
fh->offset_pos += write_frame.samples / 2;
|
|
||||||
status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
|
status = switch_core_session_write_frame(session, &write_frame, SWITCH_IO_FLAG_NONE, 0);
|
||||||
|
|
||||||
if (timeout_samples) {
|
if (timeout_samples) {
|
||||||
|
|
Loading…
Reference in New Issue