Ozzyboshi created an issue (kamailio/kamailio#4743)

### Description

While testing tel2sip(), I observed that the function may return success (1) 
even when the generated SIP URI is not valid and cannot be parsed by internal 
parsing functions such as parse_uri().

After validating the input parameters, tel2sip() constructs the resulting SIP 
URI but does not perform any validation on the final output before returning 
success.

This can lead to inconsistent behavior in later routing stages, where the 
malformed URI is used assuming it is valid.

### Reproduction

The issue can be reproduced with the following snippet (e.g. in request_route):

```
$var(tmp) = "tel:[email protected];user=phone";
$var(tmp_domain) = "10.10.151.23";
tel2sip("$var(tmp)", "$var(tmp_domain)", "$var(tmp)");
xlog("L_NOTICE", "tel2sip launched with «$var(tmp)» and domain 
«$var(tmp_domain)» returned $retcode\n");
```

This produces output similar to:

```
tel2sip launched with 
«sip:playcfannounce@217159599;[email protected];user=phone» and domain 
«10.10.151.23» returned 1
```

The function returns 1 (success) even though the resulting SIP URI is malformed
The generated URI is not valid and cannot be parsed correctly

What I would expect:
  - The function should return an error (-1)
  - the function should ensure the generated URI is parsable before returning 
success


### Additional Information 

```
lsb_release -a
Linux sp2 6.12.85+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.85-1 
(2026-04-30) x86_64 GNU/Linux
root@sp2:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 13 (trixie)
Release:        13
Codename:       trixie

 ```
 
### Operating System: 
```
uname -a
Linux sp2 6.12.85+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.85-1 
(2026-04-30) x86_64 GNU/Linux
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4743
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/[email protected]>
_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to