[Home]

Summary:ASTERISK-28823: Updates for outgoing registrations not sent to the correct network address
Reporter:FlashSystems (FlashSystems)Labels:
Date Opened:2020-04-12 07:21:19Date Closed:
Priority:MajorRegression?No
Status:Open/NewComponents:pjproject/pjsip
Versions:17.3.0 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Linux on x86_64Attachments:( 0) debug_log
( 1) pjsip.conf
Description:If an outbound registration is performed the update of the registration (to keep it from timing out) is not done to the same network address as the initial registration. If more than one host is present in the SRV record, the outbound update of the registration is sometimes done to a different host.

RFC 3261 (SIP: Session Initiation Protocol) states in Section 10.2.4 (Refreshing Bindings) that “(…)Registration refreshes SHOULD be sent to the same network address as the original registration, unless redirected.”.

So subsequent registration requests should always reach the same host.

The provider in question uses the following SRV-Records (redacted):

{code}
_sip._udp.phone.provider.example.   5452    IN      SRV     10 1 5060 phone-a.provider.example.
_sip._udp.phone.provider.example.   5452    IN      SRV     10 1 5060 phone-b.provider.example.
{code}

As the following two `REGISTER` messages show the first one is sent to phone-a (IP: XXXX:7::10) the update for the registration is sent to phone-b (IP: XXXX:8::10):

{code}
[Apr 10 11:30:28] VERBOSE[26529] res_pjsip_logger.c: <--- Transmitting SIP request (616 bytes) to UDP:[XXXX:7::10]:5060 --->
REGISTER sip:phone.mnet-voip.de SIP/2.0
Via: SIP/2.0/UDP [YYYY::1]:5060;rport;branch=z9hG4bKPjdf58fb88-72ac-4494-9670-99ec1f0f8e9f
From: <sip:+12345678@phone.mnet-voip.de>;tag=74a4b55d-e91d-46bd-898c-02f2b0812802
To: <sip:+12345678@phone.mnet-voip.de>
Call-ID: 7fda0159-790d-4c9d-a934-80e36a0d0d70
CSeq: 26348 REGISTER
Contact: <sip:+12345678@[YYYY::1]:5060;line=xrhrzif>
Expires: 1200
{code}

{code}
[Apr 10 11:50:18] VERBOSE[27575] res_pjsip_logger.c: <--- Transmitting SIP request (616 bytes) to UDP:[XXXX:8::10]:5060 --->
REGISTER sip:phone.mnet-voip.de SIP/2.0
Via: SIP/2.0/UDP [YYYY::1]:5060;rport;branch=z9hG4bKPj7c7043f0-57c3-40fb-90a5-77810229e0c1
From: <sip:+12345678@phone.mnet-voip.de>;tag=3e56a13f-a983-477e-be0b-1c9cb32e63b4
To: <sip:+12345678@phone.mnet-voip.de>
Call-ID: 7fda0159-790d-4c9d-a934-80e36a0d0d70
CSeq: 26350 REGISTER
Contact: <sip:+12345678@[YYYY::1]:5060;line=xrhrzif>
Expires: 1200
{code}

In my case the new registration to a different host leads to currently running calls being terminated.
Comments:By: Asterisk Team (asteriskteam) 2020-04-12 07:21:26.200-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.

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: George Joseph (gjoseph) 2020-04-13 11:50:08.325-0500

I believe this is the same issue as ASTERISK-28502 which was fixed in
https://gerrit.asterisk.org/c/asterisk/+/12826 and released as part of 17.3.

Please check that rewrite_contact is turned on for the provider's endpoint and that res_pjsip_nat is loaded.

If the problem persists with both rewrite-contact turned on and res_pjsip_nat loaded, please include the full packet capture including the responses from both register requests.





By: FlashSystems (FlashSystems) 2020-04-13 14:48:39.374-0500

I did the test you described and it did not work. The `REGISTER` update messages were still sent to different IP addresses. I attached a log file and an excerpt of my `PJSIP` configuration.

By: George Joseph (gjoseph) 2020-04-13 15:11:22.174-0500

I wonder if the issue is related to using "line" in the registration.

Can you send the unedited log with the original IP addresses to asteriskteam@digium.com.  Use the subject "ASTERISK-28823 Debug Log"


By: George Joseph (gjoseph) 2020-04-13 15:29:06.220-0500

Hmmm.  That earlier fix I mentioned was for incoming registrations, not outgoing. My bad. :)   Anyway, a copy of the packet log with original information intact would still be helpful.


By: FlashSystems (FlashSystems) 2020-04-13 16:17:48.551-0500

I sent you the log file via e-mail.
I can't currently remove the line parameter because I need to do multiple registrations from the same IP address. Without the line parameter incoming calls do not get correctly assigned to the contact.

By: FlashSystems (FlashSystems) 2020-07-22 09:08:34.393-0500

Was there any progress regarding the bug?
Is there anything I can do to facilitate the resolution of this bug (for example testing something)?

By: Joshua C. Colp (jcolp) 2020-07-22 09:12:42.706-0500

Any updates are posted on issues. If someone is working on this issue then it is generally assigned to them.