Examples for the sipgate-io node library:
- Setup
- Call
- IDs
- Contacts
- Fax
- Fluent APIs
- Webhooks
- Webhooks Settings
- SMS
- History
- Real Time Call Manipulation
To run all examples fluently please copy the .env.example
and name it to .env
. After that configure the placeholders to match your preferred account settings.
Perform a call to a phone-number:
npm run call
You can list the most commonly used IDs (webUsers
, smsExtensions
, faxLines
, voicemails
and devices
) by running npm run ids:get_common
.
Delete a contact from your sipgate contacts by id.
npm run contacts:delete:by:id
Delete all contacts with SHARED
scope.
npm run contacts:delete:all:shared
Delete all contacts with PRIVATE
scope.
npm run contacts:delete:all:private
Import a Contact which is saved in VCard Format to your sipgate Account as a SHARED
contact.
npm run contacts:import:vcard:shared
Import a Contact which is saved in VCard Format to your sipgate Account as a PRIVATE
contact.
npm run contacts:import:vcard:private
Import a Contact by using a Object to your sipgate Account:
npm run contacts:import:object
Import contacts to your sipgate Account by passing a CSV-String:
npm run contacts:import:csv
Export Contacts from your sipgate Account to a CSV string with a specific SCOPE
:
npm run contacts:export:csv
Export Contacts from your sipgate Account wiht a specific SCOPE
to a List of VCard Strings:
npm run contacts:export:vcards
Send a Fax which is provided as pdf File:
npm run fax
Start a webhook receiver which listens to all available call events.
npm run fluent:webhook
.
Log all event types to the console:
npm run webhook:log:incoming:calls
Reject calls (e.g. outside of business hours):
npm run webhook:reject
Send calls to voicemail:
npm run webhook:voicemail
Play an announcement to a caller:
npm run webhook:play:audio
Play an announcement to a caller and hangup afterwards:
npm run webhook:play:audio:and:hangup
Get DTMF input from a caller and perform different actions (e.g. redirect or hang up calls) in response:
npm run webhook:gather
You can enable and disable Logging for Webhooks:
npm run settings:set:log
The incoming Webhook-Url will be triggered when a new call is received from outbound:
npm run settings:set:url:incoming
The outgoing Webhook-Url will be triggered when a new call is performed from inbound:
npm run settings:set:url:outgoing
You can clear the List which enables or disables devices for Webhooks:
npm run settings:whitelist:clear
You can completely disable the whitelist for Webhooks:
npm run settings:whitelist:disable
You can set a List of devices to be enabled for Webhooks:
npm run settings:whitelist:set
You can send a SMS by passing an Extension and a number as target:
npm run sms:send:extension
You can send a timed SMS by passing an Extension and a number as target:
npm run sms:send:extension:timed
You can send a SMS by passing a phonenumber and a number as target:
npm run sms:send:phone
You can fetch multiple history entries:
npm run history:fetch:all
You can fetch a specific history entry:
npm run history:fetch:by:id
You can delete a specific history entry:
npm run history:delete:by:id
You can delete multiple history entries:
npm run history:delete:by:list:of:ids
You can list all currently established calls by running npm run rtcm:list:all:established:calls
You can play an announcement by running npm run rtcm:announce
A call can be hold by executing npm run rtcm:hold
You can mute yourself in a present call by running the following npm script: npm run rtcm:mute
A recording can be started with the following script: npm run rtcm:record
You can send any dtmf sequence by running npm run rtcm:send:dtmf
Transferring a call can be achieved by running this npm command: npm run rtcm:transfer
A call can be hungup by running: npm run rtcm:hangup