ChatGPT answer - in Asterisk to support two different ports, 5060 and 7060

ChatGPT answer - in Asterisk to support two different ports, 5060 and 7060

Realmagnum

Here's an example configuration for PJSIP in Asterisk to support two different ports, 5060 and 7060, for local phone clients on the 192.168.70.0/24 network:

  1. Open the configuration file for PJSIP, usually located at /etc/asterisk/pjsip.conf.
  2. Add the following at the beginning of the file to define a new transport called "udp-7060" on port 7060:
[udp-7060] 
type=transport 
protocol=udp 
bind=0.0.0.0:7060
  1. In the same file, define a new endpoint that uses the new transport and binds to the 192.168.70.0/24 network:
[local-phones-7060] 
type=endpoint 
transport=udp-7060 
context=from-internal 
disallow=all 
allow=ulaw 
aors=local-phones 
auth=local-phones 
rtp_symmetric=yes 
force_rport=yes 
rewrite_contact=yes 
use_avpf=yes 
media_encryption=no 
direct_media=no 
from_user=local-phones 
from_domain=192.168.70.0/24
  1. Add a new AOR (Address of Record) that uses the same contact as the default endpoint, but on port 7060:
[local-phones] 
type=aor 
contact=sip:192.168.70.0/24:7060
  1. Finally, add a new authentication object that matches the username and password of the local phone clients:
[local-phones] 
type=auth 
auth_type=userpass 
username=USERNAME 
password=PASSWORD

Make sure to replace USERNAME and PASSWORD with the actual username and password of the local phone clients.

Save the configuration file and reload Asterisk for the changes to take effect. After that, you should be able to access local phone clients on both ports 5060 and 7060 at the same time.


Report Page