I don't think macro replacement works inside of strings. I believe you should be able to achieve what you want using [#!defexp](https://github.com/kamailio/kamailio-wiki/blob/main/docs/cookbooks/5.7.x/cor...), as the examples in the core documentation are nearly identical to your example.
``` #!define IPADDR 127.0.0.1
#!defexp SIPURI "sip:" + IPADDR + ":5060" #!defexp QSIPURI '"sip:' + IPADDR + ':5060"'
#!defexp V16 1<<4 ```
Another possibility is using `modparamx()` and interpolating your strings there: ``` #!defenv MYSQL_IP
#!modparamx("permissions, "db_url", "mysql://kamailio:kamailio@$def(MYSQL_IP)/kamailio"); ```
Or even just: ``` #!modparamx("permissions, "db_url", "mysql://kamailio:kamailio@$env(MYSQL_IP)/kamailio"); ```
The last form having the advantage that it's not available via the `core.ppdefines_full` rpc function thus reducing one possible point of exposure.