Traditionally, the save() and mid_registrar_save() functions have always received static parameters for the table name parameter, which is why your string does not get expanded -- it's not meant to. By requiring static strings, the modules are able to initialize their internal data structures on startup for each domain, thus being ready to populate it immediately with AoRs and contacts.
If require a dynamic number of location tables (domains), then I don't see a solution to the problem. However, if the number of such tables is finite on your system, you could use a switch statement:
switch ($(rd{ip.resolve})) {
case "location":
mid_registrar_save("location");
break;
case "location_1":
mid_registrar_save("location_1");
break;
...
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…