[Kamailio-Devel] How to check URI protocol ("sip", "sips", "tel") ? How to deal with a TEL URI ?

Iñaki Baz Castillo ibc at aliax.net
Sat Mar 14 12:25:45 CET 2009


El Viernes, 13 de Marzo de 2009, Iñaki Baz Castillo escribió:
> BTW I've realized that in case of receiving a TEL URI ("tel:+1234"), $rU
> shows the TEL number ("+1234") but doing:
>   $rU = "+22222";
> gives an error:
>
>   ERROR:core:parse_uri: bad host in uri (error at char
>   ERROR:core:parse_sip_msg_uri: bad uri <tel:+22222@>
>   ERROR:domain:is_uri_host_local: Error while parsing R-URI
>
> It seems that using "$rU=" inmediatelly converts the URI into a SIP URI.
> How to handle with a TEL URI number?

Well, I already understand what's happening, parse_uri.c contains:

     case TEL_URI_T:
     case TELS_URI_T:
        /* fix tel uris, move the number in uri and empty the host */
        uri->user=uri->host;
        uri->host.s="";
        uri->host.len=0;
        break;

This is, a TEL uri is stored in a struct sip_uri with empty host.
When modyfing $rU the uri will be parsed again to resolve destination and so, 
and it will fail since "@" is automatically added (shouldn't exist in a TEL 
uri).

I've realized that parse_uri() is called after doing "$rU=", but I'm 
inspecting pv_set_ruri_user() and don't find it. Could I know where 
parse_uri() is called after "$rU=" operation?

Thanks.

-- 
Iñaki Baz Castillo



More information about the Devel mailing list