VoIP Phones - FreePBX
- There is an older guide if you are using chan_sip: VoIP Phones - FreePBX - chan sip
Setting up a A&A ipv6 trunk using pjsip via the Freepbx GUI
This guide works with Freepbx 188.8.131.52. Earlier versions may not work. Version 13 will certainly not work.
Setting up the trunk on the A&A control pages
The key to success is that you _*MUST*_ use the same password for both the incoming and outgoing directions, and for the "To your server by sip" entry on the incoming page. If you do not do this you will find yourself in a bottomless pit of pain.
Adding the neccessary additional conf files
You cannot yet add a pjsip IPV6 transport via the Freepbx gui. So some custom config files are needed. These are as shown below. You will have to tweak the endpoint section name and the bind parameter in the tranport section for your setup.
[anonymous](+) ; ; Fix bug in freepbx automatically generated anonymous endpoint ; transport=ipv6-udp ; ; The section name below must exactly match the endpoint name you ; use in the Freepbx GUI. [AAPJSIP](+) transport=ipv6-udp
; Set the bind parameter to the address (and port) ; you want the trunk to listen on. I tend to use ; a global ipv6 address out of my delegated block ; and a random port number as this makes it harder ; for scanners and easier to configure my firewall. ; Remember to set the server address in the "To your server" ; section in the A&A control pages to match this. [ipv6-udp] type=transport protocol=udp bind=[2001:8b0:xxxx:xxxx::x]:xxxx allow_reload=no tos=cs3 cos=3
Adding an IPV6 trunk via the Freepbx GUI
Create the new trunk as a normal ipv4 udp trunk using pjsip. On the general tab the "Trunk name" must match the section name you used in the conf files above.
Moving on to the pjsip settings. On the General tab the username should be set to the username portion onlyof your A&A sip uri e.g. +443333123456 and the secret to match the one you have used three times on the A&A control pages. Authentication must be set to Outbound only. Regsitration must be set to None. SIP Server should be voiceless.aa.net.uk. SIP Server Port shouid be 5060. Context must _*NOT*_ be left at from-pstn and _*MUST*_ be set to from-trunk-pjsip-yourtrunkname where yourtrunkname is the name you have given to this trunk. Another bottomless pit of pain awaits if you do not do this. On the Advanced tab Match must be set to something like [2001:8b0:0:30::5060:0]/125 this should allow all of the current servers to contact you.
Do to some horrendous interactions between the Freepbx dialplan customisation method and the new "Asterisk Sorcery" caching database used by pjsip, it is essential that you fully restart the asterisk server, either by rebooting your box or by using systemd etc.