[OpenSIPS-Users] validate_dialog() failing to recognise reinvites

Kingsley Tart kingsley at dns99.co.uk
Thu Oct 21 09:06:44 EST 2021


Hi,

Thanks, that all makes perfect sense.

During the tests I had to insert another test and forgot to preserve
$rc from validate_dialog() which explains the difference between the -1
I was printing and the -2 that the function would have returned.

Thanks for the reference to the RFC. I shall present this extract to
the carrier to point out what they are doing wrong:

   -  A user, ttl, or method uri-parameter appearing in only one
      URI never matches, even if it contains the default value.

Thank you Bogdan, that's a massive help.

Cheers,
Kingsley.

On Thu, 2021-10-21 at 09:27 +0300, Bogdan-Andrei Iancu wrote:
> Hi,
> 
> So the error log is about the "remote contact", but the return code
> is -1 ?? (which according to doc [1] means invalid cseq). Checking
> the code, you should have get a -2 ret code in correlation to that
> log (see [2]).
> 
> Now, based on the error log, I see that the dialog module retained
> the "sip:asterisk at 1.1.1.28:5060" URI (from a received Contact hdr),
> but it gets from the other party (as RURI) a different value, the
> "sip:asterisk at 1.1.1.28:5060;user=phone" . And according to RFC3261
> [3], that extra "user" URI param makes the URI not to match anymore -
> see chapter " 9.1.4 URI Comparison"
> 
> 
> o  URI uri-parameter components are compared as follows:
> 
>          -  Any uri-parameter appearing in both URIs must match.
> 
>          -  A user, ttl, or method uri-parameter appearing in only
> one
>             URI never matches, even if it contains the default value.
> 
> 
> 
> [1] 
> https://opensips.org/html/docs/modules/3.1.x/dialog.html#func_validate_dialog
> [2] 
> https://github.com/OpenSIPS/opensips/blob/master/modules/dialog/dlg_handlers.c#L2707
> [3] https://www.ietf.org/rfc/rfc3261.txt
> 
> Regards,
> On 10/19/21 12:06 PM, Kingsley Tart wrote:
> > Hi,
> > 
> > Thanks. I hadn't noticed before but yes, I'm seeing this:
> > 
> > ERROR:dialog:dlg_validate_dialog: failed to validate remote
> > contact: dlg=[sip:asterisk at 1.1.1.28:5060] , req=[sip:
> > asterisk at 1.1.1.28:5060;user=phone]
> > 
> > I can't see anywhere in the SIP trace where that contact URI
> > appears
> > *without* user=phone in it so I don't understand why that's
> > happening.
> > 
> > Cheers,
> > Kingsley.
> > 
> > On Tue, 2021-10-19 at 10:08 +0300, Bogdan-Andrei Iancu wrote:
> > > Hi Kingsley,
> > > 
> > > According to the docs [1], the "-1" ret code means "No  SIP
> > > message". Do you see any parsing errors in the logs, while doing
> > > the validation?
> > > 
> > > 
> > > [1] 
> > > https://opensips.org/html/docs/modules/3.1.x/sipmsgops.html#func_sipmsg_validate
> > > 
> > > Regards,
> > > On 10/18/21 5:25 PM, Kingsley Tart wrote:
> > > > Hi,
> > > > 
> > > > Using OpenSIPS 3.1.5 I'm getting validate_dialog() returning
> > > > $rc=-1 on
> > > > re-invites.
> > > > 
> > > > 
> > > > I have this in opensips.cfg:
> > > > 
> > > > modparam("dialog", "dlg_match_mode", 1)
> > > > 
> > > > 
> > > > The top of route() looks like this:
> > > > 
> > > > route {
> > > > 	if (has_totag()) {
> > > > 		if (is_method("ACK") && t_check_trans()) {
> > > > 			t_relay();
> > > > 			exit;
> > > > 		}
> > > > 
> > > > 		if (!loose_route()) {
> > > > 			send_reply(404, "Not here");
> > > > 			exit;
> > > > 		}
> > > > 
> > > > 		if (!validate_dialog()) {
> > > > 			xlog("L_WARN", "Ignoring $rm from $si
> > > > due to invalid dialog; rc=$rc\n");
> > > > 		}
> > > > 
> > > > 
> > > > I've attached an (anonymised) SIP trace. OpenSIPS isn't
> > > > responding to
> > > > the reinvites as I'm seeing "Ignoring INVITE from (address) due
> > > > to
> > > > invalid dialog: rc=-1" (as per the xlog above).
> > > > 
> > > > Is there something wrong with these re-invite messages, or
> > > > something
> > > > I'm doing wrong in OpenSIPS?
> > > > 
> > > > Cheers,
> > > > Kingsley.
> > > > 
> > > > 
> > > > _______________________________________________
> > > > Users mailing list
> > > > Users at lists.opensips.org
> > > > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> > > 
> > >  
>  




More information about the Users mailing list