Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
africastalking-client
Advanced tools
Provides convenient access to the Africa's Talking Voice APIs from your web apps.
Take a look at the API docs here.
You can install the package from npm by running:
$ npm install --save africastalking-client
You can import the method like so:
import Africastalking from 'africastalking-client'
The SDK is also accessible via our hosted cdn which can be included into your web page using the <script>
tag
<script src="https://unpkg.com/africastalking-client@1.0.6/build/africastalking.js"></script>
You can access the global variable Africastalking
from your browser.
You need to instantiate your client with a capability token.
It is generated by making an API POST request from to https://webrtc.africastalking.com/capability-token/request
with the following parameters:
NB: API requests require an
apiKey
in your request header for authentication.
Parameters | Description |
---|---|
usernameString Required | Your Africa’s Talking application username |
clientNameString Required | Your unique name used to identify and call your browser client(without space characters) |
phoneNumberString Required | Your Africa’s Talking phone number (in international format i.e. +254XXXYYY) |
incomingBoolean Optional | Enable the client to recieve incoming calls. Defaults to true |
outgoingBoolean Optional | Enable the client to make outgoing calls. Defaults to true |
expireString Optional | Period of time it takes the token to expire, in seconds. Default is 86400s |
{
"clientName": "somsom",
"incoming": true,
"lifeTimeSec": "86400",
"outgoing": true,
"token": "ATCAPtkn_206675b68efaff83d1ac2d027dd5bff18fd7cb64fgjhd5d0bdcsac44a883678afe7"
}
You can then initialize the client using the token.
const client = new Africastalking.Client(token)
client.on('incomingcall', function (params) {
alert(`${params.from} is calling you`)
}, false);
client.on('hangup', function (hangupCause) {
alert(`Call hung up (${hangupCause.code} - ${hangupCause.reason})`)
}, false);
Events | Description |
---|---|
ready | Client is ready to make or recieve calls |
notready | Client cant make or recieve calls, |
calling | Your client is making a call |
incomingcall | Your client is recieving a call |
callaccepted | Call has been accepted |
hangup | Call has ended |
offline | Token has expired |
closed | Connection to africastalking servers closed |
$("button").click(function() {
client.call("+254XXXXXYYY");
});
$("button").click(function() {
client.dtmf("1");
});
$("button").click(function() {
client.muteAudio();
});
methods | Description |
---|---|
call | Make a call to a phone number or browser client |
answer | Answer a call |
hangup | End an ongoing call |
dtmf | pass dtmf digits to Africastalking API |
muteAudio | Disables audio media sent during a call |
unmuteAudio | Enable audio media sent during a call |
hold | Puts a call on-hold |
unhold | Resumes a call |
FAQs
AfricasTalking voice client SDK
The npm package africastalking-client receives a total of 113 weekly downloads. As such, africastalking-client popularity was classified as not popular.
We found that africastalking-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.