Content
Index:
PhoneLink for Asterisk (currently PJSIP is supported) is an auto-provisioning app (by Snom), which is loading dynamic and static settings (like remote registrar, username and password) from Asterisk into the Snom Provisioning System (SRAPS).
These settings are combined with predefined profile settings from the application and the settings are stored in SRAPS (Secure Redirection and Provisioning Service), a service hosted by Snom in Frankfurt am Main, Germany.
The main principle behind PhoneLink for Asterisk is to leave the existing system completely intact. There is no need to develop anything, and you do not need to create any additional secure infrastructure, since this is all provided by Snom.
Both PhoneLink for Asterisk and phone provisioning by SRAPS are available for free.
The used backend is defined by the configuration file, therefore it is not possible to use multiple backends.
At the moment we only support PJSIP and its configuration, for testing we used Asterisk 1.6, Manager 2.8.0.
From the convention, the MAC Address (and the IPUI for DECT handsets) are configured in the phoneprovr section, as it is described in the Asterisk Wiki.
[1000] type = phoneprovr endpoint = endpoint_1000 MAC = 000413928b88 IPUI = 0x0328D661AB PROFILE = snom OTHERVAR = othervalue
Currently, the only variables supported are endpoint, MAC and IPUI (for DECT handsets). PhoneLink will loop through all phoneprovr entries and will create a configuration. Other settings, like SIP Accounts and transport are set dynamically within PhoneLink for Asterisk.
Settings can be placed in different files, since these configuration files are read by Asterisk / res_pjsip and combined together into one big configuration. This is what PhoneLink (through the AMI) reaches out to.
Generated events of Asterisk are handled only for some basic operation. The configuration of PJSIP is reloaded (and with this SRAPS is updated) once the res_pjsip.so module gets restarted. This also happens once the timeout of refresh value of the configuration is reached.
PhoneLink for Asterisk is using two tables:
This data source does not use any event driven mechanism to reload the data. Once the query is completed the cursor is closed therefore the configuration is reloaded according to the refresh value.
Supported types of buttons are defined in the pgsql.py:
BUTTON_TYPES = ( 'none', 'dest', 'blf', 'speed', 'line', 'none', 'park' )
Important remarks for buttons
We use Python 3.8.
Apart from this, the modules from the requirements.txt are also needed and these Python Modules can be installed by using pip3. We strongly advise to start PhoneLink for Asterisk within a Docker Container. For this purpose the Dockerfile is also available in the GitLab repository.
The easiest way is to start the build.sh which will create the Docker Volume and the Container. This makes sure you have the required versions of Python modules.
Snom desk phones are fully supported. Depending on the backend however different configurations can be provisioned. Since Asterisk does not have a place for the configuration of function keys (fkey), this feature is only supported for PostgreSQL.
Generally speaking:
Multiple accounts are supported. You can associate the MAC address with multiple endpoints. In this case additional endpoints are going to be created for the phone as line identity. The numbering of identities starts from 1.
You must maintain the order of the Identities within the Asterisk configuration, or in the PostgreSQL. Best practice is to create a view, which defines the order of identities, since PhoneLink does not maintain the previous configuration and, if the results from the backend differs from the order of SIP accounts, they will be created in different order as they were created before.
The button table (supported only with PostgreSQL) may contain a "line" type key. This must be equipped with SIP credentials and treated as a new identity. The buttons, starting from 2, are assigned in order of appearance in the table to the newly created Identity.
Currently supported models are M900, M700 and M300.
For the M-Series you can define the MAC addresses for the different endpoints. PhoneLink will recognize the type of the device, and if the device is an M-Series device an extra line will be created. If IPUI is not defined, it is set to 0xFFFFFFFFF.
You must maintain the order of the Identities within the Asterisk configuration, or in the PostgreSQL. Best practice is to create a view, which defines the order of identities, since PhoneLink does not maintain the previous configuration and, if the results from the backend differs from the order of SIP accounts, they will be created in different order as they were created before.
M-Series cannot exchange Handset behind a SIP Identity and this leads to a problem when the configuration in Asterisk and in SRAPS differ to the settings within the Base Station.
Handsets cannot be exchanged straightforward. This is due to the restriction of DECT pairing a handset to a base station. To exchange or remove a handset from the base station you will have to reprovision the extension with an empty IPUI.
You can either remove the IPUI from the [ phoneprovr ] section, or set it to 0xFFFFFFFFFF. This will disassociate the handset from that extension and makes the slot ready to be paired with an another handset.
This device can be provisioned just like any other device from SRAPS and supports only SIP Line Extensions.
PhoneLink for Asterisk is released under the BSD 3-Clause Licence:
BSD 3-Clause License Copyright (c) 2021, Snom Technology GmbH All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Further Information
Related articles