Skip to content

Commit

Permalink
Add example: block outgoing calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tbjolset committed Jun 18, 2021
1 parent c62909f commit 56266d0
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Block Outgoing Calls/README.md
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.

23 changes: 23 additions & 0 deletions Block Outgoing Calls/block-outgoing.js
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();
}
});
25 changes: 25 additions & 0 deletions Block Outgoing Calls/manifest.json
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
}
]
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Macros available:
| AppleTV Control | Add an Apple TV remote control to the touch 10. All communication is done directly via HDMI-CEC. No control system needed. |
| Audio Call Dial Pad | Ereate an in-room control application that adds a dedicated audio call dial pad to the Touch 10 |
| Audio Safe Guard | Enforce a maximum output volume on the device. Demostrates a simple macro using API statuses and commands |
| Block Outgoing Calls | Block certain numbers in a reject list from being called from the system. |
| Big Red Button | Quick action such as muting with a connected USB device |
| Camera Control with wide angle view | Your custom camera control page, including creating a wide angle view of two cameras and controlling both simultaneously. |
| Conditional Autoanswer with Prompt | Auto answer on incoming calls - but only for a select number of remote sites |
Expand Down

0 comments on commit 56266d0

Please sign in to comment.