TIPS Activating Blacklist on Xivo/Wazo

Ramblin

Guru
Joined
Oct 28, 2010
Messages
138
Reaction score
9
@wardmundy

In post
https://pbxinaflash.com/community/threads/viva-wazo-a-new-beginning.19238/page-9#post-121666

you added, immediately after that announcement, that the blacklist implementation for Xivo only required 3 lines of code
same = n,GotoIf($[${LEN(${DB(blacklist/${XIVO_SRCNUM})}))} > 1]?byebye)
same = n(byebye),Answer
same = n,Congestion

Where does this code go?

I want to add the blacklist feature but do not want to add the superfecta feature from the INcrediblePBX install script, but the only place I find that code is in the cid-superfect.conf file and I am not installing that.

I was trying to see if I could add just that functionality for blacklist and was thinking that if I added a file to /etc/asterisk/extensions_extra.d/ called xivo-blacklist.conf and put into that the contents (morphed from your xivo-subrgbl-did function) :
[xivo-blacklist-did]
exten = s,1,NoOp(### DID Incoming Call Subroutine ###)
same = n,NoOp(Calling FROM: ${XIVO_SRCNUM})
same = n,NoOp(Blacklist: ${DB(blacklist/${XIVO_SRCNUM})})
same = n,NoOp(Whitelist: ${DB(whitelist/${XIVO_SRCNUM})})
same = n,GotoIf($[${LEN(${DB(whitelist/${XIVO_SRCNUM})}))} > 1]?keepon)
same = n,GotoIf($[${LEN(${DB(blacklist/${XIVO_SRCNUM})}))} > 1]?byebye)
same = n(keepon),NoOp(### DID Allow the call to continue ###)
same = n(return),Return()
same = n(byebye),Answer
same = n,Congestion
same = n(return),Return()

that would do the trick

but I cannot see where the [xivo-blacklist-did] function would be called
(for that matter, I cannot see where the [xivo-subrgbl-did] function would get called either)

So I am obviously missing something.

I did add to /etc/asterisk/extensions_extra.d/xivo-extrafeatures.conf
;# // BEGIN app-blacklist
exten=*30,1,Goto(app-blacklist-add,s,1)
exten=*31,1,Goto(app-blacklist-remove,s,1)

and I did create a file called app-blacklist.conf in /etc/asterisk/extensions_extra.d with the content of your app-blacklist file

but I do not know how the underlying blacklist feature is being activated.

Is it built into Xivo?
Do I need to add the 3 lines of code (++) like shown in xivo-blacklist-did above somewhere?

I (and a lot of others) really appreciate what you are doing to make Xivo an easier to learn system.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,227
@Ramblin The .conf files in XiVO/Wazo are just storage bins for any contexts you want. Think of each of them as an extensions_custom.conf file in FreePBX parlance. Within the .conf files, you add whatever contexts you need.

Take a look at cid-superfecta.conf, and you'll find several global contexts which are native to XiVO/Wazo. They get called automatically whenever an incoming DID call arrives (xivo-subrgbl-did) or when a call is passed to a user (xivo-subrgbl-user). These are the hooks that you use to execute any code you wish to run for incoming calls. So you don't need your own context for the BlackList function. If you look at the DID subroutine, you'll see that all you really need to do to implement the BlackList and not use CID Superfecta is to replace the CID Superfecta line with a placeholder. Everything else to support blacklisting and whitelisting is already there. Don't forget to reload your dialplan if you don't use the Web GUI to make the changes.

Change:
Code:
same = n(keepon),GoSub(cid-superfecta,s,1)
To:
Code:
same = n(keepon),NoOp(Incoming call...)

Without changing the logic in the context, you can't just comment out the CID Superfecta line in this case because we're using the "keepon" label to move a call along if the call isn't blacklisted. Hope that helps explain what's going on.
 
Last edited:

Ramblin

Guru
Joined
Oct 28, 2010
Messages
138
Reaction score
9
@wardmundy

Got it - and thanks for the quick (and nicely explained) response.

I have dealt with a lot of technically smart people who could not explain things in as easy-to-undersatnd language as you do, so cudos to you sir and thanks.

I have concluded that those who have partially learned something can explain it using complicate language to those who have also learned it.
But those who really understand something can explain it to anyone.

I am no dummy in technology but I do need help so folks like you are most appreciated.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top