No outgoing calls on FreePBX 17 with A1 (Austria)

Hi,

I’m expierincing some troubles with outgoing calls, I’m runnning FreePBX 17 on the newest Asterisk (21.4.2) on an Raspberry Pi 5.
When registrating my pjsip Trunk with A1 Telekom I can only receive incoming calls or make internal calls in between extensions. Outbound calls don’t work and are terminated with the message “All circuits are busy now, please try again later”.

Tbh I’m not that familiar with VoIP or PBX’s generally speaking, when putting the same user credentials directly into a SNOM D715 both In- and Outgoing calls worked perfectly, but due to some changes in the Fire Department we want to switch to a small scale pbx.

Thanks in advance for any tips / help

For the A1 trunk, set From User to the same value you have in Username and From Domain to the same value you have in SIP Server.

If you still have trouble, paste the Asterisk log for a failing call, with pjsip logger turned on, at pastebin.com and post the link here.

I set both From User and From Domain, sadly that didn’t change anything.

I uploaded the log to pastebin, link is: Logfile Freepbx SIP - Pastebin.com

Thanks in advance for any help

On line 231, A1 rejected the call before requesting authentication.
I suspect, based on

that they require the destination number to be formatted as +436769384863 rather than 06769384863. Change your Outbound Route (or the Dialed Number Manipulation Rules for the trunk) accordingly and retest. If no luck, possibly

is relevant for your account.

If you still have trouble, paste a new log.

So - I replaced the 0 with “+43”, that sadly didn’t solve the issue.

Regarding the second tip, honestly I’m not sure if I did everyting the right way.

I added the following to extensions_custom.conf via the configuration file editor:

exten => s,1,Noop(entering user defined context custom-sip-header in extensions_custom.conf)
exten => s,n,Set(HASH(__SIPHEADERS,P-Preferred-Identity)=sip:${CALLERID(number)}@siptrunk.a1.net)
exten => s,n,Return

I’m not sure if I should add something in the trunk options or where, all in all I start realising how little I know about the whole PBX / FreePBX stuff.

As always, thanks in advance for any suggestions / help

According to the article and the correction by @BlazeStudios , you should set
Asterisk Trunk Dial Options to b(custom-sip-headers^s^1)
You can check the Asterisk log for the custom dialplan running and the pjsip logger output to see if the header was correctly set.

For an alternate approach, see

If you still have trouble, paste a new log.

Changed the trunk dial option in the advanced settigs from “R” to “b”, also checked in the trunk I’m using, it uses the standart (b). Still the call fails. Log is uploaded under PJSIP Log - FreePBX Pastebin

Thanks in advance

Update:
Instead of using

exten => s,1,Noop(entering user defined context custom-sip-header in extensions_custom.conf)
exten => s,n,Set(HASH(__SIPHEADERS,P-Preferred-Identity)=sip:${CALLERID(number)}@siptrunk.a1.net)
exten => s,n,Return

I used the code from the first by @Stewart1 linked article, I modified it from Dial(…) to Return, so that FreepBX continues the call (I hope that was a somewhat intelligent move)

exten => _X.,1,Set(CALLERID(num)=+43225252122)
exten => _X.,2,Set(CALLERID(name)=+43225252122)
exten => _X.,3,Return

Either way, insetad of getting the normal “all circuits are busy” voice, I only get a “Decline” Displayed on the Phone.

Logs for the s,1… Option is already attached in my previous post, the new one is here:
https://pastebin.freepbx.org/view/3cc3a566

As always, thanks in advance and to everyone trying to help me

Something I missed earlier, that may be relevant: Line 240 or your first paste:
Via: SIP/2.0/TCP 188.21.107.182:5060;received=10.92.13.29;rport=50729;alias;branch=z9hG4bKPj3a2725ba-c596-4e05-a091-1a35a2e74401
Do you recognize the 10.92.13.29 private address? Do you know why/where the source port was rewritten from 5060 to 50729? Please explain your network setup. Do you have a separate router/firewall, in addition to an ISP-supplied router?

