Get help with installing, upgrading and running a PBX such as Asterisk.
50 % 50 %
User avatar
By @UKVoIPForums
Posts Likes Avatar Topics
#5825
With Asterisk and FreePBX moving closer to the removal of chan_sip I decided to make the switch myself. Below is a copy of my Voipfone PJSIP settings that I configured a few days ago with FreePBX 13.0.197.22 and so far so good. :nerd:

First thing you will need to do is enable the "SIP Channel Driver" to use both chan_sip and chan_pjsip. You can do that by navigating to the Settings > Advanced Settings configuration page and scrolling down until you see the "SIP Channel Driver" setting. Make sure that "both" is selected in the dropdown box. If it isn't, make the change and click "Submit" to save it and then "Apply Changes" to implement it.

Now that's out of the way, let's create a Voipfone PJSIP Trunk...
  1. Navigate to Connectivity > Trunks > + Add Trunk > Add SIP (chan_pjsip) Trunk page.
    You should be at the following screen:
    Image
  2. Under the "General" tab section make the following changes:
    • Trunk Name = Voipfone-(ACCOUNT_NUMBER)
    • Outbound CallerID = (PHONE_NUMBER)
    It should look something like this:
    Image
  3. Click on the "pjsip Settings" tab and in the "General" tab section make the following changes:
    • Username = (ACCOUNT_NUMBER)
    • Secret = (ACCOUNT_PASSWORD)
    • Authentication = Outbound
    • Registration = Send
    • Language Code = English - United Kingdom
    • SIP Server = sip.voipfone.net
    • SIP Server Port = 5060
    • Context = from-pstn
    • Transport = 0.0.0.0-udp
    Again, it should look like this:
    Image
  4. While still in the "pjsip Settings" tab click on the "Advanced" tab and make the following changes:
    • Forbidden Retry Interval = 20
    • Fatal Retry Interval = 20
    • General Retry Interval = 20
    • Expiration = 60
    • Qualify Frequency = 20
    • Contact User = (ACCOUNT_NUMBER)
    • From Domain = (YOUR_IP)
    • From User = (ACCOUNT_NUMBER)
    • Client URI = sip:(ACCOUNT_NUMBER)@sip.voipfone.net:5060
    • Server URI = sip:sip.voipfone.net:5060
    • AOR Contact = sip:(ACCOUNT_NUMBER)@sip.voipfone.net:5060
    • Match (Permit) = sip.voipfone.net
    You can leave the rest at their defaults.
    Image
  5. Finally click on the "Submit" button to save your changes and then "Apply Changes" to implement them.

Additional information on how to convert extensions from chan_sip to chan_pjsip can be read here: WelshPaul @ FREEPBX - New tool to assist converting from SIP to PJSIP


NOTE: Replace the following (in the above configuration) with your real Voipfone credentials:
  1. (ACCOUNT_NUMBER) = Your Voipfone account number (the 8-digit number starting with 3) followed by star and your 3-digit extension number.
  2. (ACCOUNT_PASSWORD) = Your Voipfone extension account password. Passwords for all your extensions can be found in your Control Panel.
  3. (YOUR_IP) = Your IP Address (Find it here: Settings > Asterisk SIP Settings > NAT Settings > External Address)
ostridge, NerdUno liked this
1
0
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
#5980
Hi @nasarz, PJSIP trunk configuration for a UK Sipgate Basic account can be found here: WelshPaul @ Sipgate Basic PJSIP Trunk Configuration (FreePBX)
0
User avatar
By TonyRogers
Posts Likes Avatar
#6051
Re. Voipfone and PJSIP.

Hi there. Thanks for your detailed howto. I'm a VOIP noob, although we've been running PBX in a flash for several years on a RasPi.

Currently setting up a new FreePBX instance for use with Voipfone, and am struggling with Trunk authentication using PJSIP. SIP works fine, but I was trying to move forwards!

It's *probably* the username bit with the '*extension' appended to it. We do not have any extensions at Voipfone, so am unclear whether this is a show stopper, or we should be using the extensions on our FreePBX instance (these are currently single digits, and am unclear whether this is an issue or not).

Any clues/hints would be welcome.
0
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
#6052
Hi Tony,

If you do not have any Voipfone extensions then just enter your Voipfone account number (the 8-digit number starting with 3) and ignore the star and your 3-digit extension number.

Still unable to get the trunk to register? Try leaving the "Match (Permit)" field empty! If you still cannot get the trunk to register at this point and you haven't altered any other settings (they should be default) then its something else causing the issue.

To view registration status, navigate to:
Reports > Asterisk Info > Registries

Here is the status of my PJSIP trunks that are configured as above:
Image

Regarding your FreePBX extensions that are configured to use a single digit, use three or four digit extensions.
0
User avatar
By TonyRogers
Posts Likes Avatar
#6057
Cheers. That gives me a bit to go on. Voipfone support emailed me yesterday to say they didn't support PJSIP. *update* they've just had a go, following your instructions with a FreePBX install and say it works! They now want to exchange screen shots!
ostridge liked this
0
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
#6058
Of course it works! 😆

The reason why I told you to leave the "Match (Permit)" field empty is because entering an incorrect IP address here can prevent a successful registration. Did you try this? If your server still won't register then you need to look at your servers configuration, firewall and NAT settings...
  1. Have you looked at the server logs and if so what do they report?
  2. Is this setup on a Raspberry PI (RasPBX)?
  3. What is SIP Channel Driver configured to use on your server? (Settings > Advanced Settings)
  4. What port is your server using for PJSIP?
