首页 > 解决方案 > 如何修改FusionPBX/Freeswitch上的SIP绑定IP地址?

问题描述

我目前正在使用 PostgreSQL 在 CentOS 7 上运行 FusionPBX 4.4。

我用一个 IP 地址安装了系统,例如 192.168.201.201,现在想将系统移动到一个新的 IP 地址,例如 10.65.208.2。这是通过修改 /etc/sysconfig/network-scripts/ifcfg-enoX 中的设置来完成的,并且我已确保可以访问新的 IP 地址。

之后,通过在Advanced>Domains下将 domain 从旧值更改为新值来处理特定于域的配置。我可以登录系统(使用新的 IP 地址)而无需指定 admin@192.168.201.201。

但是,我目前的问题是我无法让 SIP 应用程序绑定到新的 IP 地址。如果我运行netstat检查绑定,只会找到 IPv6 地址。

[root@pbx ~]# netstat -an | grep 5060
tcp6       0      0 ::1:5060                :::*                    LISTEN
udp6       0      0 ::1:5060                :::***

如果我打开fs_cli并尝试评估存在的变量,似乎 Freeswitch 也已注册应该使用新的 IP 地址。

freeswitch@pbx.local> eval $${local_ip_v4}
10.65.208.2
freeswitch@pbx.local> eval $${external_sip_ip}
10.65.208.2
freeswitch@pbx.local> eval $${external_rtp_ip}
10.65.208.2
freeswitch@pbx.local>

尽管如此,/var/log/freeswitch/freeswitch.log仍然告诉我以下信息(请注意,它会尝试绑定到旧 IP 地址,这会导致错误):

2019-01-29 07:06:47.075924 [NOTICE] sofia.c:5949 Started Profile external [sofia_reg_external]
2019-01-29 07:06:47.075924 [DEBUG] sofia.c:3046 Creating agent for external
2019-01-29 07:06:47.075924 [ERR] sofia.c:3146 Error Creating SIP UA for profile: external (sip:mod_sofia@192.168.201.201:5080;maddr=192.168.201.201;transport=udp,tcp) ATTEMPT 1 (RETRY IN 5 SEC)
2019-01-29 07:06:47.075924 [INFO] switch_time.c:1423 Timezone reloaded 530 definitions
2019-01-29 07:06:52.075998 [ERR] sofia.c:3146 Error Creating SIP UA for profile: external (sip:mod_sofia@192.168.201.201:5080;maddr=192.168.201.201;transport=udp,tcp) ATTEMPT 2 (RETRY IN 5 SEC)
2019-01-29 07:06:57.076030 [ERR] sofia.c:3146 Error Creating SIP UA for profile: external (sip:mod_sofia@192.168.201.201:5080;maddr=192.168.201.201;transport=udp,tcp) ATTEMPT 3 (RETRY IN 5 SEC)
2019-01-29 07:06:57.076030 [ERR] sofia.c:3156 Error Creating SIP UA for profile: external (sip:mod_sofia@192.168.201.201:5080;maddr=192.168.201.201;transport=udp,tcp)
The likely causes for this are:
1) Another application is already listening on the specified address.
2) The IP the profile is attempting to bind to is not local to this system.

我只定义了一个网络接口(eno2)。安装期间使用的另一个界面已禁用。

[root@pbx freeswitch]# ifconfig
eno2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.65.208.2  netmask 255.255.254.0  broadcast 10.65.209.255
        inet6 fe80::21a:c7d6:cd98:5e88  prefixlen 64  scopeid 0x20<link>
        ether ac:1f:6b:73:7e:b5  txqueuelen 1000  (Ethernet)
        RX packets 23943  bytes 3534910 (3.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 71471  bytes 95115547 (90.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xf7c00000-f7c7ffff    
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 166592  bytes 48338476 (46.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 166592  bytes 48338476 (46.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

如果我启动 eno1 接口,并将 IP 地址设置为旧的(192.168.201.201),Freeswitch 不会给我任何错误,我可以绑定到旧地址。

freeswitch@pbx.local> sofia status                                                                 
                     Name          Type                                       Data      State      
=================================================================================================  
            external-ipv6       profile                   sip:mod_sofia@[::1]:5080      RUNNING (0)
                 external       profile         sip:mod_sofia@192.168.201.201:5080      RUNNING (0)
            internal-ipv6       profile                   sip:mod_sofia@[::1]:5060      RUNNING (0)
                 internal       profile         sip:mod_sofia@192.168.201.201:5060      RUNNING (0)
=================================================================================================  
4 profiles 0 aliases                                                                               

从 netstat 中,我们还可以看到 freeswitch 已经开始在旧 IP 地址上侦听 TCP/5060。

[root@pbx ~]# netstat -an | grep 5060                                     
tcp        0      0 192.168.201.201:5060    0.0.0.0:*               LISTEN
tcp6       0      0 ::1:5060                :::*                    LISTEN
udp        0      0 192.168.201.201:5060    0.0.0.0:*                     
udp6       0      0 ::1:5060                :::*                          

这引出了我的问题;

哪个变量用于绑定(即旧的 192.168.201.201 地址存储在哪里),如何修改它以便 FusionPBX/Freeswitch 了解使用哪个 IP 地址?

标签: sipvoipfreeswitchfusionpbx

解决方案


您应该能够在 Advanced>Variables 下更改 SIP_PROFILE ip 地址,具体取决于它最初的设置方式。


推荐阅读