To clarify, there are C functions to actually parse a a URI component, that gives you control about what parts you want to access, [link](https://github.com/kamailio/kamailio/blob/5a2df203a244e79a1868910da312f76509...)
Thanks for the example - I fixed it that way and will commit it