Hi Guys,
Starting a new post as the old one (Adding caller ID to blacklist during call), in which I asked this question as a response, seems to have died :/.
What I’m trying to do:
When someone calls me, I’d like to press *9 (say) to blacklist the caller. I’d like a message played to me saying that the blacklist has been successful and maybe a message played to the caller saying that he/she has been blacklisted.
What I did:
As per david551’s and satish4asterisk’s valuable suggestions, I have managed to implement most of it as follows:
**features.conf**
[applicationmap]
apps => *9,peer,Macro,appblock
**extensions.conf**
......
......
;this part is a continuation of the rest of the dial plan. skipped the above part (of dial plan) as it isn't related to the question and may be confusing.
[macro-dial-extension]
exten => s,1,Set(_DYNAMICFEATURES=apps) ;if I don't put double underscore, then when B calls A (i.e. me), only B is able to press *9 and use the feature
same => n,Dial(${ARG1},u)
same => n,Return()
[macro-appblock]
exten => s,1,Set(DB(blacklist/${CALLERID(num)})=1)
same => n,Set(Value=${DB(test/${CALLERID(num)})})
same => n,SayDigits(1234) ;I'd like to put a message like "block successful"
same => n, MacroExit ; not sure what this is for
Ok, now the issue I have is:
Both the caller and the called party can press *9 to initiate the custom feature. From what I read, the “Activated By” field is no longer honoured so I have left it out. Ideally, I’d just want my side to be able to blacklist (it doesn’t make sense for the caller to blacklist my number on my own PBX!).
Also, currently the SayDigits(1234) is heard by the opposite channel (eg. if I press *9 then the caller hears it). But, I want to be able to hear “block successful”.
Any help would be appreciated.
Thanks,
Clive