Bug#954328: linphone loops sending REGISTER because it doesn't believe the SIP OK matches the SIP register
John Hughes
john at calva.com
Fri Mar 20 10:24:44 GMT 2020
Package: linphone
Version: 3.12.0-3.1
Severity: normal
Dear Maintainer,
* What led up to the situation?
Trying to work from home due to covid-19 :(
* What exactly did you do (or not do) that was effective (or
ineffective)?
Set up linphone to talk to our existing asterisk setup.
* What was the outcome of this action?
Everything works but linphone takes about 20% cpu when idle
* What outcome did you expect instead?
Lower CPU usage when calls not in progress.
Details:
I've configured linphone to send calls to our asterisk and asterisk to be able
to call linphone as an extension. This works but I see linphone using a
constant ~20% of cpu. In the linphone debug window I see that linphone
doesn't believe that the SIP OK in reply to the SIP register matches, so
linphone (or, more exactly belle-sip) resends the REGISTER endlessly.
For example:
message: 2020-03-19 08:58:37:816 channel [0x5652c055ea30]: message sent to [UDP://masked.masked.com:5060], size: [728] bytes
REGISTER sip:masked.masked.com SIP/2.0
Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.Xy81vVGP5;rport
From: <sip:john at masked.masked.com>;tag=kiyGbhQuT
To: sip:john at masked.masked.com
CSeq: 15003 REGISTER
Call-ID: -jz0iptAjY
Max-Forwards: 70
Supported: replaces, outbound
Accept: application/sdp
Accept: text/plain
Accept: application/vnd.gsma.rcs-ft-http+xml
Contact: <sip:john at 10.27.128.3;transport=udp>;+sip.instance="<urn:uuid:abcdf51a-82e0-49b9-a8ab-2461011f25ec>"
Expires: 3600
User-Agent: Linphone/3.12.0 (belle-sip/1.6.3)
Authorization: Digest realm="asterisk", nonce="7a074ecd", algorithm=MD5, username="john", uri="sip:masked.masked.com", response="27e6d621c10672a7a553e82addb894cc"
message: 2020-03-19 08:58:37:844 channel [0x5652c05ba260]: received [553] new bytes from [UDP://::ffff:10.27.128.1:5060]:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.27.128.3:5060;branch=z9hG4bK.Xy81vVGP5;received=10.27.128.3;rport=5060
From: <sip:john at masked.masked.com>;tag=kiyGbhQuT
To: sip:john at masked.masked.com;tag=as33ad5d3a
Call-ID: -jz0iptAjY
CSeq: 15003 REGISTER
Server: Asterisk PBX 13.14.1~dfsg-2+deb9u4
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 3600
Contact: <sip:john at 10.27.128.3;transport=udp>;expires=3600
Date: Thu, 19 Mar 2020 07:58:37 GMT
Content-Length: 0
message: 2020-03-19 08:58:37:846 channel [0x5652c05ba260] [553] bytes parsed
message: 2020-03-19 08:58:37:846 Found transaction matching response.
message: 2020-03-19 08:58:37:846 Changing [client] [REGISTER] transaction [0x5652c0bdac10], from state [TRYING] to [COMPLETED]
message: 2020-03-19 08:58:37:847 Refresher [0x5652c039da00]: contact address [10.27.128.3:5060] does not match channel address[(null):0] on channel [0x5652c055ea30]
message: 2020-03-19 08:58:37:847 belle_sip_refresher_start(): refresher [0x5652c039da00] is resubmitting request because contact sent was not correct in original request.
The message "contact address ... does not match channel address" is in
belle-sip src/refresher.c function is_contact_request_accurate:
if (channel_public_port == contact_port
&& channel_public_ip && contact_ip
&& strcmp(channel_public_ip,contact_ip) == 0) {
/*nothing to do contact is accurate*/
belle_sip_header_contact_set_unknown(contact,FALSE);
return TRUE;
} else {
belle_sip_message("Refresher [%p]: contact address [%s:%i] does not match channel address[%s:%i] on channel [%p]" ,refresher
,contact_ip
,contact_port
,channel_public_ip
,channel_public_port
,refresher->transaction->base.channel);
return FALSE;
}
It seems that when we get here refresher->transaction->base.channel->public_ip
is NULL.
Here is the part of my .linphonerc where the proxy is defined:
[proxy_0]
reg_proxy=sip:masked.masked.com
reg_identity=sip:john at masked.masked.com
quality_reporting_enabled=0
quality_reporting_interval=0
reg_expires=3600
reg_sendregister=1
publish=1
avpf=0
avpf_rr_interval=5
dial_escape_plus=0
privacy=32768
publish_expires=-1
I made a simple hack to refresher.c to accept OK replies if "public_ip" was
NULL, which drops the CPU time and seems to have no bad effects but is almost
certainly the wrong "fix".
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 5.4.0-3-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_WARN
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages linphone depends on:
ii libatk1.0-0 2.34.1-1
ii libbctoolbox1 0.6.0-2+b2
ii libbelcard1 1.0.2-1+b1
ii libbellesip0 1.6.3-5john1
ii libbzrtp0 1.0.6-3
ii libc6 2.30-2
ii libgcc-s1 [libgcc1] 10-20200304-1
ii libgcc1 1:8.3.0-6
ii libgdk-pixbuf2.0-0 2.40.0+dfsg-3
ii libglib2.0-0 2.64.0-2
ii libgtk2.0-0 2.24.32-4
ii libmediastreamer-base10 1:2.16.1-4+b2
ii libmediastreamer-voip10 1:2.16.1-4+b2
ii libnotify4 0.7.9-1
ii libortp13 1:1.0.2-1
ii libsqlite3-0 3.31.1-4
ii libstdc++6 10-20200304-1
ii libudev1 245-2
ii libxml2 2.9.10+dfsg-4
ii linphone-nogtk 3.12.0-3.1
ii zlib1g 1:1.2.11.dfsg-2
linphone recommends no packages.
Versions of packages linphone suggests:
ii yelp 3.34.0-1
-- no debconf information
More information about the Pkg-voip-maintainers
mailing list