Use FreePBX with Vodafone IP-Anlagenanschluss (Germany)

I am currently having problems setting up an PBX for my father based on FreePBX. He got his Internet over a Router provided by the Provider (a Fritz!Box).
The Provider only provided (haha) me a SIP domain, a SBC IP, TCP-Transport, the corrosponding ports and the numbers.

I created the Trunk in PJSIP with the following configuration:

tech: PJSIP
Outbound-CID: [main number in international format
Max-Chans: 2
sip-server: xxxxxxx.ngn.vodafone.de (SIP domain provided by Vodafone)
SIP-Port: 5060
Transport: 0.0.0.0-TCP
Authentication: None
Registration: None
Language-Code: DE

Qualify-Freq: 0
Outbound-Proxy: [SBC-IP and port]
User-Phone: yes
ContactUser: [main number]
FromDomain: xxxxxxxxx.ngn.vodafone.de (SIP-Domain)
FromUser: [main number]
Match(Permit): xxxxx.ngn.vodafone.de,[SBC-IP]
Send RPID/PAI: both
RewriteContact: yes
Force rport: yes

Port 5060 TCP is forwared from the Fritz!Box to the FPBX Instance. Also Ports 10000-10254 UDP are forwarded for RTP.

The Trunk fails without any answer from the provider, at least from what I can see in the PJSIP-Debug Info in Asterisk Console.

It would be great if someone had an idea where the problem is, I already tried changing from-domain etc. but nothing worked out.
Thanks in Advance

Do you have a SIP trace and what are the error messages?

If you have a “trunk” (SIP doesn’t have trunks), i.e. a more costly product, why are you using a FritzBox and not a decent router?

It is a small site with only low network usage in just on network. It would be just too expensive and theres no real need.
I’m not 100% sure how you call it right in SIP-Context, but I get a Block of 100 phone numbers from the provider with 2 speech channels.
And we are using this product, because we had to keep the old numbers and they would only let us keep them, if we booked the whole block again.

Here is the SIP trace with the error messages. Like you can see, there is just no answer coming from the provider. Must be some misconfiguration, but I’m out of ideas, where I could look for mistakes and the instructions from the provider are, at least for me, not easily understandable.

SIP-Trace
<--- Received SIP request (1099 bytes) from TCP:109.90.XXX.XXX:45714 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/TCP 192.168.1.214;rport;branch=z9hG4bKtytfmnqu
Max-Forwards: 70
To: <sip:[email protected]>
From: <sip:[email protected]>;tag=itmle
Call-ID: [email protected]
CSeq: 653 INVITE
Contact: <sip:[email protected];transport=tcp>
Content-Type: application/sdp
Authorization: Digest username="255",realm="asterisk",nonce="1651171900/e09b4c3e990817ed8d69bdab99cff22a",uri="sip:[email protected]",response="6b26e8745c24eb090248c0b993f8342c",algorithm=md5,cnonce="895d314ccd",opaque="76ba25ca3affd8c7",qop=auth,nc=00000001
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE
Supported: replaces,norefersub,100rel
User-Agent: Twinkle/1.10.2
Content-Length: 310

v=0
o=twinkle 1455909498 97385712 IN IP4 192.168.1.214
s=-
c=IN IP4 192.168.1.214
t=0 0
m=audio 10000 RTP/AVP 98 97 8 0 3 101
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20

<--- Transmitting SIP response (304 bytes) to TCP:109.90.XXX.XXX:45714 --->
SIP/2.0 100 Trying
Via: SIP/2.0/TCP 192.168.1.214;rport=45714;received=109.90.XXX.XXX;branch=z9hG4bKtytfmnqu
Call-ID: [email protected]
From: <sip:[email protected]>;tag=itmle
To: <sip:[email protected]>
CSeq: 653 INVITE
Server: FPBX-15.0.23(16.17.0)
Content-Length:  0
[2022-04-28 20:51:42] ERROR[23138]: res_pjsip_header_funcs.c:410 remove_header: No headers had been previously added to this session.
<--- Transmitting SIP request (1301 bytes) to TCP:2.207.XXX.XXX:5060 --->
INVITE sip:2.207.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/TCP 192.168.178.123:5060;rport;branch=z9hG4bKPj30ce6c4a-43bb-4b93-9834-624629a9d6ad;alias
From: <sip:[email protected];user=phone>;tag=0dcdb685-099d-48d8-b3cc-eb856d97890b
To: <sip:[email protected];user=phone>
Contact: <sip:[email protected]:5060;transport=TCP>
Call-ID: 269746ed-6fe1-4542-bf3b-5d6c9566e277
CSeq: 15225 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: <sip:[email protected];user=phone>
Remote-Party-ID: <sip:[email protected];user=phone>;party=calling;privacy=off;screen=no
Route: <sip:[email protected]:5060;user=phone>
Max-Forwards: 70
User-Agent: FPBX-15.0.23(16.17.0)
Content-Type: application/sdp
Content-Length:   327

v=0
o=- 1789330385 1789330385 IN IP4 (null)
s=Asterisk
c=IN IP4 (null)
t=0 0
m=audio 10102 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Transmitting SIP response (564 bytes) to TCP:109.90.XXX.XXX:45714 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/TCP 192.168.1.214;rport=45714;received=109.90.XXX.XXX;branch=z9hG4bKtytfmnqu
Call-ID: [email protected]
From: <sip:[email protected]>;tag=itmle
To: <sip:[email protected]>;tag=b300f369-37b9-484b-a25c-24c0c668c86b
CSeq: 653 INVITE
Server: FPBX-15.0.23(16.17.0)
Contact: <sip:192.168.178.123:5060;transport=TCP>
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
P-Asserted-Identity: <sip:[email protected]>
Content-Length:  0


<--- Transmitting SIP response (878 bytes) to TCP:109.90.XXX.XXX:45714 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/TCP 192.168.1.214;rport=45714;received=109.90.XXX.XXX;branch=z9hG4bKtytfmnqu
Call-ID: [email protected]
From: <sip:[email protected]>;tag=itmle
To: <sip:[email protected]>;tag=b300f369-37b9-484b-a25c-24c0c668c86b
CSeq: 653 INVITE
Server: FPBX-15.0.23(16.17.0)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Contact: <sip:192.168.178.123:5060;transport=TCP>
P-Asserted-Identity: <sip:[email protected]>
Content-Type: application/sdp
Content-Length:   270

v=0
o=- 1455909498 97385714 IN IP4 (null)
s=Asterisk
c=IN IP4 (null)
t=0 0
m=audio 10250 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<--- Transmitting SIP response (550 bytes) to TCP:109.90.XXX.XXX:45714 --->
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/TCP 192.168.1.XXX;rport=45714;received=109.90.XXX.XXX;branch=z9hG4bKtytfmnqu
Call-ID: [email protected]
From: <sip:[email protected]>;tag=itmle
To: <sip:[email protected]>;tag=b300f369-37b9-484b-a25c-24c0c668c86b
CSeq: 653 INVITE
Server: FPBX-15.0.23(16.17.0)
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Reason: Q.850;cause=34
P-Asserted-Identity: <sip:[email protected]>
Content-Length:  0


<--- Received SIP request (624 bytes) from TCP:109.90.XXX.XXX:45714 --->
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/TCP 192.168.1.214;rport;branch=z9hG4bKtytfmnqu
Max-Forwards: 70
To: <sip:[email protected]>;tag=b300f369-37b9-484b-a25c-24c0c668c86b
From: <sip:[email protected]>;tag=itmle
Call-ID: [email protected]
CSeq: 653 ACK
Authorization: Digest username="255",realm="asterisk",nonce="1651171900/e09b4c3e990817ed8d69bdab99cff22a",uri="sip:[email protected]",response="6b26e8745c24eb090248c0b993f8342c",algorithm=md5,cnonce="895d314ccd",opaque="76ba25ca3affd8c7",qop=auth,nc=00000001
User-Agent: Twinkle/1.10.2
Content-Length: 0

Don’t be confused, i am connected to the PBX from a remote location which is the IP with 109.90.XXX.XXX. The outgoing number has a leading zero as we wanted to keep the same functionality as with the old PBX which was based on ISDN / S0-Bus.

The machine seems to be unable to find its own address. (null) should be the IP address. Maybe you need a /etc/hosts entry that matches the machine’s own host name?

Note this problem is present on the A side of the call and the call was aborted before a response was received on the B side.

You were at least partially right, there was no host entry with the IP-Adress. Added

192.168.178.123 pbx-treu-immo.fritz.box

Also checked the freepbx network settings again. Now the SIP Request looks like this:

[2022-04-28 22:32:48] ERROR[2762]: res_pjsip_header_funcs.c:410 remove_header: No headers had been previously added to this session.
<--- Transmitting SIP request (1195 bytes) to TCP:2.207.XXX.XXX:5060 --->
INVITE sip:2.207.XXX.XXX:5060 SIP/2.0
Via: SIP/2.0/TCP 178.13.XXX.XXX:5060;rport;branch=z9hG4bKPj2448be0b-aa0c-433b-a815-df82b1c870a6;alias
From: <sip:[email protected];user=phone>;tag=b16b10b3-2a90-4769-9ce2-80c87a2da2d3
To: <sip:[email protected];user=phone>
Contact: <sip:[email protected]:5060;transport=TCP>
Call-ID: 3bfafeb6-203d-405d-9b03-e80520340a19
CSeq: 7068 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: <sip:[email protected];user=phone>
Route: <sip:[email protected]:5060;user=phone>
Max-Forwards: 70
User-Agent: FPBX-15.0.23(16.17.0)
Content-Type: application/sdp
Content-Length:   343

v=0
o=- 1374326817 1374326817 IN IP4 178.13.XXX.XXX
s=Asterisk
c=IN IP4 178.13.XXX.XXX
t=0 0
m=audio 10022 RTP/AVP 0 8 3 111 9 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:111 G726-32/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

Still there is no response from the provider.
What was interesting, when i configured it completely from scratch and forgot to set transport from udp to tcp, i was getting an 403 forbidden error. With TCP no response.
The provider explicitely told me to use TCP, i guess that is why i was getting an forbidden error. But I can’t fully understand, why I am getting nothing with TCP.

If cost is a factor, why are you not using the little PBX inside the FritzBox? There’s a reason why I am saying that, because we don’t know how Fritz interferes with the SIP packets. We don’t even know your network topology, which sometimes could makte certain settings inside the PBX and/or the router necessary.

That said, Vodafone SIP accounts are pretty much standard and actually super simple to configure, provided one has read their “Schnittstellenbeschreibung”.

Does telephony work when you configure everything inside the Fritz? I think the box has limited abilities to generate pcap traces which would allow you to figure out what is actually needed.

Thanks on your input on how I could have done it, but there are several reasons why I am using freepbx.
Network Topology is quite simple:

Vodafone<------- DSL 100 ------->Fritz!Box<----- LAN 1GBit ---->FreePBX

I read the Schnittstellenbeschreibung, but sadly it wasn’t as clear for me as it is for you. But as you seem to have some experience with this, could you maybe look over my configuration and tell me, if it fits the Schnittstellenbeschreibung?
I honestly never tried to configure it inside the Fritz, but if you think it can help finding the problem, i could try it out.

If your PBX is in a LAN behind a router, then you have to deal with NAT related issues. Sometimes everything is just fine and you don’t have to adjust anything. That depends on how things are handled upstream, the behavior of the router, the firewall of the PBX, and the PBX itself.

In order to give an idea what you have to consider, this older video might be helpful: Firewall Best Practices for VoIP on pfSense - YouTube

The video is about pfSense, but the principles apply to every router. Professional routers allow these settings and have proper tools on board to analyse the traffic. I am not familiar with consumer products like Fritz, so the usefulness of any advice would always be limited. Don’t expect too many people here to be familiar with the inner workings of a product that is mainly sold in one country.

That said, I think there are some recipes in a German forum that describe how to use the FritzBox as a VoIP gateway. In that case you don’t have to worry about the Vodafone settings.

Please note: As long as you have external phone numbers green lighted in your FritzBox, the box will catch all returns from requests which have been sent out from the PBX.
Either you make your trunks throught the FritzBox to the provider !and! disable all trunks in your FB, or
let your FB connect to the provider as it is and direct your trunks to the fritzbox (192.168.178.1). Second solution is a little tricky, since the FB does not forward the extension. You need to configure one trunk per one extension like you would do for ip-phones directly connected to the FB. In addition FB extensions can not be named with 620.621 and so on, as it is often stated. They need 8 digit names and pw different from the name.

Tried to let the FB connect to the provider but still got a timeout. I guess I’ll ask Vodafone for help, hoping they have some experience with this kind of setup. I mean they gave us the FB with the contract in exact knowledge of how we want to setup our PBX and which software we want to use.

I would be interested in the trunks-setup after Vodafones help. This might be very special, since I think your FB is a cable-Version. Anyway, keep in mind: The Fritz reacts quite super-strange on wrong client connects (here: wrong user / pw from your pbx trunk). This is not similar to wrong connects on the FB web-interface, where simple login time is increasing and login-wait time is shown.
For client connects FB silently blocks clients without saying anything in the eventlogs. Where only a restart of the FB can help, and in addition an unknown portion of elapsed time. So, be very exact on any mistypings of usernames and passwords. It will take you otherwords days of waiting until client IP (PBX) may be able to login again.
Which kind of “on-premise” hardware are you using with the FreePBX distro?
Don’t they offer a cloud solution, too?

In addition: your PBX-log above look like your trunk has an public IP from vodafone, and not an internal IP from your FB. Therefore the answers in the log shoud come from the FB and not from 178.13.x.x
It looks more than an direct connect between the PBX and the provider througt the FB, than an internal connect between FB and PBX. Therefore your PBX request an connect, and your FB receives the answer as long as phone-numbers are green lighted in your FB. The PBX is not receiving any answer, because the FB catches theses answers first.

Is there any way of preventing thie FB of doing that? And sorry if it wasnt clear, i am trying to connect directly to the provider.

Well, talked with Vodafone today, the error was on their side. When they fixed their configuration, everything worked just fine and I had no Problems.
It also wasn’t the FB filtering the packets, I even set it up to register two Phones at the FPBX and everything still works.

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