Fix the pin number used in the dial string and switch session:execute for api:execute. Thanks soapee01 for reporting and helping with the bug.

This commit is contained in:
Mark Crane 2013-10-29 23:15:20 +00:00
parent 05ce025546
commit af8d5523cd
1 changed files with 6 additions and 12 deletions

View File

@ -74,19 +74,13 @@ if ( session:ready() ) then
--authenticate the user --authenticate the user
if (pin_number) then if (pin_number) then
--get the pin number from the caller min_digits = string.len(pin_number);
min_digits = string.len(pin_number); max_digits = string.len(pin_number)+1;
max_digits = string.len(pin_number)+1;
caller_pin_number = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", "phrase:voicemail_enter_pass:#", "", "\\d+");
else else
--get the vm_password min_digits = 1;
min_digits = 1; max_digits = 12;
max_digits = 12;
vm_password = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", "phrase:voicemail_enter_pass:#", "", "\\d+");
if (debug["sql"]) then
freeswitch.consoleLog("NOTICE", "unique_id ".. unique_id .. " vm_password " .. vm_password .. "\n");
end
end end
caller_pin_number = session:playAndGetDigits(min_digits, max_digits, max_tries, digit_timeout, "#", "phrase:voicemail_enter_pass:#", "", "\\d+");
--get the dial_string, and extension_uuid --get the dial_string, and extension_uuid
sql = "SELECT * FROM v_extensions as e, v_domains as d "; sql = "SELECT * FROM v_extensions as e, v_domains as d ";
@ -197,7 +191,7 @@ if ( session:ready() ) then
end end
end end
--clear the cache --clear the cache
session:execute("memcache", "delete directory:"..db_extension.."@"..context); api:execute("memcache", "delete directory:"..db_extension.."@"..context);
else else
session:streamFile("phrase:voicemail_fail_auth:#"); session:streamFile("phrase:voicemail_fail_auth:#");
session:hangup("NORMAL_CLEARING"); session:hangup("NORMAL_CLEARING");