Skip Menu |

This queue is for tickets about the Net-SIP CPAN distribution.

Report information
The Basics
Id: 121348
Status: resolved
Priority: 0/
Queue: Net-SIP

People
Owner: Steffen_Ullrich [...] genua.de
Requestors: richard.carver [...] cloudmont.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Net::SIP::StatelessProxy PRACK route failure when using custom contact
Date: Mon, 24 Apr 2017 10:11:58 +0000
To: "bug-Net-SIP [...] rt.cpan.org" <bug-Net-SIP [...] rt.cpan.org>
From: Richard Carver <richard.carver [...] cloudmont.co.uk>
I am specifying the contact on my legs to use the host name as I am using TLS. I set the contact for a leg to 'sip:full.host.name:5061;transport=tls' (the system I am integrating to does not like 'sips' so I have to use 'sip'). On call setup when a PRACK arrives with route headers, StatelessProxy fails to match the route against a leg as it only checks for address and port, resulting in it treating it as the next hop and sending the message to itself: Net::SIP::StatelessProxy::__forward_request_getleg[389]: no legs which can deliver to full.host.name:5061 (route) The following patch adds a lookup against contact to resolve this issue. *** /usr/local/share/perl5/Net/SIP/StatelessProxy.pm.orig 2017-04-24 10:03:54.866516615 +0000 --- /usr/local/share/perl5/Net/SIP/StatelessProxy.pm 2017-04-24 09:59:02.759900745 +0000 *************** sub __forward_request_getleg { *** 383,388 **** --- 383,393 ---- port => $port ); } + if ( ! @legs ) { + @legs = $self->{dispatcher}->get_legs( + sub => [ sub { sip_uri_eq( $_[0], $_[1]->{contact} ) }, $data ] + ); + } if ( @legs ) { DEBUG( 50,"setting leg from our route header: $data -> ".$legs[0]->dump ); $entry->{outgoing_leg} = \@legs;
Am Mo 24. Apr 2017, 08:47:23, richard.carver@cloudmont.co.uk schrieb: Show quoted text
> I am specifying the contact on my legs to use the host name as I am > using TLS. I set the contact for a leg to > 'sip:full.host.name:5061;transport=tls' (the system I am integrating > to does not like 'sips' so I have to use 'sip'). On call setup when a > ...
I think that the checking against addr and port is correct but the problem is that addr is not an IP address. In branch https://github.com/noxxi/p5-net-sip/tree/rt121348 I've changed Leg::match so that it checks the given addr also against the hostname, provided one was given within Leg->new(..., host => ...). Can you please check if this fixes your problem?
Subject: RE: [rt.cpan.org #121348] Net::SIP::StatelessProxy PRACK route failure when using custom contact
Date: Thu, 16 Nov 2017 18:47:18 +0000
To: "bug-Net-SIP [...] rt.cpan.org" <bug-Net-SIP [...] rt.cpan.org>
From: Richard Carver <richard.carver [...] cloudmont.co.uk>
I've reviewed your solution and it looks like it will resolve the issue and is more efficient than my version. My application has changed since I reported this so that it always pre-sets outgoing_legs with the leg on which the client SSL certificate matches the tenant the message belongs to, and this means it now bypasses the problem code, so I can't confirm this fixes the issue without spending time reverting to an older version. I hope you are happy to include your change without this confirmation as I am pretty confident it would resolve it and will stop me hitting the issue in future applications. Show quoted text
-----Original Message----- From: Steffen Ullrich via RT [mailto:bug-Net-SIP@rt.cpan.org] Sent: 08 August 2017 12:21 To: Richard Carver <richard.carver@cloudmont.co.uk> Subject: [rt.cpan.org #121348] Net::SIP::StatelessProxy PRACK route failure when using custom contact <URL: https://rt.cpan.org/Ticket/Display.html?id=121348 > Am Mo 24. Apr 2017, 08:47:23, richard.carver@cloudmont.co.uk schrieb:
> I am specifying the contact on my legs to use the host name as I am > using TLS. I set the contact for a leg to > 'sip:full.host.name:5061;transport=tls' (the system I am integrating > to does not like 'sips' so I have to use 'sip'). On call setup when a > ...
I think that the checking against addr and port is correct but the problem is that addr is not an IP address. In branch https://github.com/noxxi/p5-net-sip/tree/rt121348 I've changed Leg::match so that it checks the given addr also against the hostname, provided one was given within Leg->new(..., host => ...). Can you please check if this fixes your problem?
Am Do 16. Nov 2017, 16:19:05, richard.carver@cloudmont.co.uk schrieb: Show quoted text
> I've reviewed your solution and it looks like it will resolve the > issue and is more efficient than my version.
The changes are in commit 7161654 now and will be released with the next version.