In this example, we add a function "personal blacklist" in /etc/asterisk/extensions_custom.conf for followme calls (in the previous post, we added a feature "out of office")
Example:
Users phones: 10XXX
Then users can use this function from phones:
*13 - add
*14 - remove
1. Add to /etc/asterisk/extensions_custom.conf enable and disable blocks
Example:
Users phones: 10XXX
Then users can use this function from phones:
*13 - add
*14 - remove
1. Add to /etc/asterisk/extensions_custom.conf enable and disable blocks
[from-internal-custom] ;personal blacklist exten => *13,1,Goto(personal-blacklist-add,s,1) exten => *14,1,Goto(personal-blacklist-remove,s,1)
2. Add to /etc/asterisk/extensions_custom.conf check blocks in Followme
[personal-blacklist-add] exten => s,1,Answer exten => s,n,Wait(1) exten => s,n,Set(NumLoops=0) exten => s,n(start),Playback(enter-num-blacklist) exten => s,n,Set(TIMEOUT(digit)=5) exten => s,n,Set(TIMEOUT(response)=60) exten => s,n,Read(blacknr,then-press-pound,,,,) exten => s,n,SayDigits(${blacknr}) exten => s,n,Playback(if-correct-press&digits/1) exten => s,n,Noop(Waiting for input) exten => s,n(end),WaitExten(60,) exten => s,n,Playback(sorry-youre-having-problems&goodbye) exten => 1,1,GotoIf($[ "${blacknr}" != ""]?:personal-blacklist-add-invalid,s,1) exten => 1,n,Set(DB(AMPUSER/${CALLERID(num)}/blacklist/${blacknr})=1) exten => 1,n,Playback(num-was-successfully&added) exten => 1,n,Wait(1) exten => 1,n,Hangup [personal-blacklist-add-invalid] exten => s,1,Set(NumLoops=$[${NumLoops} + 1]) exten => s,n,Playback(pm-invalid-option) exten => s,n,GotoIf($[${NumLoops} < 3]?personal-blacklist-add,s,start) exten => s,n,Playback(goodbye) exten => s,n,Hangup [personal-blacklist-remove] exten => s,1,Answer exten => s,n,Wait(1) exten => s,n,Playback(entr-num-rmv-blklist) exten => s,n,Set(TIMEOUT(digit)=5) exten => s,n,Set(TIMEOUT(response)=60) exten => s,n,Read(blacknr,then-press-pound,,,,) exten => s,n,SayDigits(${blacknr}) exten => s,n,Playback(if-correct-press&digits/1) exten => s,n,Noop(Waiting for input) exten => s,n(end),WaitExten(60,) exten => s,n,Playback(sorry-youre-having-problems&goodbye) exten => 1,1,Noop(Deleting: AMPUSER/${CALLERID(num)}/blacklist/${blacknr} ${DB_DELETE(AMPUSER/${CALLERID(num)}/blacklist/${blacknr})}) exten => 1,n,Playback(num-was-successfully&removed) exten => 1,n,Wait(1) exten => 1,n,Hangup [app-blacklist-check-custom] exten => _10XXX,1,Noop("app-blacklist-check-custom") exten => _10XXX,n,Noop(${EXTEN}) exten => _10XXX,n,Noop(${CALLERID(num)}) exten => _10XXX,n,GotoIf($["${DB(AMPUSER/${EXTEN}/blacklist/${CALLERID(num)})}" = "1"]?app-blacklist-check,s,blacklisted) exten => _10XXX,n,Return [ext-findmefollow-custom] exten => _FMPR-10XXX,1,Noop("CUSTOM-FOLLOWME") exten => _FMPR-10XXX,n,Gosub(app-blacklist-check-custom,${EXTEN:5},1) exten => _FMPR-10XXX,n,GotoIf($["${DB(AMPUSER/${EXTEN:5}/followme/announ_custom)}" != "1"]?NOANNOUN) exten => _FMPR-10XXX,n,Answer exten => _FMPR-10XXX,n,Wait(1) exten => _FMPR-10XXX,n,Playback(custom/Hi_subscriber_you_are_calling_is_out_of_office) exten => _FMPR-10XXX,n,Goto(ext-findmefollow,${EXTEN:5},DIALGRP) exten => _FMPR-10XXX,n(NOANNOUN),Noop("NO ANNOUNCMENT") exten => _FMPR-10XXX,n,Macro(dial-one,${RT},${DIAL_OPTIONS},${EXTEN:5})