CALLTRACE for blacklist

Anyone know how to fetch the last incall CallerID from within a dialplan?

I have worked out the code (and will post once I get the answer to this final piece) to use the blacklist feature and control the blacklist from star-codes instead of requiring an adminstrator to go and and use CLI commands to add or delete numbers from the blacklist.

What I have working is a star-code to let a user add to and another star-code to delete from the blacklist by entering the number via the phone keypad.

What I want is to set it up so I can ALSO use another star-code to fetch the last caller’s number and add that number to the blacklist.

I just need to be able to get the last caller’s CallerID and I can do the rest.

This has historically been done using a CALLTRACE fetch from the database, but I did a

asterisk -rx “database show CALLTRACE”

and it showed the CALLTRACE empty.

I tried looking at the log file in

/var/log/asterisk/full

but could not see where I can use this.

Anyone know how to fetch the last incall CallerID from within a dialplan?

I’m not sure if there is some built-in function that would have let me fetch the CallerID Number of the last caller, but I could not find it so created one of my own. If someone knows of a built-in Wazo function, please let me know. Otherwise this works fine.

This solution stores and fetches the last caller’s CallerID regardless of who the call was going to and whether or not the call was answered. If you want to fine tune this to segragate caller records per User or some other means, extend the idea below. I like the global solution since I have a simple home / home office installation.

This will be a long post, likely needing muliple posts so stay with me here.

You will want to install some extra asterisk sound files for this to work. You can get the (US English sound files shown as an example) “extra” Allison gsm sound files from the Asterisk web site at
http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-gsm-current.tar.gz
which are then uncompressed and stored (with the proper 644 and root:root permissions) in

cd /usr/share/asterisk/sounds/en_US

and the “extra” Allison wav sound files at
http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gz
which are then uncompressed and stored (with the proper 644 and root:root permissions) in

/usr/share/asterisk/sounds/en_US

If you want to just use the “core” sound files already installed in your system, change the filenames in the Playback applications in this script to sound files that are in the “core” set.

This solution uses the global incall subroutine and adds the star-codes to the system features list, making it in effect for ALL incall routes and all users.

For all files created or edited, make sure that when you are done, the permissions are set at

chmod 660
chown asterisk:www-data

To add the new star-codes to the Wazo system, in the /etc/asterisk/extensions_extra.d/ directory in the xivo-extrafetures.conf file after the [xivo-extrafeatures] line (or in other words, in the xivo-extrafeatures context) add

;
; Added Features to enable management of the blacklist via star-codes
; To add the last caller's CallerID Number to the blacklist
exten => _*70,1,NoOp(Blacklist function for user to automatically add last incall CallerID to blacklist)
same  => n,Goto(blacklist-manage-add-last,blacklist-add-last-number,1)
; To manually add a number to the blacklist, by entering the number through the phone's keypad
exten => _*71,1,NoOp(Blacklist function for user to manually enter a number to blacklist)
same  => n,Goto(blacklist-manage-add,blacklist-add-number,1)
; To manually delete a number from the blacklist, by entering the number through the phone's keypad
exten => _*72,1,NoOp(Blacklist function for user to manually enter a number to remove from blacklist)
same  => n,Goto(blacklist-manage-delete,blacklist-delete-number,1)

To add the scripts that makes the new star-codes work, in the /etc/asterisk/extensions_extra.d/ directory add a file called blacklist.conf (with permissions as shown above) and into that file put

