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.
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
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.
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
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)
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
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
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?
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.