Yesterday I upgraded a FreePBX and in the process also converted the remainder of the extensions to PJSIP. ChanSIP was running on port 5060 and PJSIP on 5062.
Once all extensions and Trunks were converted, I changed PJSIP to run on 5060 and ChanSIP on 5064.
Then, I wanted all extensions that were already on PJSIP to continue to work on 5062 (until they reprovision and use 5060), so I copied the
0.0.0.0-udp transport and created another transport in
[custom-pjsip-udp] type=transport protocol=udp bind=0.0.0.0:5062 external_media_address=75.99.XXX.XX external_signaling_address=75.99.XXX.XX allow_reload=yes tos=cs3 cos=3 local_net=192.168.1.0/24 local_net=10.10.14.0/24
I reloaded asterisk and
pjsip show transports showed both UDP transports. PJSIP extensions were now able to register to both, 5060 and 5062.
However, I noticed that for phones who registered on 5060, for whatever reason, Asterisk was sending OPTIONS --at least for phones behind NAT from port 5062. The phones did not reply to that which resulted in Asterisk to mark the endpoint as unreachable.
In other words, even if a phone registered on 5060, Asterisk sent OPTIONS from 5062.
In Extensions → Extension → Advanced, you can set the transport, by default it is ‘auto’, which means that there is no value for the transport parameter:
[root@freepbx ~]# asterisk -x"pjsip show endpoint 8013" | grep transp transport :
So I set that it should use the
0.0.0.0-udp and it started sending OPTIONS from 5060 to this extension.
At this point, most of the phones had reprovisioned and were registering on 5060, so I decided to just delete the
custom-pjsip-udp transport, hoping that all endpoints will now use the
However, after deleting and reloading, Asterisk still sent OPTIONS from 5062.
Only after a Asterisk restart is when Asterisk started to send OPTIONS from 5060.
Which brings me to ask the following questions:
- It seems that a “default” transport gets assigned to the endpoint if you don’t specify a transport. How can I define which transport should be the default?
- I was under the impression that when reloading Asterisk (
core reload) it will reload the transports as well. How come this required a restart to correct this?
P.S. The PBX is fully functioning now, this is to learn so I can understand how to do better in the future.