Description

Unexpected Behavior from transformations, psuedo variables, and topos.

Topos is in use for topology hiding I'm not sure if this is part of the problem as I can't easily test this in the current environment, although I do know indexes should work with $hdr() psuedo variables.

Issue 1

Record-Route: <sip:a@a.com>,<sip:b@b.com>,<sip:c@c.com>

$(hdr(Record-Route)[0]) results in "<sip:a@a.com>,<sip:b@b.com>,<sip:c@c.com>"

Expected result would be sip:a@a.com

I've also tested using index 1 incase 0 was equivalent to *, same results.

Which lead me to the second issue.

issue 2

Correct:
$(hdr(Record-Route)[*]) results in <sip:a@a.com>,<sip:b@b.com>,<sip:c@c.com>

Correct:
$(hdr(Record-Route)[*]{re.subst,/,/|/g}) results in <sip:a@a.com>|<sip:b@b.com>|<sip:c@c.com>

Incorrect:
$(hdr(Record-Route)[*]{re.subst,/,/|/g}{param.valueat,0,|}) results in some random string pulled from part of the Record-Route header

Expected result would be sip:a@a.com

Possible Solutions

TBD

Additional Information

version: kamailio 5.8.2 (x86_64/linux) 
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown 
compiled with gcc 10.2.1
Distributor ID:	Debian
Description:	Debian GNU/Linux 11 (bullseye)
Release:	11
Codename:	bullseye


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <kamailio/kamailio/issues/4127@github.com>