Re: [SR-Users] Select last URI from Record-Route

2018-03-19 Thread Andrew Pogrebennyk
On 03/19/2018 10:37 AM, Andrew Pogrebennyk wrote:
> On 03/16/2018 05:07 PM, John Petrini wrote:
>> The simple answer to that is it's a last ditch effort to look up an AOR
>> record on a reply but it's part of other logic we use to establish
>> direct media.
> 
> try with $(hdr(Record-Route)[-1]).. it works for us (though, with
> another header name).
> Andrew
> 

Considering you might have multiple header fields all comma-separated in
one header, to access the last uri you'd have to do something like:

$(hdr(Record-Route)[-1]{s.select,-1,,}{nameaddr.uri});

Andrew

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Select last URI from Record-Route

2018-03-19 Thread Andrew Pogrebennyk
On 03/16/2018 05:07 PM, John Petrini wrote:
> The simple answer to that is it's a last ditch effort to look up an AOR
> record on a reply but it's part of other logic we use to establish
> direct media.

try with $(hdr(Record-Route)[-1]).. it works for us (though, with
another header name).
Andrew

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Select last URI from Record-Route

2018-03-19 Thread Ilie Soltanici
Hi,

Try $(hdr(Record-Route)[-1]), to extract URI only you can
use: $(hdr(Record-Route)[0]{nameaddr.uri})
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Select last URI from Record-Route

2018-03-16 Thread John Petrini
Hi Carsten,

Thanks for the suggestion but it looks like that takes the URI from the
route header not record-route. I tested to be sure but the assignment fails
because there is no route header.


John Petrini
Platforms Engineer

[image: Call CoreDial] 215.297.4400 x 232 <215-297-4400>
[image: Call CoreDial] www.coredial.com 
[image: CoreDial] 751 Arbor Way, Hillcrest I, Suite 150 Blue Bell, PA 19422

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.

On Fri, Mar 16, 2018 at 12:32 PM, Carsten Bock  wrote:

> Hi,
>
> Check for $route_uri, we use it to determine the session-case (no or Mt)
> on the Proxy-CSCF.
>
> Thanks,
> Carsten
>
> Am 16.03.2018 17:07 schrieb "John Petrini" :
>
>> The simple answer to that is it's a last ditch effort to look up an AOR
>> record on a reply but it's part of other logic we use to establish direct
>> media.
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Select last URI from Record-Route

2018-03-16 Thread Carsten Bock
Hi,

Check for $route_uri, we use it to determine the session-case (no or Mt) on
the Proxy-CSCF.

Thanks,
Carsten

Am 16.03.2018 17:07 schrieb "John Petrini" :

> The simple answer to that is it's a last ditch effort to look up an AOR
> record on a reply but it's part of other logic we use to establish direct
> media.
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Select last URI from Record-Route

2018-03-16 Thread John Petrini
The simple answer to that is it's a last ditch effort to look up an AOR
record on a reply but it's part of other logic we use to establish direct
media.
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Select last URI from Record-Route

2018-03-16 Thread Alex Balashov
I do have to wonder: what do you need to do that for? What are you
trying to accomplish?

On Fri, Mar 16, 2018 at 11:40:01AM -0400, John Petrini wrote:

> Hello list,
> 
> Does anyone how I can extract the last URI from a compact Record-Route
> header?
> 
> I've tried using a negative index in the parameter of my select but it
> returns the first URI in the header instead of the last.
> 
> $var(rr_last_uri) = @record_route.uri[-1];
> 
> Maybe there's another way instead of using selects?
> 
> Thanks,
> 
> John

> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Select last URI from Record-Route

2018-03-16 Thread John Petrini
Hello list,

Does anyone how I can extract the last URI from a compact Record-Route
header?

I've tried using a negative index in the parameter of my select but it
returns the first URI in the header instead of the last.

$var(rr_last_uri) = @record_route.uri[-1];

Maybe there's another way instead of using selects?

Thanks,

John
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users