git-svn-id: http://svn.openzap.org/svn/openzap/trunk@365 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2008-01-12 06:11:48 +00:00
parent f60626ba88
commit 38c7ed615e
4 changed files with 20 additions and 10 deletions

View File

@ -578,7 +578,14 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
if (zap_channel_dequeue_dtmf(tech_pvt->zchan, dtmf, sizeof(dtmf))) {
switch_dtmf_t _dtmf = { 0, SWITCH_DEFAULT_DTMF_DURATION };
switch_channel_queue_dtmf(channel, &_dtmf);
char *p;
for (p = dtmf; p && *p; p++) {
if (is_dtmf(*p)) {
_dtmf.digit = *p;
zap_log(ZAP_LOG_DEBUG, "queue DTMF [%c]\n", *p);
switch_channel_queue_dtmf(channel, &_dtmf);
}
}
}
return SWITCH_STATUS_SUCCESS;
@ -1214,7 +1221,7 @@ static ZIO_SIGNAL_CB_FUNCTION(on_isdn_signal)
}
break;
case ZAP_SIGEVENT_STOP:
{
{
while((session = zap_channel_get_session(sigmsg->channel, 0))) {
channel = switch_core_session_get_channel(session);
switch_channel_hangup(channel, sigmsg->channel->caller_data.hangup_cause);

View File

@ -521,6 +521,7 @@ int zap_hash_equalkeys(void *k1, void *k2);
uint32_t zap_hash_hashfromstring(void *ky);
uint32_t zap_running(void);
ZIO_CODEC_FUNCTION(zio_slin2ulaw);
ZIO_CODEC_FUNCTION(zio_ulaw2slin);
ZIO_CODEC_FUNCTION(zio_slin2alaw);

View File

@ -38,7 +38,6 @@
struct tm * localtime_r(const time_t *clock, struct tm *result);
#endif
static void *zap_analog_channel_run(zap_thread_t *me, void *obj);
static ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(analog_fxo_outgoing_call)
@ -485,9 +484,10 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj)
}
}
if ((dlen = zap_channel_dequeue_dtmf(zchan, dtmf + dtmf_offset, sizeof(dtmf) - strlen(dtmf)))) {
if (zchan->state == ZAP_CHANNEL_STATE_DIALTONE || zchan->state == ZAP_CHANNEL_STATE_COLLECT) {
zap_log(ZAP_LOG_DEBUG, "DTMF %s\n", dtmf + dtmf_offset);
if (zchan->state == ZAP_CHANNEL_STATE_DIALTONE || zchan->state == ZAP_CHANNEL_STATE_COLLECT) {
if ((dlen = zap_channel_dequeue_dtmf(zchan, dtmf + dtmf_offset, sizeof(dtmf) - strlen(dtmf)))) {
if (zchan->state == ZAP_CHANNEL_STATE_DIALTONE) {
zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_COLLECT);
collecting = 1;
@ -786,7 +786,6 @@ static void *zap_analog_run(zap_thread_t *me, void *obj)
}
zap_status_t zap_analog_start(zap_span_t *span)
{
zap_analog_data_t *analog_data = span->signal_data;

View File

@ -1412,7 +1412,11 @@ zap_size_t zap_channel_dequeue_dtmf(zap_channel_t *zchan, char *dtmf, zap_size_t
assert(zchan != NULL);
if (zap_buffer_inuse(zchan->digit_buffer)) {
if (!zap_test_flag(zchan, ZAP_CHANNEL_READY)) {
return ZAP_FAIL;
}
if (zchan->digit_buffer && zap_buffer_inuse(zchan->digit_buffer)) {
zap_mutex_lock(zchan->mutex);
if ((bytes = zap_buffer_read(zchan->digit_buffer, dtmf, len)) > 0) {
*(dtmf + bytes) = '\0';
@ -1608,7 +1612,6 @@ zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *data
}
if (zap_test_flag(zchan, ZAP_CHANNEL_DTMF_DETECT)) {
teletone_dtmf_detect(&zchan->dtmf_detect, sln, (int)slen);
teletone_dtmf_get(&zchan->dtmf_detect, digit_str, sizeof(digit_str));
@ -1987,7 +1990,7 @@ zap_status_t zap_global_destroy(void)
zap_span_close_all();
globals.running = 0;
zap_sleep(200);
zap_sleep(1000);
for(i = 1; i <= globals.span_index; i++) {
zap_span_t *cur_span = &globals.spans[i];