-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Block Outgoing Calls | ||
|
||
Block certain numbers in a reject list from being called from the system. Show a message on screen instead. | ||
|
||
Open the macro in the macro editor and add more numbers to the list if you need to. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import xapi from 'xapi'; | ||
|
||
// variable that can be changed from settings ui on roomos.cisco.com | ||
const NumberToBlock = '[email protected]'; | ||
|
||
const denyList = [ | ||
NumberToBlock, | ||
|
||
// add more numbers like this if you need to: | ||
// '[email protected]', | ||
]; | ||
|
||
xapi.Status.Call.on(e => { | ||
const reject = denyList.some(number => number.toLowerCase().includes(e.RemoteNumber.toLowerCase())); | ||
const outgoing = e.Direction === 'Outgoing'; | ||
if (outgoing && reject) { | ||
xapi.Command.UserInterface.Message.Alert.Display({ | ||
Text: 'The number you called was not allowed by a user script on the device', | ||
Duration: 10, | ||
}); | ||
xapi.Command.Call.Disconnect(); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"version": "1", | ||
"profile": { | ||
"macro": { | ||
"items": [ | ||
{ | ||
"payload": "./block-outgoing.js", | ||
"type": "url", | ||
"id": "block-outgoing" | ||
} | ||
] | ||
}, | ||
"userParams": [ | ||
{ | ||
"id": "NumberToBlock", | ||
"name": "Number to block", | ||
"info": "Partial number is also ok", | ||
"type": "string", | ||
"default": "[email protected]", | ||
"domain": "block-outgoing", | ||
"required": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters