Linphone:无法在端口 5060 上启动 tls 传输,也许该端口已被使用?

Linphone:无法在端口 5060 上启动 tls 传输,也许该端口已被使用?

更新:

可能是由于 NAT,尽管这可能是 Ekiga 特有的问题。

我在这台机器上尝试了多个客户端,但无法让任何 SIP 客户端为我工作。在同一网络上,Android 平板电脑可以呼叫IP 电话没问题,使用免费 SIP 帐户。此外,IP 电话 SPA 942 可以与 anveo 配合使用。硬电话与免费 Anveo 帐户配合使用效果很好,因此我升级到付费服务(每月 5 美元左右?)。


为什么 linphone 报告端口 5060 正在使用中?

thufir@doge:~$ 
thufir@doge:~$ sudo netstat -peanut
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      0          24006       2764/dnsmasq    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          27787       2336/sshd       
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      0          121080      9291/cupsd      
tcp        0      0 0.0.0.0:119             0.0.0.0:*               LISTEN      0          19800       2117/inetd      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          22477       2600/sendmail: MTA:
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      0          22478       2600/sendmail: MTA:
tcp        0      0 192.168.1.4:57926       104.20.60.241:80        TIME_WAIT   0          0           -               
tcp        0      0 192.168.1.4:60302       104.20.59.241:80        ESTABLISHED 1000       123617      9759/firefox    
tcp        0      0 192.168.1.4:59140       173.194.202.108:993     ESTABLISHED 1003       42919       4757/alpine     
tcp        0      0 192.168.1.4:32832       216.58.194.202:80       ESTABLISHED 1000       123738      9759/firefox    
tcp        0      0 192.168.1.4:57924       104.20.60.241:80        TIME_WAIT   0          0           -               
tcp        0      0 192.168.1.4:49692       35.165.39.15:443        ESTABLISHED 1000       123774      9759/firefox    
tcp        0      0 192.168.1.4:34044       173.194.203.108:993     ESTABLISHED 1000       61100       7178/alpine     
tcp        0      0 192.168.1.4:57922       104.20.60.241:80        TIME_WAIT   0          0           -               
tcp        0      0 192.168.1.4:48654       199.96.57.6:443         ESTABLISHED 1000       123739      9759/firefox    
tcp        0      0 192.168.1.4:57320       216.58.192.14:443       ESTABLISHED 1000       123765      9759/firefox    
tcp        0      0 192.168.1.4:39708       74.125.28.109:993       ESTABLISHED 1000       117469      7178/alpine     
tcp        0      0 192.168.1.4:57930       104.20.60.241:80        TIME_WAIT   0          0           -               
tcp        0      0 192.168.1.4:59144       173.194.202.108:993     ESTABLISHED 1003       42929       4757/alpine     
tcp        0      0 192.168.1.4:45048       72.21.91.29:80          ESTABLISHED 1000       126693      9759/firefox    
tcp        0      0 192.168.1.4:32772       173.194.202.108:993     ESTABLISHED 1000       60713       7178/alpine     
tcp        0      0 192.168.1.4:57326       216.58.192.14:443       TIME_WAIT   0          0           -               
tcp        0      0 192.168.1.4:49188       216.58.192.14:80        ESTABLISHED 1000       123770      9759/firefox    
tcp        0      0 192.168.1.4:41466       74.125.28.108:993       ESTABLISHED 1000       117366      7178/alpine     
tcp        0      0 192.168.1.4:45530       52.27.92.252:443        ESTABLISHED 1000       126723      9759/firefox    
tcp        0      0 192.168.1.4:55378       202.81.252.44:119       ESTABLISHED 9          117373      8590/fetchnews  
tcp        0      0 192.168.1.4:57928       104.20.60.241:80        TIME_WAIT   0          0           -               
tcp6       0      0 :::22                   :::*                    LISTEN      0          27789       2336/sshd       
tcp6       0      0 ::1:631                 :::*                    LISTEN      0          121079      9291/cupsd      
udp        0      0 0.0.0.0:38810           0.0.0.0:*                           111        19008       2200/avahi-daemon: 
udp        0      0 127.0.1.1:53            0.0.0.0:*                           0          24005       2764/dnsmasq    
udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          26745       3432/dhclient   
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           111        19006       2200/avahi-daemon: 
udp        0      0 0.0.0.0:631             0.0.0.0:*                           0          20616       2279/cups-browsed
udp6       0      0 :::43979                :::*                                111        19009       2200/avahi-daemon: 
udp6       0      0 :::5353                 :::*                                111        19007       2200/avahi-daemon: 
thufir@doge:~$ 
thufir@doge:~$ lsof -i -n -P | grep 5060
thufir@doge:~$ 
thufir@doge:~$ lsof -i :5060
thufir@doge:~$ 

