]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3000 revert previous - flush digits after pin error
authorJeff Lenk <jeff@jefflenk.com>
Mon, 24 Jan 2011 20:48:44 +0000 (14:48 -0600)
committerJeff Lenk <jeff@jefflenk.com>
Mon, 24 Jan 2011 20:49:42 +0000 (14:49 -0600)
src/mod/applications/mod_conference/mod_conference.c

index e6a47bf1ece70e36cbb22c31fc8ca55047531551..472f2d986c4c780becb583b389aa2390b1a2bc05 100644 (file)
@@ -5597,7 +5597,6 @@ SWITCH_STANDARD_APP(conference_function)
                        char pin_buf[80] = "";
                        int pin_retries = 3;    /* XXX - this should be configurable - i'm too lazy to do it right now... */
                        int pin_valid = 0;
-                       int be_friendly = 0;
                        switch_status_t status = SWITCH_STATUS_SUCCESS;
                        char *supplied_pin_value;
 
@@ -5632,23 +5631,19 @@ SWITCH_STANDARD_APP(conference_function)
                                switch_status_t pstatus = SWITCH_STATUS_FALSE;
 
                                /* be friendly */
-                               if (!be_friendly) {
-                                       if (conference->pin_sound) {
-                                               pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));
-                                       } else if (conference->tts_engine && conference->tts_voice) {
-                                               pstatus =
-                                                       switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);
-                                       } else {
-                                               pstatus = switch_ivr_speak_text(session, "flite", "slt", "please enter the conference pin number", NULL);
-                                       }
-
-                                       if (pstatus != SWITCH_STATUS_SUCCESS && pstatus != SWITCH_STATUS_BREAK) {
-                                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot ask the user for a pin, ending call");
-                                               switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
-                                       }
+                               if (conference->pin_sound) {
+                                       pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));
+                               } else if (conference->tts_engine && conference->tts_voice) {
+                                       pstatus =
+                                               switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);
+                               } else {
+                                       pstatus = switch_ivr_speak_text(session, "flite", "slt", "please enter the conference pin number", NULL);
                                }
 
-                               be_friendly = 1;
+                               if (pstatus != SWITCH_STATUS_SUCCESS && pstatus != SWITCH_STATUS_BREAK) {
+                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot ask the user for a pin, ending call");
+                                       switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
+                               }
 
                                /* wait for them if neccessary */
                                if (strlen(pin_buf) < strlen(dpin)) {
@@ -5665,12 +5660,14 @@ SWITCH_STANDARD_APP(conference_function)
 
                                pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, dpin) == 0);
                                if (!pin_valid) {
+                                       /* zero the collected pin */
+                                       memset(pin_buf, 0, sizeof(pin_buf));
+
                                        /* more friendliness */
                                        if (conference->bad_pin_sound) {
-                                               conference_local_play_file(conference, session, conference->bad_pin_sound, 20, pin_buf, sizeof(pin_buf));
+                                               conference_local_play_file(conference, session, conference->bad_pin_sound, 20, NULL, 0);
                                        }
-                                       /* zero the collected pin */
-                                       memset(pin_buf, 0, sizeof(pin_buf));
+                                       switch_channel_flush_dtmf(channel);
                                }
                                pin_retries--;
                        }