[Home]

Summary:ASTERISK-28995: res_pjsip_registrar: Expires on statically configured contacts is not correct
Reporter:tootai (tootai)Labels:
Date Opened:2020-07-18 11:29:11Date Closed:2020-07-27 17:45:54
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Resources/res_pjsip Resources/res_pjsip_registrar
Versions:16.12.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 10/64 with Asterisk compiled from source Attachments:( 0) Asterisk-28995-log1
( 1) Asterisk-28995-log2
Description:Client asterisk can't no more register getting

[Jul 18 18:16:41] ERROR[16446]: pjproject: <?>:           sip_parser.c Error parsing '2699878327': String value was greater than the maximum allowed value.  
[Jul 18 18:16:41] ERROR[16446]: pjproject: <?>:         sip_transport. Error processing 557 bytes packet from UDP 10.1.58.11:5060 : PJSIP invalid value error
exception when parsing 'Contact' header on line 8 col -1:                                                                                                    
SIP/2.0 200 OK                                                                                                                                                
Via: SIP/2.0/UDP 10.99.3.25:5060;rport=5060;received=10.99.3.25;branch=z9hG4bKPj14b7789f-2b4a-4b86-a5f8-da30ee91620f                                          
Call-ID: 3516f022-c9a9-4e6d-a5f7-1c41e71dc3e5                                                                                                                
From: <sip:33388086940@10.1.58.11>;tag=5208efde-b08d-4f25-abd0-a567ff0ee1f6                                                                                  
To: <sip:33388086940@10.1.58.11>;tag=z9hG4bKPj14b7789f-2b4a-4b86-a5f8-da30ee91620f                                                                            
CSeq: 25192 REGISTER                                                                                                                                          
Date: Sat, 18 Jul 2020 16:16:09 GMT                                                                                                                          
Contact: <sip:10.99.3.25:5060>;expires=2699878327                                                                                                            
Contact: <sip:s@10.99.3.25:5060>;expires=3599
Expires: 3600
Server: TOOTAiAudio
Content-Length:  0


-- end of packet.
Comments:By: Asterisk Team (asteriskteam) 2020-07-18 11:29:15.558-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Benjamin Keith Ford (bford) 2020-07-20 09:44:59.937-0500

Looks like the problem is with the first "Contact" header, with the expiration of "2699878327". This may be out of the range of the parser. Can you provide some SIP and debug logs of successful REGISTERs leading up to this one? I'll look at the REGISTER code to confirm the above.

By: tootai (tootai) 2020-07-20 12:20:43.567-0500

Part of client Asterisk register log when remote Asterisk is 16.12.0

By: tootai (tootai) 2020-07-20 12:22:09.475-0500

Hi Benjamin. Will be difficult both servers being in production right now. Will see to find a moment this week. Checking more carefully the logs of the client Asterisk -which is a 16.1.1 Debian 9.12/386 compiled from source- I saw that the first attempt to register was

[Jul 18 18:02:43] ERROR[415] pjproject:           sip_parser.c Error parsing '2699879133': String value was greater than the maximum allowed value.

which ended

[Jul 18 18:16:41] ERROR[16446] pjproject:         sip_parser.c Error parsing '2699878327': String value was greater than the maximum allowed value.

Attached file is the full list with timestamp, you will note that the string is decremented from 92 units after 11 attempts for each value except between 2699878673 and 2699878603 which is only 70 units

Daniel



By: Sean Bright (seanbright) 2020-07-20 15:33:30.138-0500

From RFC 3261 Section 10.2:

{noformat}
The "expires" parameter indicates how long the UA would
like the binding to be valid.  The value is a number
indicating seconds.  If this parameter is not provided, the
value of the Expires header field is used instead.
Implementations MAY treat values larger than 2**32-1
(4294967295 seconds or 136 years) as equivalent to 2**32-1.
Malformed values SHOULD be treated as equivalent to 3600.
{noformat}

This should have already been fixed in [this patch|https://github.com/pjsip/pjproject/commit/3f58d4d10dfe01b51cca84449c18f0bb6fa6b473#diff-f5ebdf4e57a12185be65c65b2ec64262]. Are you using the bundled version of pjproject?

By: tootai (tootai) 2020-07-21 02:23:33.794-0500

Hello Sean. Yes, compiled with the bundled pjproject

By: Joshua C. Colp (jcolp) 2020-07-21 10:39:42.388-0500

Can you clarify what the attached log is for?

As well, do you have a log with a SIP trace from the working 16.11.1?

By: tootai (tootai) 2020-07-21 12:19:13.500-0500

Register log

By: tootai (tootai) 2020-07-21 12:19:22.118-0500

Hi Joshua,

I thought that the fact the time was decreasing with a regular value and regularly attemps could help to debug. If not, please forget about.

Attached is the register log from the asterisk 16.1 client to the 16.11.1

Daniel

By: Joshua C. Colp (jcolp) 2020-07-22 04:38:58.211-0500

Ah, I've found what is going on. Your information has been confusing on what is what and such.

You have to configure an explicit contact on an AOR and also REGISTER to it. That's not something I've seen anyone else do, so probably why noone saw this.

By: Friendly Automation (friendly-automation) 2020-07-27 17:45:55.639-0500

Change 14704 merged by Friendly Automation:
res_pjsip_registrar: Don't specify an expiration for static contacts.

[https://gerrit.asterisk.org/c/asterisk/+/14704|https://gerrit.asterisk.org/c/asterisk/+/14704]

By: Friendly Automation (friendly-automation) 2020-07-27 18:20:19.999-0500

Change 14705 merged by Friendly Automation:
res_pjsip_registrar: Don't specify an expiration for static contacts.

[https://gerrit.asterisk.org/c/asterisk/+/14705|https://gerrit.asterisk.org/c/asterisk/+/14705]

By: Friendly Automation (friendly-automation) 2020-07-28 09:47:15.157-0500

Change 14691 merged by Kevin Harwell:
res_pjsip_registrar: Don't specify an expiration for static contacts.

[https://gerrit.asterisk.org/c/asterisk/+/14691|https://gerrit.asterisk.org/c/asterisk/+/14691]

By: Friendly Automation (friendly-automation) 2020-07-28 09:48:02.900-0500

Change 14706 merged by Kevin Harwell:
res_pjsip_registrar: Don't specify an expiration for static contacts.

[https://gerrit.asterisk.org/c/asterisk/+/14706|https://gerrit.asterisk.org/c/asterisk/+/14706]

By: Friendly Automation (friendly-automation) 2020-07-28 09:49:32.617-0500

Change 14707 merged by Kevin Harwell:
res_pjsip_registrar: Don't specify an expiration for static contacts.

[https://gerrit.asterisk.org/c/asterisk/+/14707|https://gerrit.asterisk.org/c/asterisk/+/14707]