Telekom outbound routes 3 Lines [Solved]

Hello, I am brand new here and unfortunately a freePBX newbie :-/

And I have a problem right away:
I have 3 phone numbers from Telekom (All-IP) and all are registered with pjsip.
Incoming calls are correctly transferred.
My problem is that outgoing calls are always used by the first line.

Simple example:
User 520 should use line 035xxxx520
User 202 should use line 035xxxxxx202
User 244 should use line 035xxxxxx244

No matter what I could find in the forum, no way worked.

What I have tried is:
Set Outbound CID at Outbund Route “<035xxxxxx520” - no success.
The same applies to the other connections.

The first trunk is always used as the outbound route.

Can someone please show me what I have to do?
Preferably pictures of where I have to set what.

Each line should connect outgoing calls normally.

Of course “Trunk Sequence for Matched Routes” are set correctly.

I hope someone can help me to get the telephony working again.

Best regards

I think you’re confusing trunks and outbound routes.

The trunk in the connection to the provider. You can have any number of DID’s (phone numbers) on a single trunk.

To have a specific internal extension display a specific caller ID to the outside world you need to set that Caller ID on the extension and then make sure the outbound route does not override the extension caller ID.


you will need to use the commercial module Endpoint Routing that will allow you to create separate outbound routes for each phone number and assign which extensions should use those routes. In that case you should set the outbound routes to override the extensions CallerID setting with it’s own.

It’s pretty simple to achieve what you want to do (I’m even handling four All-IP numbers like this).

User 520 should use line 035xxxx520
User 202 should use line 035xxxxxx202
User 244 should use line 035xxxxxx244

How to do it? Example User 520:

User 520 places an outbound call and uses CID 520. On base of this CID, you can add an outbound route, which matches to the CID 250 (it’s the fourth column of the Dial patterns tab). You have to take care, that a match of the route is possible by defining a reasonable entry in the third column - something like 0XXXXXX. e.g. (this expects you to dial always the numbers with prefix, like 0891234567).

On the tab “Routen Einstellungen”, you define trunks (Hauptleitungen) to be used for this route (here: 035xxxx520).

It is very important, that you create a correct destination number, which is given to the trunk and lastly to Telekom. If it’s wrong, Telekom won’t handle it. Telekom expects E.164 format, e.g. +49891234567. Therefore you have to take care, that you always create correct E.164 numbers. This means, you have to handle dialed numbers like 089… (for Munich e.g.) and rewrite it to +4989… or 4989… to +4989 or 0089… to +4989… or dialed numbers without any prefix: you have to add your local prefix 89 e.g. (those could be detected by the length of the dialed number).

Doing these number manipulations is possible in the outbound route and in the trunk. I’m configuring the trunks exactly the same way regarding number manipulation - they expect always the same format to be presented as input.

The trunk itself is the instance which creates the connect to the provider.

To check what is sent to the provider, you can enable SIP trace in asterisk:
asterisk -x “pjsip set logger on”
asterisk -x “pjsip set logger verbose off”
asterisk -x “pjsip set logger pcap trace.pcap”

Probably in /var/lib/asterisk/ you’re finding a trace.pcap file, which can be evaluated with wireshark. Be careful: you have to repeat the trace.pcap activation each time you reload asterisk - means each time, you activate changes in FreePBX.

Great! Thank you! :slight_smile:
This is the solution!

It Works an many thanks!!!

Have a nice Day and stay healthy!

Best regards

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.