Download the PHP package blacksenator/mini-sip4fb without Composer

On this page you can find all versions of the php package blacksenator/mini-sip4fb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mini-sip4fb

A headless IP phone for AVM FRITZ!Box

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), 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

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.

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

Installation

You can install it through Composer:

or

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 in point 3. The following comments on this:

Usage

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.

Of course, the period of time between recognizing the INVITE from the FRITZ!Box and its final OK after the BYE (hang up) depends on the test steps in between and the hardware. In the example above, this takes a fraction of a second.

Parameter

The transfer of the IP phone name and password when instantiating the class object is self-evident. To give the user more flexibility, a parameter array can optionally be passed:

The $param array can pass the following values:

key description default
'remoteIP' FRITZ!Box IP or hostname 'fritz.box'
'cSIPPort' client SIP port (your device) '5060'
'cSDPPort' client SDP port (not in use) '5062'
'rSIPPort' remote SIP port (FRITZ!Box) '5060'
'localHost' your device '0.0.0.0'
'timeOut' waiting for response or status changes (requests) 5 (sec)
'timeZone' your local time zone 'Europe/Berlin'
'device' label of your softphone in SIP messages 'miniSIP4fb'
'allow' supported methods ['INVITE', 'ACK', 'BYE', 'CANCEL']
'logFile' path and filename '' (no logging)

Demarcation

In my repositories you can find various solutions that use different FRITZ!Box interfaces:

This library will be integrated into the fbcallrouter in order to close the gap described there, namely that incoming spam calls from previously unknown numbers could not be terminated immediately. Unlike the call monitor interface (Port 1012) previously used in it , miniSIP4fb cannot of course perceive outgoing calls from other connected telephones. It cannot replace the call monitor in this manner.

The fritzsoap library already used in fbcallmonitor, on the other hand, provides various actions in the x_voip service (e.g. X_AVM-DE_GetClient...), with which, for example, configuration data for connected (IP) telephones can be retrieved. Or, even more interesting, an IP telephone can be set with X_AVM-DE_SetClient.... None of this has been used here yet.

Feedback

If you enjoy this software, then I would be happy to receive your feedback, also in the form of user comments and descriptions of your experiences, e.g. in the IP Phone Forum. This puts the user community on a broader basis and their experiences and functional ideas can be incorporated into further development. In the end, these features will benefit everyone.

Improvements

As already indicated in demarcation, it would be conceivable to use one of the SOAP actions X_AVM-DE_SetClient... from the x_voip service to avoid the software user having to manually set up the corresponding IP telephone on the FRITZ!Box beforehand. This would rule out any possible transmission errors in the credentials.

Gratitude

My special thanks go to Heiko Sommerfeldt, whose softphone solution PhonerLite with its protocol recording was an invaluable source of knowledge for me - in addition to his tips when I didn't understand at all why the FRITZ!Box wasn't responding to me.

Disclaimer

FRITZ!Box, FRITZ!Repeater, FRITZ!OS are trademarks of AVM. This software is in no way affiliated with AVM and only uses the interfaces published by them.

License

This script is released under MIT license.

Author

Copyright (c) 2025 Volker Püschel


All versions of mini-sip4fb with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package blacksenator/mini-sip4fb contains the following files

Loading the files please wait ...