]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: ftmod_analog_em: If the destination number DTMF was already generated, do...
authorMoises Silva <moy@sangoma.com>
Thu, 20 Dec 2012 17:11:11 +0000 (12:11 -0500)
committerMoises Silva <moy@sangoma.com>
Thu, 20 Dec 2012 17:18:24 +0000 (12:18 -0500)
         This bug was cause when answer-supervision is used because now we do not move from DIALING to UP
         as soon as the line is ringing, but instead we wait for the CAS bit change

libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c

index c073c5364e3e016b9fc5f6aa4ba7380fd800b863..108eda923ea3ca3f8c85c3addcbbde42683f6e28 100644 (file)
@@ -239,6 +239,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
        int cas_bits = 0;
        uint32_t cas_answer = 0;
        int cas_answer_ms = 500;
+       ftdm_bool_t digits_sent = FTDM_FALSE;
        
        ftdm_log(FTDM_LOG_DEBUG, "ANALOG EM CHANNEL thread starting.\n");
 
@@ -291,7 +292,8 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
                        case FTDM_CHANNEL_STATE_DIALING:
                                {
                                        if (! ftdmchan->needed_tones[FTDM_TONEMAP_RING]
-                                               && ftdm_test_flag(ftdmchan, FTDM_CHANNEL_WINK)) {
+                                               && ftdm_test_flag(ftdmchan, FTDM_CHANNEL_WINK)
+                                               && !digits_sent) {
                                                if (ftdm_strlen_zero(ftdmchan->caller_data.dnis.digits)) {
                                                        ftdm_log(FTDM_LOG_ERROR, "No Digits to send!\n");
                                                        ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
@@ -301,6 +303,7 @@ static void *ftdm_analog_em_channel_run(ftdm_thread_t *me, void *obj)
                                                                ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_BUSY);
                                                        } else {
                                                                state_counter = 0;
+                                                               digits_sent = FTDM_TRUE;
                                                                ftdmchan->needed_tones[FTDM_TONEMAP_RING] = 1;
                                                                ftdmchan->needed_tones[FTDM_TONEMAP_BUSY] = 1;
                                                                ftdmchan->needed_tones[FTDM_TONEMAP_FAIL1] = 1;