Authenticate Script
- main:
- #
Authenticate with retries
- $retry
= 3
- @phone::clearDtmf()
- while(
$retry > 0 )
- if
(exists($userId))
- $id
= $userId
- else
- @phone::play("phrase",
"call-in userid")
- $id
= @phone::getDigits(10)
- endif
- @phone::play("phrase",
"enter password")
- $pwd
= @phone::getDigits(10)
- $idLength
= $id::length()
- $pwdLength
= $pwd::length()
- if
(( $idLength > 0) && ($pwdLength > 0))
- @session
= @interaction::authenticatePhoneLogin($id, $pwd)
- $authenticated
= @session::isAuthenticated()
- endif
- if
( $authenticated )
- $retry
= 0
- if
(! exists($userId))
- $userId
= $id
- endif
- else
- $retry
= $retry - 1
- @phone::clearDtmf()
- @phone::play("phrase",
"bad password")
- endif
- endwhile
- if
(! $authenticated)
- @phone::clearDtmf()
- @phone::play("phrase",
"exhaust login")
- endif
- return
Annotation:
3. Sets
the number of times a User can try to authenticate.
5. Establishes
a loop until the number of retries has been exhausted.
6-11. Determines
the caller’s phone ID. If not already set, the User is prompted.
12-13. Prompts
for caller’s phone password.
14-19. Attempts
to authenticate caller based on the $id and $pwd
20-25. If
successfully authenticated, sets the $userId and exits the loop.
26-29. If
the provided $id and $pwd cannot be authenticated, informs the User that
the login failed and decrements the number of retries.
31-34. If
the caller could not be authenticated after the specified number of retries,
then informs the User that they have exhausted all of their login attempts.
Related topics
Event Processing Overview
Script Hierarchy
Relationship between Scripts and Script Objects