asterisk / asterisk

The official Asterisk Project repository.
https://www.asterisk.org
Other
1.97k stars 924 forks source link

[bug]: Expires value on 200 OK one second less then expires value on REGISTER request; causes ever-diminishing cycle #702

Open gmzaza opened 1 month ago

gmzaza commented 1 month ago

Severity

Minor

Versions

18.20.1

Components/Modules

res_pjsip

Operating Environment

Ubuntu 20.04.6 LTS, x86_64, 5.4.0-105-generic

Frequency of Occurrence

Constant

Issue Description

When sending a REGISTER request to Asterisk with a specified "expires" value in the "Contact" header, Asterisk generates its 200 response with "expires" value reduced by 1 second. e.g. In the example below, the client uses 180 seconds, and Asterisk responds with 179 seconds.

This leads the client that generated the REGISTER to then re-register 1 second sooner then it would otherwise. The cycle repeats, over and over, with the expiration dropping by 1 second upon each and every re-registrtion, until the minimum allowable registration interval is hit (60 seconds). When the client re-registers on 59 seconds, Asterisk then rejects the registration, on account of the expiration value being too low.

Example REGISTER request: reg_1_request

Example 200 response: reg_1_response

Relevant log output

No response

Asterisk Issue Guidelines

seanbright commented 1 month ago

Please attach your pjsip.conf file, redacting any sensitive info.