截屏:

端口 5060 正在使用中

调试窗口:

message: Using (r/w) config information from .linphonerc
message: Initializing LinphoneCore 3.6.1
message: oRTP-0.22.0 initialized.
message: assigning PCMU/8000 payload type number 0
message: assigning GSM/8000 payload type number 3
message: assigning PCMA/8000 payload type number 8
message: assigning speex/8000 payload type number 110
message: assigning speex/16000 payload type number 111
message: assigning speex/32000 payload type number 112
message: assigning telephone-event/8000 payload type number 101
message: assigning G722/8000 payload type number 9
message: assigning H263/90000 payload type number 34
message: assigning theora/90000 payload type number 97
message: assigning H263-1998/90000 payload type number 98
message: assigning MP4V-ES/90000 payload type number 99
message: assigning H264/90000 payload type number 102
message: assigning VP8/90000 payload type number 103
message: assigning x-snow/90000 payload type number 96
message: assigning iLBC/8000 payload type number 100
message: assigning AMR/8000 payload type number 104
message: assigning AMR-WB/16000 payload type number 105
message: assigning 1015/8000 payload type number 106
message: assigning G726-16/8000 payload type number 107
message: assigning G726-24/8000 payload type number 108
message: assigning G726-32/8000 payload type number 109
message: assigning G726-40/8000 payload type number 113
message: assigning AAL2-G726-16/8000 payload type number 114
message: assigning AAL2-G726-24/8000 payload type number 115
message: assigning AAL2-G726-32/8000 payload type number 116
message: assigning AAL2-G726-40/8000 payload type number 117
message: assigning SILK/8000 payload type number 118
message: assigning SILK/12000 payload type number 119
message: assigning SILK/16000 payload type number 120
message: assigning SILK/24000 payload type number 121
message: assigning G729/8000 payload type number 18
message: assigning mpeg4-generic/22050 payload type number 122
message: assigning mpeg4-generic/44100 payload type number 123
message: assigning opus/48000 payload type number 124
message: assigning 1016/8000 payload type number 1
message: assigning GSM/8000 payload type number 3
message: assigning G723/8000 payload type number 4
message: assigning LPC/8000 payload type number 7
message: assigning PCMA/8000 payload type number 8
message: assigning G722/8000 payload type number 9
message: assigning L16/44100 payload type number 10
message: assigning L16/44100 payload type number 11
message: assigning G729/8000 payload type number 18
message: assigning H261/90000 payload type number 31
message: assigning MPV/90000 payload type number 32
message: assigning H263/90000 payload type number 34
message: Mediastreamer2 2.9.1 (git: 2.9.0-7-g51d3c20) starting.
message: ms_base_init() done
message: Registering all soundcard handlers
message: Card 'ALSA: default device' added
warning: Could not attach mixer to card: Invalid argument
warning: Strange, sound card HDA Intel does not seems to be capable of anything, retrying with plughw...
message: Card 'ALSA: HDA Intel' added
message: Card 'PulseAudio: default' added
message: New PulseAudio context state: PA_CONTEXT_CONNECTING
message: Registering all webcam handlers
message: Webcam StaticImage: Static picture added
message: New PulseAudio context state: PA_CONTEXT_AUTHORIZING
message: New PulseAudio context state: PA_CONTEXT_SETTING_NAME
message: New PulseAudio context state: PA_CONTEXT_READY
message: ms_voip_init() done
message: Loading ms plugins from [/usr/lib/x86_64-linux-gnu/mediastreamer/plugins]
message: Cannot open directory /usr/lib/x86_64-linux-gnu/mediastreamer/plugins: No such file or directory
message: Cannot open directory /usr/lib/liblinphone/plugins: No such file or directory
message: linphone_core_set_playback_gain_db(): no active call.
message: linphone_core_set_mic_gain_db(): no active call.
message: MTU is supposed to be 1300, rtp payload max size will be 1240
message: Could not find encoder for 1016
message: Could not find decoder for 1016
message: Could not find encoder for GSM
message: Could not find decoder for GSM
message: Could not find encoder for G723
message: Could not find decoder for G723
message: Could not find encoder for LPC
message: Could not find decoder for LPC
message: Could not find encoder for G729
message: Could not find decoder for G729
message: Could not find encoder for iLBC
message: Could not find decoder for iLBC
message: Could not find encoder for telephone-event
message: Could not find decoder for telephone-event
message: Could not find encoder for AMR
message: Could not find decoder for AMR
message: Could not find encoder for AMR-WB
message: Could not find decoder for AMR-WB
message: Could not find encoder for 1015
message: Could not find decoder for 1015
message: Could not find encoder for SILK
message: Could not find decoder for SILK
message: Could not find encoder for SILK
message: Could not find decoder for SILK
message: Could not find encoder for SILK
message: Could not find decoder for SILK
message: Could not find encoder for SILK
message: Could not find decoder for SILK
message: Could not find encoder for mpeg4-generic
message: Could not find decoder for mpeg4-generic
message: Could not find encoder for mpeg4-generic
message: Could not find decoder for mpeg4-generic
message: Could not find encoder for H261
message: Could not find decoder for H261
message: Could not find encoder for MPV
message: Could not find decoder for MPV
message: Could not find encoder for x-snow
message: Could not find decoder for x-snow
message: Could not find encoder for H264
message: TLS server method
warning: no system certificate loaded
error: eXosip: Couldn't read CA list
message: eXosip: Trusted CA folder : '/etc/ssl/certs'
warning: no system certificate loaded
message: getaddrinfo failure. 0.0.0.0:5060 (-9)
warning: Could not start tls transport on port 5060, maybe this port is already used.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: New local ip address is 192.168.1.4
message: Network state is now [UP]
message: Local interface to reach sip.linphone.org is 192.168.1.4.
error: wrong state: create transport layer first
error: wrong state: create transport layer first
error: wrong state: create transport layer first
message: allocating transaction resource 1 828422930
message: Sending a new SUBSCRIBE
error: wrong state: create transport layer first
error: wrong state: create transport layer first
error: eXosip: missing via header
message: allocating transaction resource 2 647562304
message: linphone_friend_apply() done.
message: Sending a new SUBSCRIBE
error: wrong state: create transport layer first
error: wrong state: create transport layer first
error: eXosip: missing via header
message: allocating transaction resource 3 1353760134
message: linphone_friend_apply() done.
message: Sending a new SUBSCRIBE
error: wrong state: create transport layer first
error: wrong state: create transport layer first
error: eXosip: missing via header
message: allocating transaction resource 4 885502749
message: linphone_friend_apply() done.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.
message: Local interface to reach 87.98.157.38 is 192.168.1.4.

