[sr-dev] [kamailio/kamailio] wrong $rU after add_uri_param() when user has "params" (#953)

Victor Seva notifications at github.com
Fri Jan 27 09:58:37 CET 2017


### Description
If $rU has "params" ( the username should be detected as the whole thing, no matter what chars but ':' for the password ) after calling add_uri_param() $rU points to the value without the "params". 

Reading the RFC[0] (19.1 SIP and SIPS Uniform Resource Indicators) nothing seems to avoid the use of '=' and ';' in the username part

[0] https://www.ietf.org/rfc/rfc3261.txt

### Example

```
route[TEST] {
	xlog("$$ru[$ru] $$rU[$rU]\n");
	$rU = "whatever;rn=0000;npdi";
	xlog("$$ru[$ru] $$rU[$rU]\n");
	add_uri_param("user=phone");
	xlog("$$ru[$ru] $$rU[$rU]\n");
	return;
}
```
#### Log Messages

```
ERROR: <script>: $ru[sip:30 at 127.0.0.1] $rU[30]
ERROR: <script>: $ru[sip:whatever;rn=0000;npdi at 127.0.0.1] $rU[whatever;rn=0000;npdi]
[...]
DEBUG: <core> [core/parser/parse_uri.c:1221]: parse_uri(): parsed uri:
 type=1 user=<whatever;rn=0000;npdi>(21)
 passwd=<>(0)
 host=<127.0.0.1>(9)
 port=<>(0): 0
 params=<>(0)
 headers=<>(0)
ERROR: <script>: $ru[sip:whatever;rn=0000;npdi at 127.0.0.1;user=phone] $rU[whatever]
[...]
DEBUG: <core> [core/parser/parse_uri.c:1221]: parse_uri(): parsed uri:
 type=3 user=<whatever>(8)
 passwd=<>(0)
 host=<127.0.0.1>(9)
 port=<>(0): 0
 params=<rn=0000;npdi>(12)
 headers=<>(0)
```

### Additional Information

This is kamailio from trunk but 4.4 is affected too and I would assume previous versions too

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/953
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20170127/720a8c99/attachment.html>


More information about the sr-dev mailing list