### Description
Chaining the transformations {uri.param,received} and {uri.host} does not work if the address is IPv6. It works for IPv4 addresses.
#### Reproduction
We tested this with the following code: ``` if ($du != $null) { $var(received_uri)=$(du{uri.param,received}); if ($var(received_uri)!="") { $var(subscriber_host)=$(var(received_uri){uri.host}); } $var(test_tmp)=$(du{uri.param,received}{uri.host}); xlog("L_ERR", "WURST subscriber_host=$var(subscriber_host) test_tmp=$var(test_tmp) du=$du received_uri=$var(received_uri)"); } }
#### Log Messages
For IPv6 this gives us: ``` "module": "pv", "file": "pv_trans.c", "line": 1545, "function": "tr_eval_uri", "logprefix": ", "callid": "1-91@1.2.4.16", "x-telco-capture-id": "<null>"", "message": **"invalid uri [ab:cdef:dead:beef]:1234]\n"**
"module": "core", "file": "core/lvalue.c", "line": 351, "function": "lval_pvar_assign", "logprefix": ", "callid": "1-91@1.2.4.16", "x-telco-capture-id": "<null>"", "message": "non existing right pvar\n"
"module": "core", "file": "core/lvalue.c", "line": 411, "function": "lval_assign", "logprefix": ", "callid": "1-91@1.2.4.16", "x-telco-capture-id": "<null>"", "message": "assignment failed at pos: (1432,19-1432,53)\n"
"module": "xlog", "file": "xlog.c", "line": 278, "function": "", "logprefix": ", "callid": "1-91@1.2.4.16", "x-telco-capture-id": "<null>"", "message": "WURST subscriber_host=[2001:db8:0123:4567:89ab:cdef:dead:beef] test_tmp=0 du=sip:1.2.4.129;lr;received=sip[2001:db8:0123:4567:89ab:cdef:dead:beef]:1234 received_uri=sip:[2001:db8:0123:4567:89ab:cdef:dead:beef]:1234"
"module": "xlog", "file": "xlog.c", "line": 278, "function": "", "logprefix": ", "callid": "1-91@1.2.4.16", "x-telco-capture-id": "<null>"", "message": "determineSubscribeIpFamily: contacts worked path=0 ip=[2001:db8:0123:4567:89ab:cdef:dead:beef] af=6" ```
For IPv4 it works: `{ "idx": 8, "pid": 577, "level": "ERROR", "module": "xlog", "file": "xlog.c", "line": 278, "function": "", "logprefix": ", "callid": "1-91@1.2.4.16", "x-telco-capture-id": "<null>"", "message": "WURST subscriber_host=12.34.56.78 test_tmp=12.34.56.78 du=sip:1.2.4.149;lr;received=sip:12.34.56.78:1234 received_uri=sip:12.34.56.78:1234" } `
@ChristianBergerSipgate
Can you confrim that your $du contains a valid sip message? is it manually constructed or otherwise created? it seems to have a missing `:` in the `received` param.
`du=sip:1.2.4.129;lr;received=sip[2001:db8:0123:4567:89ab:cdef:dead:beef]:1234` should be `du=sip:1.2.4.129;lr;received=**sip:**[2001:db8:0123:4567:89ab:cdef:dead:beef]:1234`
Ahh, that makes sense. That's probably it.
Am 11.04.24 um 14:55 schrieb Xenofon Karamanos via sr-dev:
@ChristianBergerSipgate https://github.com/ChristianBergerSipgate
Can you confrim that your $du contains a valid sip message? is it manually constructed or otherwise created? it seems to have a missing |:| in the |received| param.
|du=sip:1.2.4.129;lr;received=sip[2001:db8:0123:4567:89ab:cdef:dead:beef]:1234| should be |du=sip:1.2.4.129;lr;received=**sip:**[2001:db8:0123:4567:89ab:cdef:dead:beef]:1234|
— Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/3794#issuecomment-2049632256, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO7UZOLA5QNRRHFJCYTYVDY42B2XAVCNFSM6AAAAABFI5AU72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGYZTEMRVGY. You are receiving this because you are subscribed to this thread.Message ID: kamailio/kamailio/issues/3794/2049632256@github.com
Kamailio (SER) - Development Mailing List To unsubscribe send an email to sr-dev-leave@lists.kamailio.org
Closed #3794 as completed.