尝试将 SIP 端口更改为 5069 后:

thufir@doge:~$ 
thufir@doge:~$ linphonec
ALSA lib conf.c:4738:(snd_config_expand) Unknown parameters 0
ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL default:0
ALSA lib conf.c:4738:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default:0
ALSA lib conf.c:4738:(snd_config_expand) Unknown parameters 0
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM default:0
Warning: Could not start tls transport on port 5069, maybe this port is already used.
Ready
Warning: video is disabled in linphonec, use -V or -C or -D to enable.
linphonec> 
linphonec> ports
sip port = 5069
audio rtp port = 7078
video rtp port = 9078
linphonec> 
linphonec> states
Global liblinphone state
LinphoneGlobalOn
Call states
Id |            Destination              |      State      |    Flags   |
------------------------------------------------------------------------
(empty)
Proxy registration states
           Identity                      |      State
------------------------------------------------------------
sip:[email protected]              | LinphoneRegistrationProgress
linphonec> 
linphonec> quit
Terminating...
ortp-error-cannot unsubscribe, no dialog !
ortp-error-cannot unsubscribe, no dialog !
ortp-error-cannot unsubscribe, no dialog !

thufir@doge:~$ 

我从 GUI 设置了 NAT 并输入了我的外部 IP。切换到 ipv6 后,GUI 显示注册失败。

我更喜欢使用linphonecCLI。它仅用于聊天。

我能够使用OnSIP 网络应用程序调用网络上的 Android 平板电脑上注册的 ekiga 帐户。

也可以看看:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743494

http://www.linuxquestions.org/questions/linux-software-2/configuring-linphone-4175485161/

http://nongnu.13855.n7.nabble.com/The-port-5060-already-used-problem-td197509.html

https://opensips.org/pipermail/users/2014-September/029913.html

答案1

我认为我的另一半也遇到了同样的问题,所以我在一台备用笔记本电脑上安装了 Ubuntu (16.04),以管理员身份启动 linphone 没有任何问题,但以普通用户身份可以重现你的错误。然后我添加了组插件开发让普通用户注销然后重新登录,现在 linphone 似乎就可以正常工作了。

我添加了该组

usermod -aG plugdev yournormalusername 

以 root 身份运行。

答案2

在 Ubuntu 16.04 上,通过从其 PPA 安装较新版本的 linphone,我解决了这个问题:

sudo add-apt-repository ppa:linphone/release
sudo apt-get update
sudo apt-get install linphone linphone-plugin-openh264

相关内容