PHPackages                             blacksenator/mini-sip4fb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. blacksenator/mini-sip4fb

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

blacksenator/mini-sip4fb
========================

SIP client at FRITZ!Box to terminate inbound calls

v1.0.6(1y ago)110MITPHPPHP ^8.2

Since Jan 30Pushed 1y ago2 watchersCompare

[ Source](https://github.com/blacksenator/miniSIP4fb)[ Packagist](https://packagist.org/packages/blacksenator/mini-sip4fb)[ Docs](https://github.com/blacksenator/miniSIP4fb)[ RSS](/packages/blacksenator-mini-sip4fb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (8)Used By (0)

A headless IP phone for AVM FRITZ!Box
=====================================

[](#a-headless-ip-phone-for-avm-fritzbox)

Purpose
-------

[](#purpose)

This library provides a class for the limited use of SIP under PHP. With **miniSIP4fb**, a simple headless softphone can be operated as a client on a FRITZ!Box, with which primarily only an incoming call can be terminated. Because the AVM FRITZ!Box does not provide the option to end an incoming call via an API (e.g. with a [SOAP action](https://github.com/blacksenator/fritzsoap?tab=readme-ov-file#wishes)), these functions represent a workaround.

I found some libraries for using SIP in PHP, but they followed a different functional approach, were in my opinion too complicated to use or had too much code for the intended purpose.

This software was created as an experiment. I wanted to test whether a virtual softphone (headless SIP client) could be used to accept and end incoming calls as easily as possible. Of course, the software has become more extensive than originally intended - also in order to cover as many eventualities as possible - even for this limited purpose.

### Overview of features

[](#overview-of-features)

**miniSIP4fb** provides functions to interact as a simple softphone (SIP client) with a FRITZ!Box (SIP server) as you can see on the exchange of messages on the left.

[![overview](/assets/miniSIP4fb.png)](/assets/miniSIP4fb.png)

Voice transmission is not supported. In combination with the manageable number of easy-to-use functions, other use cases are also conceivable, e.g. for controlling actuators through a call. Extensions may be necessary for this.

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- Composer (follow the installation guide at )
- an IP phone configured on the FRITZ!Box

Installation
------------

[](#installation)

You can install it through Composer:

```
"require": {
    "blacksenator/mini-sip4fb": "^1.0"
},
```

or

```
git clone https://github.com/blacksenator/miniSIP4fb.git
```

Precondition
------------

[](#precondition)

Of course, this software only works if a corresponding IP telephone has been defined on the FRITZ!Box beforehand. To do this, follow the [AVM instructions](https://en.avm.de/service/knowledge-base/dok/FRITZ-Box-7590/42_Registering-an-IP-telephone-with-the-FRITZ-Box-and-setting-it-up/) in point **3**. The following comments on this:

- 3.5 The name here (3.) is just a label. However, you can also transfer this to the softphone miniSIP4fb analogously using the [`'device'` parameter](#parameter), for example. But this is not necessary for the function
- 3.7 Remember the password well (or better yet, copy it). You will not be able to access it later, but you must pass it when instantiating miniSIP4fb. Of course, you can change the password of this device if you forget it
- 3.8 It doesn't matter which number you choose here. The software in its current state does not make calls
- 3.9 Here you should select all the phone numbers used so that miniSIP4fb receives an INVITE for every call - regardless of the number. But of course, it can be useful to have **miniSIP4f** respond only to a designated phone number. Then, of course, the FRITZ!Box will only send an INVITE to that very phone number and thus to that telephony device
- There is no need to activate the registration from the Internet. Apart from that, AVM explicitly advises against this

Usage
-----

[](#usage)

### Example

[](#example)

Below is a simple example how to use this class in your coding. Conveniently, you only need to enter the username and password of the IP telephone. This can be done in plain text, as this software can only be used within your FRITZ!Box home network. After setting up the IP phone on the FRITZ!Box you need to know these two credentials.

```
