提交 b88cd345 authored 作者: Jeff Lenk's avatar Jeff Lenk

FS-3000 mod_conference: if more digits than the length of the correct pin the…

FS-3000 mod_conference: if more digits than the length of the correct pin the remaining digits are accounted for next retry
上级 9adac7c6
...@@ -5597,6 +5597,7 @@ SWITCH_STANDARD_APP(conference_function) ...@@ -5597,6 +5597,7 @@ SWITCH_STANDARD_APP(conference_function)
char pin_buf[80] = ""; char pin_buf[80] = "";
int pin_retries = 3; /* XXX - this should be configurable - i'm too lazy to do it right now... */ int pin_retries = 3; /* XXX - this should be configurable - i'm too lazy to do it right now... */
int pin_valid = 0; int pin_valid = 0;
int be_friendly = 0;
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
char *supplied_pin_value; char *supplied_pin_value;
...@@ -5631,20 +5632,24 @@ SWITCH_STANDARD_APP(conference_function) ...@@ -5631,20 +5632,24 @@ SWITCH_STANDARD_APP(conference_function)
switch_status_t pstatus = SWITCH_STATUS_FALSE; switch_status_t pstatus = SWITCH_STATUS_FALSE;
/* be friendly */ /* be friendly */
if (conference->pin_sound) { if (!be_friendly) {
pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf)); if (conference->pin_sound) {
} else if (conference->tts_engine && conference->tts_voice) { pstatus = conference_local_play_file(conference, session, conference->pin_sound, 20, pin_buf, sizeof(pin_buf));
pstatus = } else if (conference->tts_engine && conference->tts_voice) {
switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL); pstatus =
} else { switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, "please enter the conference pin number", NULL);
pstatus = switch_ivr_speak_text(session, "flite", "slt", "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) { 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_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); switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
} }
be_friendly = 1;
/* wait for them if neccessary */ /* wait for them if neccessary */
if (strlen(pin_buf) < strlen(dpin)) { if (strlen(pin_buf) < strlen(dpin)) {
char *buf = pin_buf + strlen(pin_buf); char *buf = pin_buf + strlen(pin_buf);
...@@ -5660,13 +5665,12 @@ SWITCH_STANDARD_APP(conference_function) ...@@ -5660,13 +5665,12 @@ SWITCH_STANDARD_APP(conference_function)
pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, dpin) == 0); pin_valid = (status == SWITCH_STATUS_SUCCESS && strcmp(pin_buf, dpin) == 0);
if (!pin_valid) { if (!pin_valid) {
/* zero the collected pin */
memset(pin_buf, 0, sizeof(pin_buf));
/* more friendliness */ /* more friendliness */
if (conference->bad_pin_sound) { 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, pin_buf, sizeof(pin_buf));
} }
/* zero the collected pin */
memset(pin_buf, 0, sizeof(pin_buf));
} }
pin_retries--; pin_retries--;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论