[Home]

Summary:ASTERISK-29667: Asterisk sends with the wrong Nonce to the Telecom operator for the Registration Packet.
Reporter:Vijo Jose (vijo)Labels:
Date Opened:2021-09-22 03:41:19Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Channels/chan_sip/General Channels/chan_sip/Registration
Versions:16.17.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:OS : CentOS Linux release 7.9.2009 (Core) Asterisk : Asterisk 16.17.0 Chan_sip used Attachments:( 0) 27-09-2021.zip
( 1) Asterisk_ChanSIP_Nounce_22092021.txt
( 2) logging.txt
Description:I have a SIP trunk from a telecom operator which is registered on the Asterisk Box.
Asterisk sends with the wrong Nonce to the Telecom operator for the Registration Packet and due to this the operator rejects the sip registration packet.
Asterisk was supposed to send the registration request with Nonce received from the previous unauthorized from Telecom operator and with new Cseq number. But the same is not happening intermittently.

Edit: Initial report and more info here: https://community.asterisk.org/t/sip-register-request-with-cseq-number/90024
Comments:By: Asterisk Team (asteriskteam) 2021-09-22 03:41:23.082-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.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Joshua C. Colp (jcolp) 2021-09-22 04:39:30.134-0500

Thanks for the report and debug. However we also need protocol specific debug captured at the time of the issue. Please include the following:

* Asterisk log files generated using the instructions on the Asterisk wiki [1], with the appropriate protocol debug options enabled, e.g. 'pjsip set logger on' if the issue involves the chan_pjsip channel driver.
* Configuration information for the relevant channel driver, e.g. pjsip.conf.
* A wireshark compatible packet capture, captured at the same time as the Asterisk log output.

[1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information



By: Joshua C. Colp (jcolp) 2021-09-22 04:40:41.300-0500

Additionally the chan_sip module is community supported. If there is an issue, then there is no guarantee if it will ever be looked at or any timeline on resolution.

By: Vijo Jose (vijo) 2021-09-22 05:03:45.854-0500

When the issue was raised I don't have the debug level logs enabled. Presently I have logs which WARNING, ERROR, VERBOSE  - Attached is the same. Also, I have a Wireshark trace if required.

I will try to recreate the issue or will enable the debug, sip debug, and Wireshark logs when the issue again arises.

By: Vijo Jose (vijo) 2021-09-27 02:17:42.768-0500

Hai the issue occurred again today. And I have the debug level logs with sip debug and also with pcap trace for the issue time period.

By: Vijo Jose (vijo) 2021-09-27 02:28:12.055-0500

The issue occurred again today.

And I have the debug level logs with sip debug and also with pcap trace for the issue time period.

Asterisk Server IP : 10.10.5.23

By: Kevin Harwell (kharwell) 2021-09-27 12:04:55.276-0500

That's a lot of data to wade through. Could you be more specific, and narrow down which registration attempt is having the problem? Or are all having the problem I'll describe below?

Some I have looked at it appears that Asterisk is sending a registration attempt with a nonce, which is rejected. Asterisk continues to retransmit this request (not sure why). Eventually though it does process the 401 and Asterisk sends a new registration with the updated nonce from the received 401. However, the provider rejects this new attempt again with a 401, and different nonce. For the call-id I looked at {{3b02fa216d1e3f777ceba1d714480b35@10.10.5.23}} (in _Trace_27092021_1157.pcap_ and _messages.2021-09-27-12-00-02_) this process continues with no apparent end (at least in that pcap).


By: Vijo Jose (vijo) 2021-09-28 00:23:45.600-0500

As checked the Wireshark traces shared filename Trace_27092021_1157.pcap
 
For some rare cases where asterisk sending the new Register request wth updated nonce but most of the cases the asterisk is not sending registration request with updated nonuse - it just keeps sending with an old nonce.

Refering the call-id - 3b02fa216d1e3f777ceba1d714480b35

What could be the reason for this ? or how should we take it forward ?

The SIP account multiple DID - Around 30 DID's am registering in the sip.conf

By: Vijo Jose (vijo) 2021-09-28 01:55:00.550-0500

The operator asked to register the DID and I have registered the same.

register => username:password@host:port/contact

And these DID's were registered and the reported issue comes intermittently.

By: Joseph Goettgens (EkFudrek) 2021-09-28 02:45:02.401-0500

That would have been a possibility.

By: Kevin Harwell (kharwell) 2021-09-28 12:20:32.016-0500

Based on the information available, and [the analysis here|https://community.asterisk.org/t/sip-register-request-with-cseq-number/90024/26] I think there is enough to open the issue (I do agree though that more information could help to further narrow things down). It does seem like Asterisk might be having a problem with retransmissons, or the cancelling thereof.

However, as mentioned here, and elsewhere chan_sip module is community supported thus the timeline for when (even _if_) this issue is looked at is indeterminate.