If your not using chan_sip then set SIP Channel Driver to use chan_pjsip and set the PJSIP Port to Listen On to use 5060. You must restart Asterisk for port binding changes to take effect:
Code: Select all
fwconsole restart
0
User avatar
By TonyRogers
Posts Likes Avatar
#6062
I'm registered OK now!

Don't shout, but I'm running in a docker container. Seems to work OK.

Just trying to get audio working now. Outbound audio doesn't seem to work, but incoming does. Probably a firewall thing.

SIP channel driver is 'both'.

PJSIP is on 5060.

Many thanks.
0
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
#6063
While not related, Voipfone use the following codecs:
  • alaw
  • g726
  • ilbc
  • gsm
  • speex
You should configure the trunk as follows:
Image

What are your RTP Port Ranges and have you whitelisted them in your firewall?
Settings > Asterisk Sip Settings > RTP Port Ranges

To test, dial *43 and run an Echo test. If that works, dial 152 and run a Voipfone Echo test.

*43 will test audio between an endpoint (VoIP Phone / Softphone) and your FreePBX server (Endpoint > FreePBX). 152 will test audio between an endpoint and the Voipfone server (Endpoint > FreePBX > Voipfone).
0
User avatar
By andrewdbate
Posts Likes Avatar
#6471
I have used the configuration provided in the first post above with FreePBX 15 (SNG7-PBX-64bit-2104) together with the supported codecs posted above and it works for me.

One minor change that I made is that I left "From Domain" blank because I do not have a static IP address (the IP provided by my ISP is often changing). However, leaving this field blank seems to work just fine.

Thanks!
0
User avatar
By andrewdbate
Posts Likes Avatar
#6484
andrewdbate wrote: Thu 24th Feb 2022, 00:38 I have used the configuration provided in the first post above with FreePBX 15 (SNG7-PBX-64bit-2104) together with the supported codecs posted above and it works for me.

One minor change that I made is that I left "From Domain" blank because I do not have a static IP address (the IP provided by my ISP is often changing). However, leaving this field blank seems to work just fine.

Thanks!
It turns out that my earlier comment was incorrect. You do need to add your IP address to "From Domain" otherwise your calls will be silent.

However, because I do not have a static IP address, I cannot just enter my current IP address into "From Domain". That works for making a test call, but when my IP address changes it will break.

Any suggests for what to do when the public IP address is dynamic? Thanks!
0
User avatar
By andrewdbate
Posts Likes Avatar
#6485
A further update in case anyone else is struggling with FreePBX + Voipfone + chan_pjsip.

So it turns out that "From Domain" can indeed be left blank provided you go to Settings > Asterisk SIP Settings > General SIP Settings > NAT Settings and set the External Address to your external IP address. You can click the button "Detect Network Settings" to populate this field.

I think this was why I first posted that "From Domain" could be left blank, and then thought I had made a mistake.

Though trial and error, I have discovered that if Settings > Asterisk SIP Settings > General SIP Settings > NAT Settings > External Address is an incorrect IP address but "From Domain" is correct, then everything seems to work as expected. So be careful, because you could easily get confused as I did.

However, this does not solve the question of what to do if you have a dynamic IP address.
0
User avatar
By @UKVoIPForums
Posts Likes Avatar Topics
#6486
The lack of audio would have been NAT related as you have already discovered...

Leave the "From Domain" field empty and the PBX will automatically apply your current IP address to the "From Domain" header. Probably the best option if you don't have a static IP.
(FYI - You can enter a domain name if you prefer.)
NerdUno liked this
0
User avatar
By andrewdbate
Posts Likes Avatar
#6487
Okay, so I've figured it out how to configure it when your external IP address is dynamic and you want to use PJSIP.

Because I had got somewhat confused (possibly because of old configuration left behind), I decided to go back to a stock FreePBX install and retrace my steps.

I followed the steps posted above but left the "From Domain" blank.

At this point, I had no audio at all on my extension.

Now go to Settings > Asterisk SIP Settings > General SIP Settings > NAT Settings > Local Networks and enter the local network to be used by NAT. By default (i.e., after FreePBX install) this field is blank. In my case I entered 192.168.0.0/24.

Here is a screenshot:
Image

Note that I did not press "Detect Network Settings" nor did I change the value of the External Address field. This is set to whatever value it got during installation (which is not my IP address, and does not appear to even be an IP address is my country).

After setting the Local Networks (ringed in red in the screenshot) the audio problem was fixed.
NerdUno liked this
0
User avatar
By WelshPaul
Posts Signature Likes Avatar Topics
#6488
The External Address field should contain your static IP (I know, you don't have one) and Local Network field should contain your local networks IP (e.g., 192.168.0.0/24 or 192.168.1.0/24).

You're screenshot shows an External IP address of 102.145.xx.xxx which is located in Zambia? If this isn't your IP remove it! In fact, you should look into how that IP was detected in the first place. 🤔

So, to clarify, the "External IP" address of 102.145.xx.xxx should be replaced with your dynamic external IP address.
(You can find out you're current IP here: https://www.whatsmyip.org)

The problem with a dynamic IP address is that it will change and when it does the PBX will be configured to use the old IP and that's when you run into issue! You really need a static IP or go with an ISP where the dynamic IP address doesn't change on a regular basis such as Virgin Media.
NerdUno liked this
0

Ok, so the next instalment......... I loaded the Grand…

Apologies I do not have an answer but could you please …

Have you tried simply modifying the " ext &…

FreePBX and MS Teams

Hi @nwphoto , I Have responded to your private messa…

Sign up for VIP membership