Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikeee/fritz-callmonitor
Provides a Node.js wrapper for the call monitor api of the AVM Fritz!Box.
https://github.com/nikeee/fritz-callmonitor
avm-fritz fritz-box fritz-callmonitor node typescript
Last synced: about 1 month ago
JSON representation
Provides a Node.js wrapper for the call monitor api of the AVM Fritz!Box.
- Host: GitHub
- URL: https://github.com/nikeee/fritz-callmonitor
- Owner: nikeee
- License: lgpl-3.0
- Created: 2014-09-06T20:47:18.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T11:07:30.000Z (3 months ago)
- Last Synced: 2024-10-19T22:14:37.825Z (3 months ago)
- Topics: avm-fritz, fritz-box, fritz-callmonitor, node, typescript
- Language: TypeScript
- Homepage: https://nikeee.github.io/fritz-callmonitor
- Size: 1 MB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fritz-callmonitor [![Build Status](https://travis-ci.com/nikeee/fritz-callmonitor.svg?branch=master)](https://travis-ci.com/nikeee/fritz-callmonitor) [![npm version](https://badge.fury.io/js/fritz-callmonitor.svg)](https://www.npmjs.com/package/fritz-callmonitor) ![Dependency Status](https://david-dm.org/nikeee/fritz-callmonitor.svg) ![License](https://img.shields.io/npm/l/fritz-callmonitor.svg)
Provides a Node.js wrapper for the call monitor api of the AVM Fritz!Box. Written in TypeScript.
## Installation
```Shell
npm install fritz-callmonitor
```### TypeScript Usage
You need TypeScript 2. Just install the NPM package and you're ready to go!## Enabling the API
The network API is disabled by default. To use this, call `#96*5*` on a phone which is managed by the FRITZ!Box.## Sample
```TypeScript
"use strict";import { CallMonitor, EventKind } from "fritz-callmonitor";
const cm = new CallMonitor("192.168.178.1", 1012);
cm.on("ring", rr => {
console.dir(rr);
console.log(`${rr.caller} calling...`);
});cm.on("call", rr => console.dir(rr));
cm.on("pickup", rr => console.dir(rr));
cm.on("hangup", rr => console.dir(rr));cm.on("phone", evt => {
// gets called on every phone event
switch(evt.kind) {
case EventKind.Ring:
case EventKind.Call:
console.log(`${evt.caller} -> ${evt.callee}`);
break;
}
});cm.on("close", () => console.log("Connection closed."));
cm.on("connect", () => console.log("Connected to device."));
cm.on("error", err => console.dir(err));cm.connect();
```