I haven't implemented this function and didn't dig in the code, but knowing that it comes from Kamailio branch and mostly the SER-originated functions support parameters as expressions with variables, I would say to try the Kamailio style with variables inside string, like:
``` detailed_ipv4_type("$si", "$var(iptype)"); ```
Probably we would need to catch such cases if they cause issues.