;
; These contexts work with the new star-codes added in /etc/asterisk/extensions_extra.d/xivo-extrafeatures.conf
;   *70 = Add the last caller's CallerID Number to the blacklist
;   *71 = Add a number to the blacklist, by entering the number through the phone's keypad
;   *72 = Delete a number from the blacklist, by entering the number through the phone's keypad
;
; The additions to the global incall context [xivo-subrgbl-did] will do two things:
;   1) Store the CallerdID Number of the current caller to the system
;      (which will be used by the *70 star-code to blacklist that number if *70 is used
;   2) Use a built-in Wazo application to check the current caller's CallerID Number to see if it is in the blacklist
;      and if so, play a (silly, zombie apocalypse) message and hangup on the caller
;
; The remaining contexts are to enable the functionality of the new star-codes
;
[xivo-subrgbl-did]
exten  =>  s,1,NoOp(Store the CallerID of the caller - replaced by the next caller - in the Asterisk database)
same   =>  n,Set(DB(LastCaller/CallerIDnum)=${CALLERID(num)})
same   =>  n,NoOp(Check incoming calls to see if the caller is in the blacklist - if so, play nonsense and hangup)
same   =>  n,GotoIf(${BLACKLIST()}?blacklisted)
same   =>  n,Return()
same   =>  n(blacklisted),Playback(zombies)
same   =>  n,Hangup()
;
[blacklist-manage-add-last]
exten  =>  blacklist-add-last-number,1,NoOp(Add the number of the last CallerID to the blacklist)
same   =>  n,Answer()
same   =>  n,Wait(1)
same   =>  n,Set(TIMEOUT(absolute)=60)
same   =>  n,Set(TIMEOUT(response)=10)
same   =>  n,Set(TIMEOUT(digit)=10)
same   =>  n,Set(LastCallerIDnum=${DB(LastCaller/CallerIDnum)})
same   =>  n,GotoIf($[ $[ "${LastCallerIDnum}" = "" ] | $[ "${LastCallerIDnum}" = "unknown" ] ]?blacklist-error,InvalidNumber,1)
same   =>  n,Playback(privacy-to-blacklist-last-caller&telephone-number)
same   =>  n,SayDigits(${LastCallerIDnum})
same   =>  n,Background(if-correct-press&digits/1)
same   =>  n,WaitExten()
exten  =>  t,1,NoOp(The user did not provide any response before the response timeout set above)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  i,1,NoOp(The user either waited longer than the digit timeout between key presses or input an invalid number)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  T,1,NoOp(The user did not finish the input - press # - before the absolute timeout)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  e,1,NoOp(A Catch-all error handler in case the above 3 conditions did not catch the fail)
same   =>  n,Goto(blacklist-error,InvalidNumber,1)
exten  =>  1,1,NoOp(The user confirmed the number with an acceptable input within the allowed time limit)
same   =>  n,Set(ReasonForBlacklist=Added by star-codes)
same   =>  n,Set(DB(blacklist/${LastCallerIDnum})=${ReasonForBlacklist})
;same   =>  n,SayDigits(${LastCallerIDnum})
same   =>  n,Playback(num-was-successfully&added)
same   =>  n,Hangup
;
[blacklist-manage-add]
exten  =>  blacklist-add-number,1,NoOp(User manually adds a new number to the blacklist)
same   =>  n,Answer()
same   =>  n,Wait(1)
same   =>  n,Set(TIMEOUT(absolute)=60)
same   =>  n,Set(TIMEOUT(response)=10)
same   =>  n,Set(TIMEOUT(digit)=10)
same   =>  n,Read(IncomingCallerNumber,enter-num-blacklist&then-press-pound,0,s,1,)
same   =>  n,GotoIf($[ ${READSTATUS} != OK ]?blacklist-error,InvalidNumber,1)
same   =>  n,SayDigits(${IncomingCallerNumber})
same   =>  n,Background(if-correct-press&digits/1)
same   =>  n,WaitExten()
exten  =>  t,1,NoOp(The user did not provide any response before the response timeout set above)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  i,1,NoOp(The user either waited longer than the digit timeout between key presses or input an invalid number)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  T,1,NoOp(The user did not finish the input - press # - before the absolute timeout)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  e,1,NoOp(A Catch-all error handler in case the above 3 conditions did not catch the fail)
same   =>  n,Goto(blacklist-error,InvalidNumber,1)
exten  =>  1,1,NoOp(The user confirmed the number with an acceptable input within the allowed time limit)
same   =>  n,Set(ReasonForBlacklist=Added by star-codes)
same   =>  n,Set(DB(blacklist/${IncomingCallerNumber})=${ReasonForBlacklist})
;same   =>  n,SayDigits(${IncomingCallerNumber})
same   =>  n,Playback(num-was-successfully&added)
same   =>  n,Hangup
;
[blacklist-manage-delete]
exten  =>  blacklist-delete-number,1,NoOp(User manually deletes an existing number from the blacklist)
same   =>  n,Answer()
same   =>  n,Wait(1)
same   =>  n,Set(TIMEOUT(absolute)=60)
same   =>  n,Set(TIMEOUT(response)=10)
same   =>  n,Set(TIMEOUT(digit)=10)
same   =>  n,Read(CallerNumberToDelete,entr-num-rmv-blklist&then-press-pound,0,s,1,)
same   =>  n,GotoIf($[ ${READSTATUS} != OK ]?blacklist-error,InvalidNumber,1)
same   =>  n,SayDigits(${CallerNumberToDelete})
same   =>  n,GotoIf($[${DB_EXISTS(blacklist/${CallerNumberToDelete})}]?:blacklist-error,InvalidNumber,1)
same   =>  n,Background(if-correct-press&digits/1)
same   =>  n,WaitExten()
exten  =>  t,1,NoOp(The user did not provide any response before the response timeout set above)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  i,1,NoOp(The user either waited longer than the digit timeout between key presses or input an invalid number)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  T,1,NoOp(The user did not finish the input - press # - before the absolute timeout)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  e,1,NoOp(A Catch-all error handler in case the above 3 conditions did not catch the fail)
same   =>  n,Goto(blacklist-error,InvalidNumber,1)
exten  =>  1,1,NoOp(The user confirmed the number with an acceptable input within the allowed time limit)
same   =>  n,Set(VarValue=${DB_DELETE(blacklist/${CallerNumberToDelete}}))
same   =>  n,GotoIf($[${EmptyCheck} == "" ]?blacklist-error,InvalidNumber,1)
;same   =>  n,SayDigits(${CallerNumberToDelete})
same   =>  n,Playback(num-was-successfully&removed)
same   =>  n,Hangup
;
[blacklist-error]
exten  =>  InvalidNumber,1,NoOp(The user tried to add delete an invalid number)
same   =>  n,Playback(pm-invalid-option)
same   =>  n,Goto(SorryBye,1)
exten  =>  SorryBye,1,NoOp(Play apology and hangup)
same   =>  n,Playback(sorry-youre-having-problems&goodbye)
same   =>  n,Hangup

Instructions for use of the blacklist feature

Numbers can be added and removed from the Blacklist by phone or by using commands on the Asterisk CLI.

Managing the Blacklist by Phone is supported with the following star-codes:

*70 = Add the last caller’s CallerID Number to the blacklist
*71 = Add a number to the blacklist, by entering the number through the phone’s keypad
*72 = Delete a number from the blacklist, by entering the number through the phone’s keypad

You can also manage the Blacklist using the Asterisk CLI with the following syntax:

To add a number
database put blacklist 9999999999 “the reason they are being blacklisted”
or, from the system CLI with
asterisk -rx ‘database put blacklist 9999999999 “the reason they are being blacklisted”’
To delete a number
database del blacklist 9999999999
or, from the system CLI with
asterisk -rx ‘database del blacklist 9999999999’
To delete ALL numbers from the blacklist
database deltree blacklist
or, from the system CLI with
asterisk -rx ‘database deltree blacklist’
To show all numbers currently in the blacklist
database show blacklist
or, from the system CLI with
asterisk -rx ‘database show blacklist’

To Block Anonymous and Restricted Calls, you must access the asterisk CLI:

You can log into the asterisk CLI from the superuser CLI using asterisk -r and then logout using quit

Or you can create a series one-line commands, using asterisk -rx " asterisk cli command" which will each

  • Initiate an asterisk CLI session
  • Submit an asterisk command
  • Exit the asterisk session

To add anonymous callers to the blacklist (caveat: many cell phones have anonymous by default so I did NOT use this)

asterisk -rvx 'database put blacklist Anonymous "Blocking calls with no identifier"'
asterisk -rvx 'database put blacklist anonymous "Blocking calls with no identifier"'
asterisk -rvx 'database put blacklist Restricted "Blocking calls with no identifier"'

Hello @Ramblin,

Thank you for this thread. to open your mind with a different approach and because we are working to have a different vision in wazo about writing feature as little as possible without dialplan, i did the same sub routine but connected to a node-red. The really nice feature is you have the choice to do many options to play with your call. The example is for blacklisting a call, but you can imagine what you want.

[xivo-subrgbl-did]
exten =  s,1,NoOp(Check if incoming calls is blacklisted in node-red)
same  =    n,Set(CURLOPT(ssl_verifypeer)=0)
same  =    n,Set(CURLOPT(header)=1)
same  =    n,Set(CURLOPT(httptimeout)=10)
same  =    n,Set(CURLOPT(httpheader)=X_CHANNEL_ID:${CHANNEL(uniqueid)})
same  =    n,Set(CURLOPT(httpheader)=X_EXTEN:${XIVO_BASE_EXTEN})
same  =    n,Set(CURLOPT(httpheader)=X_CALLERID:${CALLERID(num)})
same  =    n,Set(CURLOPT(useragent)=wazo)
same  =    n,Set(CURL_RESULT=${CURL(http://**your_node_red**/blacklist)})
same  =    n,Set(RESPONSE=${CUT(CURL_RESULT, ,2)})
same  =    n,GotoIf($["${RESPONSE}" = "404"]?blacklisted)
same  =    n,Return()
same  =    n(blacklisted),Playback(bye)
same  =    n,Hangup()

This dialplan just make an http request to a node-red, and it decide to accept call or not depending of the HTTP result of your request. So basically 200 is, ok call is not blacklisted, and 404 is call is blacklisted.

In my node red i just created an http endpoint /blacklist and i wrote a very small function for the exemple to accept or not the call. If the call is accepted, i just go to the 200 and if not go to 404.

In my function, i just get the information like this:

const callerid = msg.req.headers.x_callerid;
const channel_id = msg.req.headers.x_channel_id;
const exten = msg.req.headers.exten;

if (callerid == '8000') {
    return [null,msg]
}

return [msg,null];

So this is a really simple exemple, but you can imagine for exemple to get your blacklist from a google sheet, or any databases you want. The possibility is clearly very big ;).

I know the approach is very different to make dialplan, but i think the approach with node-red if very funny and more powerful. There is some examples i wrote in this forum check here :

Hope this help you to continue to play with wazo-platform and help people to create lot of really fun applications!

Sylvain

1 Like

@quintana

Wow, thank you

I’ll have to dig into that to understand it more.

In the meantime, we crossed activities, and I have added a star-code to playback over the phone the count of numbers blacklisted and then playback each blacklisted number.

I’ll take a look at your material and see what I can learn from it. You may be getting some questions :slight_smile:

I realized after posting the above, that if you are going to add and delete using star-codes, you proably want to be able see what is in the blacklist using star-codes.

So I added a 4th star-code (*73) which, when used, will tell the caller how many numbers are blacklisted and then playback the list of actual CallerIDs that are in the blacklist. (And yes, the user can hang up any time during the playback if they have heard enough … :slight_smile: )

So, to get the 4th star-code functionality:

In the xivo-extrafeatures.conf file in /etc/asterisk/extensions_extra.d I now have

; put extra extensions here
[xivo-extrafeatures]
;
; Added Features to enable management of the blacklist via star-codes
; To add the last caller’s CallerID Number to the blacklist
exten => _*70,1,NoOp(Blacklist function for user to automatically add last incall CallerID to blacklist)
same => n,Goto(blacklist-manage-add-last,blacklist-add-last-number,1)
; To manually add a number to the blacklist, by entering the number through the phone’s keypad
exten => _*71,1,NoOp(Blacklist function for user to manually enter a number to blacklist)
same => n,Goto(blacklist-manage-add,blacklist-add-number,1)
; To manually delete a number from the blacklist, by entering the number through the phone’s keypad
exten => _*72,1,NoOp(Blacklist function for user to manually enter a number to remove from blacklist)
same => n,Goto(blacklist-manage-delete,blacklist-delete-number,1)
; To read the list of entries in the blacklist to the User on the phone
exten => _*73,1,NoOp(Blacklist function for user to get a list of numbers in the blacklist)
same => n,Goto(blacklist-manage-list,blacklist-list-numbers,1)

In the blacklist.conf file in /etc/asterisk/extensions_extra.d I now have

;
; These contexts work with the new star-codes added in /etc/asterisk/extensions_extra.d/xivo-extrafeatures.conf
;   *70 = Add the last caller's CallerID Number to the blacklist
;   *71 = Add a number to the blacklist, by entering the number through the phone's keypad
;   *72 = Delete a number from the blacklist, by entering the number through the phone's keypad
;   *73 = Read back over the phone the count of numbers blacklisted and then read each number blacklisted
;
; The additions to the global incall context [xivo-subrgbl-did] will do two things:
;   1) Store the CallerdID Number of the current caller to the system
;      (which will be used by the *70 star-code to blacklist that number if *70 is used
;   2) Use a built-in Wazo application to check the current caller's CallerID Number to see if it is in the blacklist
;      and if so, play a (silly, zombie apocalypse) message and hangup on the caller
;
; The remaining contexts are to enable the functionality of the new star-codes
;
[xivo-subrgbl-did]
exten  =>  s,1,NoOp(Store the CallerID of the caller - replaced by the next caller - in the Asterisk database)
same   =>  n,Set(DB(LastCaller/CallerIDnum)=${CALLERID(num)})
same   =>  n,NoOp(Check incoming calls to see if the caller is in the blacklist - if so, play nonsense and hangup)
same   =>  n,GotoIf(${BLACKLIST()}?blacklisted)
same   =>  n,Return()
same   =>  n(blacklisted),Playback(zombies)
same   =>  n,Hangup()
;
[blacklist-manage-add-last]
exten  =>  blacklist-add-last-number,1,NoOp(Add the number of the last CallerID to the blacklist)
same   =>  n,Answer()
same   =>  n,Wait(1)
same   =>  n,Set(TIMEOUT(absolute)=60)
same   =>  n,Set(TIMEOUT(response)=10)
same   =>  n,Set(TIMEOUT(digit)=10)
same   =>  n,Set(LastCallerIDnum=${DB(LastCaller/CallerIDnum)})
same   =>  n,GotoIf($[ $[ "${LastCallerIDnum}" = "" ] | $[ "${LastCallerIDnum}" = "unknown" ] ]?blacklist-error,InvalidNumber,1)
same   =>  n,Playback(privacy-to-blacklist-last-caller&telephone-number)
same   =>  n,SayDigits(${LastCallerIDnum})
same   =>  n,Background(if-correct-press&digits/1)
same   =>  n,WaitExten()
exten  =>  t,1,NoOp(The user did not provide any response before the response timeout set above)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  i,1,NoOp(The user either waited longer than the digit timeout between key presses or input an invalid number)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  T,1,NoOp(The user did not finish the input - press # - before the absolute timeout)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  e,1,NoOp(A Catch-all error handler in case the above 3 conditions did not catch the fail)
same   =>  n,Goto(blacklist-error,InvalidNumber,1)
exten  =>  1,1,NoOp(The user confirmed the number with an acceptable input within the allowed time limit)
same   =>  n,Set(ReasonForBlacklist=Added by star-codes)
same   =>  n,Set(DB(blacklist/${LastCallerIDnum})=${ReasonForBlacklist})
;same   =>  n,SayDigits(${LastCallerIDnum})
same   =>  n,Playback(num-was-successfully&added)
same   =>  n,Hangup
;
[blacklist-manage-add]
exten  =>  blacklist-add-number,1,NoOp(User manually adds a new number to the blacklist)
same   =>  n,Answer()
same   =>  n,Wait(1)
same   =>  n,Set(TIMEOUT(absolute)=60)
same   =>  n,Set(TIMEOUT(response)=10)
same   =>  n,Set(TIMEOUT(digit)=10)
same   =>  n,Read(IncomingCallerNumber,enter-num-blacklist&then-press-pound,0,s,1,)
same   =>  n,GotoIf($[ ${READSTATUS} != OK ]?blacklist-error,InvalidNumber,1)
same   =>  n,SayDigits(${IncomingCallerNumber})
same   =>  n,Background(if-correct-press&digits/1)
same   =>  n,WaitExten()
exten  =>  t,1,NoOp(The user did not provide any response before the response timeout set above)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  i,1,NoOp(The user either waited longer than the digit timeout between key presses or input an invalid number)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  T,1,NoOp(The user did not finish the input - press # - before the absolute timeout)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  e,1,NoOp(A Catch-all error handler in case the above 3 conditions did not catch the fail)
same   =>  n,Goto(blacklist-error,InvalidNumber,1)
exten  =>  1,1,NoOp(The user confirmed the number with an acceptable input within the allowed time limit)
same   =>  n,Set(ReasonForBlacklist=Added by star-codes)
same   =>  n,Set(DB(blacklist/${IncomingCallerNumber})=${ReasonForBlacklist})
;same   =>  n,SayDigits(${IncomingCallerNumber})
same   =>  n,Playback(num-was-successfully&added)
same   =>  n,Hangup
;
[blacklist-manage-delete]
exten  =>  blacklist-delete-number,1,NoOp(User manually deletes an existing number from the blacklist)
same   =>  n,Answer()
same   =>  n,Wait(1)
same   =>  n,Set(TIMEOUT(absolute)=60)
same   =>  n,Set(TIMEOUT(response)=10)
same   =>  n,Set(TIMEOUT(digit)=10)
same   =>  n,Read(CallerNumberToDelete,entr-num-rmv-blklist&then-press-pound,0,s,1,)
same   =>  n,GotoIf($[ ${READSTATUS} != OK ]?blacklist-error,InvalidNumber,1)
same   =>  n,SayDigits(${CallerNumberToDelete})
same   =>  n,GotoIf($[${DB_EXISTS(blacklist/${CallerNumberToDelete})}]?:blacklist-error,InvalidNumber,1)
same   =>  n,Background(if-correct-press&digits/1)
same   =>  n,WaitExten()
exten  =>  t,1,NoOp(The user did not provide any response before the response timeout set above)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  i,1,NoOp(The user either waited longer than the digit timeout between key presses or input an invalid number)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  T,1,NoOp(The user did not finish the input - press # - before the absolute timeout)
same   =>  n,Goto(blacklist-error,SorryBye,1)
exten  =>  e,1,NoOp(A Catch-all error handler in case the above 3 conditions did not catch the fail)
same   =>  n,Goto(blacklist-error,InvalidNumber,1)
exten  =>  1,1,NoOp(The user confirmed the number with an acceptable input within the allowed time limit)
same   =>  n,Set(VarValue=${DB_DELETE(blacklist/${CallerNumberToDelete}}))
same   =>  n,GotoIf($[${EmptyCheck} == "" ]?blacklist-error,InvalidNumber,1)
;same   =>  n,SayDigits(${CallerNumberToDelete})
same   =>  n,Playback(num-was-successfully&removed)
same   =>  n,Hangup
;
[blacklist-manage-list]
exten  =>  blacklist-list-numbers,1,NoOp(Read the numbers stored in the blacklist over the phone)
same   =>  n,Answer()
same   =>  n,NoOp(Get the number of entries in the blacklist)
same   =>  n,Set(BlacklistArray=${DB_KEYS(blacklist)})
same   =>  n,Set(NumberInBlacklist=0)
same   =>  n(CountLoopStart),While( $[ $["${SET(BlacklistEntry=${SHIFT(BlacklistArray)})}" != ""] ] )
same   =>    n,Set(NumberInBlacklist=$[ ${NumberInBlacklist} + 1 ] )
same   =>    n,NoOp(Current count of Number in Blacklist is ${NumberInBlacklist})
same   =>  n(CountLoopEnd),EndWhile()
same   =>  n,Playback(privacy-blacklisted&the-num-i-have-is)
same   =>  n,SayNumber(${NumberInBlacklist})
same   =>  n,GotoIf($[${NumberInBlacklist}  == 0 ]?Hangup)
same   =>  n,Wait(.5)
same   =>  n,NoOp(Speak each number in the blacklist)
same   =>  n,Playback(for-a-list-of&privacy-blacklisted)
same   =>  n,Set(BlacklistArray=${DB_KEYS(blacklist)})
same   =>  n,Set(LoopCounter=0)
same   =>  n(LoopStart),While( $[ ${LoopCounter} < ${NumberInBlacklist} ] )
same   =>    n,Set(LoopCounter=$[ ${LoopCounter} + 1 ] )
same   =>    n,Wait(.5)
same   =>    n,SayNumber(${LoopCounter})
same   =>    n,Playback(is)
same   =>    n,Wait(.5)
same   =>    n,SET(BlacklistEntry=${SHIFT(BlacklistArray)})}
same   =>    n,SayDigits(${BlacklistEntry})
same   =>  n(LoopEnd),EndWhile()
same   =>  n(Hangup),Hangup
;
[blacklist-error]
exten  =>  InvalidNumber,1,NoOp(The user tried to add delete an invalid number)
same   =>  n,Playback(pm-invalid-option)
same   =>  n,Goto(SorryBye,1)
exten  =>  SorryBye,1,NoOp(Play apology and hangup)
same   =>  n,Playback(sorry-youre-having-problems&goodbye)
same   =>  n,Hangup

And of course, the instructions would need to be updated to include the *73 star-code

Having said all this, @quintana has added a method using curl instead of star-codes (see above) that, once I understand it :slight_smile: , I may just abandon all this, but for now, this works for me.

If anyone else likes it, yours to use!

OK, so you have me intrigued. I will likely look into this once I have finished the installation of my Wazo syste. I want to get it up and running soon to replace my (now 8 years old) PBX.

Quick question: From your example 1 in your post, you showed how to do things in and outside of Wazo using dtmf from your phone. Am I correct in assuming you could use the same star-codes I have added via a dial plan and have them do the same thing (and more) with node-red?

Yep you can do so many different things :slight_smile:

Example to supervise trunks: https://www.youtube.com/watch?v=Pqv_4CvNaPY
Another example here: https://www.youtube.com/watch?v=YjEGhnouCTY