skip to content
Daniel Fernau's Blog

Telekom SIP Settings for FreePBX

/ 4 min read

Overview

As of writing this article, the only official documentation related to registering SIP clients with private Telekom.de landlines can be found here (archived version here).

The purpose of this article is to document for everyone interested in this topic (as well as for my future self) the configuration settings necessary to add these phone lines as trunks to FreePBX for inbound and outbound calls. There are a lot of incomplete, outdated, and non-functional configuration examples all across the internet. The settings documented below are what works for me as of writing this post and have been tested with multiple trunks and accounts.

FreePBX configuration

Add Trunk

  1. Log into the FreePBX admin interface
  2. Navigate to Connectivity > Trunks
  3. Click on Add Trunk > Add SIP (chan_pjsip) Trunk

Configure TLS transport

  1. Navigate to Settings > Asterisk SIP Settings
  2. In the General SIP Settings tab, ensure the following configuration values:
    1. Security Settings
      1. Allow Anonymous Inbound SIP Calls > No
      2. Allow SIP Guests > Yes
      3. Default TLS Port Assignment > PJSip
    2. NAT Settings
      1. External Address > set this to your fixed public IP address (if you have one), otherwise ignore this setting
      2. Local networks > make sure to add your local network CIDRs here (e.g., 192.168.178.0/24)
    3. Everything else can be left on default values and/or empty
  3. Go to the SIP Settings [chan_pjsip] tab
  4. In the tls section, set tls - {freepbx_ip} - {interface_name} (e.g., tls - 10.100.20.10 - eth0) to Yes
  5. Submit the configuration and restart FreePBX

Trunk configuration

General

On this config page, the number for the line you want to add needs to be in local/regional format, i.e., 0301234567, not in international format (+49301234567).

SettingValue
Trunk NameTelekom-0301234567
Hide CallerIDNo
Outbound CallerID0301234567
CID OptionsAllow Any CID
Maximum Channels2
Asterisk Trunk Dial OptionsT and System
Continue if BusyNo
Disable TrunkNo
Monitor Trunk Failures (empty) and No

Dial Number Manipulation Rules

This needs only to be configured if the dialed number needs to be changed before sending it out the trunk, for example, in cases where you have multiple trunks configured and use a dial prefix on your phone to select the desired outbound line.

Don’t change anything here if you don’t know what you’re doing.

pjsip Settings

This is where the interesting stuff happens. All phone numbers entered in the following three sections need to be in * international format*, i.e., +49301234567.

General

SettingValue
Username+49301234567
Auth username (empty; automatically uses value from Username field)
SecretmySecretTelekomPassword (use your Kundencenter password here, i.e., the one you use to log into the Telekom.de website to view your invoices, not your router or PPPoE password)
AuthenticationOutbound
RegistrationSend
Language CodeDefault
SIP Servertel.t-online.de
SIP Server Port (empty to use default port 5060)
Contextfrom-pstn
Transport{freepbx_ip}-tls (if you cannot select this, check the Configure TLS transport section again)

Advanced

SettingValue
DTMF ModeRFC 4733
Permanent Auth RejectionYes
Forbidden Retry Interval30
Fatal Retry Interval30
General Retry Interval60
Expiration480
Max Retries10
Qualify Frequency60
Outbound Proxysip:tel.t-online.de\;lr (The \;lr is especially important here as it forces the route URI to use loose routing. If this is not included, the connections will fail!)
User = PhoneYes
Contact user+49301234567
From Domaintel.t-online.de
From User+49301234567
Client URI (empty)
Server URI (empty)
Media Address (empty)
AOR (empty)
AOR Contact (empty)
Match (Permit) (empty)
Support PathNo
Support T.38 UDPTLNo
T.38 UDPTL Error CorrectionNone
T.38 UDPTL NATNo
T.38 UDPTL MAXDATAGRAM (empty)
Fax DetectNo (unless this is your fax line, in which case you can set this to Yes)
Trust RPID/PAINo
Send RPID/PAINo
Send Private CallerID InformationNo
Match Inbound AuthenticationDefault
Inband ProgressYes
Direct MediaNo
Rewrite ContactYes
RTP SymmetricYes
Media EncryptionSRTP via in-SDP (recommended)
Force rportYes
Message Context (empty)

Codecs

Enable the following codecs and bring them in exactly this order:

  1. g722
  2. alaw
  3. ulaw
  4. gsm
  5. g726

Disable everything else.


Inbound Routes configuration

  1. Navigate to Connectivity > Inbound Routes
  2. Click on Add Inbound Route
  3. Configure the inbound route as follows:

General

SettingValue
DescriptionTelekom 0301234567 (or anything you like)
DID Number+49301234567 (international format)
CallerID Number (empty, defaults to ANY)
CID Priority RouteNo (only change if necessary and you know what you’re doing)
Alert InfoNone
Ringer Volume OverrideNone
CID name prefix (empty, unless you have multiple lines / trunks and need to be able to distinguish between them on your phone)
Music On HoldDefault (or any other playlist you have configured)
Set Destinationconfigure your inbound route destination here

Advanced

SettingValue
Indication Zone CountryDefault
Signal RINGINGNo
Reject Reverse ChargesNo
Force AnswerNo
Pause Before Answer (empty)

Privacy

Configure as necessary.

Fax

Configure as necessary in case you want to use one of your phone numbers as a fax line. In this case, the Fax Detect option for the respective trunk needs to be set to Yes (Trunk configuration > pjsip Settings > Advanced).

Other

Configure as necessary.


Outbound Routes configuration

  1. Navigate to Connectivity > Outbound Routes
  2. Click on Add Outbound Route
  3. Configure the outbound route as follows:

Route Settings

SettingValue
Route Namegive your route a name
Route CID (empty)
Override Extensionas necessary, default No
Route Passwordas necessary, default (empty)
Route Typeas necessary, default none selected
Music On Holdselect playlist as necessary or leave on default
Time Match Time ZoneUse System Timezone
Time Match Time Groupleave ---Permanent Route--- option, or change as necessary
Trunk Sequence for Matched Routesadd your previously configured trunk(s) here to be used for outbound call routing
Optional Destination on Congestionleave Normal Congestion, or change as necessary

Dial Patterns

If this is your default outbound route, the most basic outbound dial patterns would be as follows:

( prepend )prefix |[ match pattern /CallerID ]
+490ZX.
+00ZX.

Refer to the included documentation in FreePBX on how to configure the dial patterns for your specific use case.

Everything else

Configure Notifications and Additional Settings as necessary, or leave them on default values.