Hi,
I have this working marvelously, but now I am adding in sound files to make it more, for lack of a better work, professional. What I want to do is the following:
- Locked extensions tries to call out, but is prompted for password because is locked. User types in password and sound file plays and says “This extension is now unlocked.” and then continues the call. BUT, I can get the sound to play, but it plays on all outbound calls (whether extension is locked or not). I just want it to play after a successful PIN entry and phone unlock. Is this possible? What I have as of code is below. Thanks! Ross
[extension-lock]
exten => _.,1,NoOp(AMPUSER/${CALLERID(num)}/locked)
exten => _.,n,Gotoif($[${DB_EXISTS(AMPUSER/${CALLERID(num)}/locked)}=0]?carryon)
exten => _.,n,Set(PINCOUNT=0)
exten => _.,n,Set(VALIDPIN=23646)
exten => _.,n(readpin),Read(PIN,custom/ExtenLocked,)
exten => _.,n,Gotoif($[${PIN}=${VALIDPIN}]?carryon)
exten => _.,n,Gotoif($[${PIN}=${DB(AMPUSER/${CALLERID(num)}/locked)}]?carryon)
exten => _.,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => _.,n,Playback(vm-incorrect)
exten => _.,n,GotoIf($[${PINCOUNT}>3]?h)
exten => _.,n,Wait(1)
exten => _.,n,Goto(readpin)
exten => _.,n(carryon),NoOp(${DB_DELETE(AMPUSER/${CALLERID(num)}/locked)})
exten => _.,n,Goto(from-internal,${EXTEN},1)
exten => 911,1,Goto(from-internal,${EXTEN},1)
exten => h,1,Hangup
What I thought was that “exten => _.,n,Gotoif($[${PIN}=${VALIDPIN}]?carryon)” sent the call after a successful PIN entry to “exten => _.,n(carryon),NoOp(${DB_DELETE(AMPUSER/${CALLERID(num)}/locked)})”. And it does, so I tried to do
[extension-lock]
exten => _.,1,NoOp(AMPUSER/${CALLERID(num)}/locked)
exten => _.,n,Gotoif($[${DB_EXISTS(AMPUSER/${CALLERID(num)}/locked)}=0]?carryon)
exten => _.,n,Set(PINCOUNT=0)
exten => _.,n,Set(VALIDPIN=23646)
exten => _.,n(readpin),Read(PIN,custom/ExtenLocked,)
exten => _.,n,Gotoif($[${PIN}=${VALIDPIN}]?unlocked)
exten => _.,n,Gotoif($[${PIN}=${DB(AMPUSER/${CALLERID(num)}/locked)}]?carryon)
exten => _.,n,Set(PINCOUNT=$[${PINCOUNT}+1])
exten => _.,n,Playback(vm-incorrect)
exten => _.,n,GotoIf($[${PINCOUNT}>3]?h)
exten => _.,n,Wait(1)
exten => _.,n,Goto(readpin)
exten => _.,n(unlocked),Playback(custom/ExtenUnlocked)
exten => _.,n(unlocked),NoOp(${DB_DELETE(AMPUSER/${CALLERID(num)}/locked)})
exten => _.,n(carryon),NoOp(${DB_DELETE(AMPUSER/${CALLERID(num)}/locked)})
exten => _.,n,Goto(from-internal,${EXTEN},1)
exten => 911,1,Goto(from-internal,${EXTEN},1)
exten => h,1,Hangup
But it skips the sound file and goes to “carryon”.
What do I need to do? I saw that wnpaul got it to work in his post above. What did you do, wnpaul, to get the sound file to play after a successful unlock?