This project showcases how to change the Slack status of different users when they are in a call.
In order to use sipgate.io, you need to book the corresponding package in your sipgate account. The most basic package is the free sipgate.io S package.
If you use sipgate basic or simquadrat you can book packages in your product's feature store. If you are a sipgate team user logged in with an admin account you can find the option under Account Administration > Plans & Packages.
You can configure webhooks for sipgate.io as follows:
- Navigate to console.sipgate.com and login with your sipgate account credentials.
- Select the Webhooks > URLs tab in the left side menu
- Click the gear icon of the Incoming or Outgoing entry
- Fill in your webhook URL and click save. Note: your webhook URL has to be accessible from the internet. (See the section Making your computer accessible from the internet)
- In the sources section you can select what phonelines and groups should trigger webhooks.
In this example we only use one server to handle all call events. Configure your server address and port
in .env
.
For the prototype to work you need a Slack workspace with at least a Standard Plan.
In order to change statuses of other users you need to have the right permissions: There are four roles with the hierarchy
Primary Owner > Workspace Owner > Workspace Admin > Full Member.
You can only change your own status and the statuses of users with lower permissions. Create the Custom Slack App with a user according to your needs:
Go to Settings & administration -> Manage apps
. Click on Build
in the upper right corner (navbar).
Create an App and configure the permissions in Add features and functionality
. Add the OAuth-Scopes
users.profile:read
, users.profile:write
and install the App. Copy the OAuth-Access-Token and write it into the .env
file under SLACK_TOKEN
.
Add desired users to mappings.json
for the status update to work.
Navigate to the project's root directory and run:
npm install
npm start