Regarding the latest paste, there is little more than a SIP trace; the steps performed by Asterisk are missing. By default the Asterisk log (in /var/log/asterisk/full) should have verbose entries. Did you turn these off, or get the log from the console or another source?

If it’s not hard to do, could you register a SNOM directly to A1 and post a SIP trace of a successful outgoing call? If so, we can compare it to what Asterisk is sending so we can see what is different and fix it.

As a matter of fact I do not recognise the 10.92.13.29 address, as the whole network is using 192.168.[1-2].xxx as a subnet, altough I do get a ping response in the commandline. However I am not able to open any webpage in my browser on that address. Also im quite suprised with the change to 50729. Port Forward on the firewall forwards ports 5060, 5160 and 10.000 to 20.000 to the Raspi / FreePBX.

The network setup is an A1 Router in Bridged mode, so the external IP of 188.21.107.182 is directly at the Fortigate 60C Firewall. Behind the Firewall there is one VLAN with IPv4 Adresses from 192.168.1.50 to 192.168.2.254.

When checking yesterday there was no “full” in /var/log/asterisk/, so I copied it from the asterisk CLI.

Registering a single SNOM phone with A1 is a matter of minutes, but tbh I’m lacking the knowledge of tracing the call with a SNOM Phone. I gathered the content from “SIP Protocol” here: SNOM Log - FreePBX Pastebin

As always, thanks for all the effort put into helping me :slight_smile:

Is

covered?

1 Like

The SNOM log tells us much:

  1. We don’t need P-Preferred-Identity, so you can take that out.
  2. Destination numbers starting with 0 are ok.
  3. Possibly, as @dicko noted, you need to use UDP transport. Why did you choose TCP?
  4. I suspect that user=phone tag is needed; try setting it to Yes.

To 1 and 2:
Okay so I’ll change the custom dial plan from b back to “R” and change the manipulation rules of the trunk back to “normal” with a leading zero being accepted. Also changed “Send RPID” to “no”

3: It was set to TCP by standard, changed it to utp 0.0.0.0

4: Enabled it both in the extension and on the trunk

Still no successs with outgoing calls.

Console output: One more log... - FreePBX Pastebin

On line 53 I saw two new errors, although the 403 Forbidden on line 114 is the same

Just saw something in the logs of the invite to A1

In the SNOM log there is this whole authentification block on line 19:

Authorization: Digest username="+43225252122",realm="[ip.10.92.13.29.siptrunk.a1.net](http://ip.10.92.13.29.siptrunk.a1.net/)",nonce="0a606db915b9",uri="sip:[[email protected]](mailto:[email protected]);user=phone",qop=auth,nc=00000002,cnonce="6f393c59",response="37ea54ea06073df7466158b47354f1aa",algorithm=MD5

In the FreePBX log it’s completely missing. Is there any option to “turn on” digest authentification?

Edit: it exists in the freepbx log, but username, realm, and uri are completely different. Seems as if freepbx tries to send the extensions user name as the user for authentification?

Finally solved it!

The last missing piece was adding +43225252122 not only as From User, but also as Contact User.

Big big thank you to all of you who spent their free time helping and advicing me in how it could probably work.

I’m glad that you got it working. I would have never guessed that. Contact User affects only the Contact header sent on a REGISTER request. Since that is what gets sent back in the URI on an incoming call, its normal use is to set the DID to match an Inbound Route.

But apparently A1 compares that value to the From (or perhaps Contact) header on an outgoing call attempt, I suppose as a security measure. This is unusual because most providers don’t even require registration to make calls (each call is separately authenticated).

We all learned from this, among other things that FF means Freiwillige Feuerwehr. I hope that you can safely put out the real fires more easily than this technical one.

Apparently A1 is doing some “funny” things regarding security measures.

Either way, we are definitely better at fighting fires than settung up PBX’s :slight_smile:

Once again, a giant thank you for your patience with my non-knowledge :confused:

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