1
votes

Dears,

I use Opensips 2.4

How to use mid_registrar_save("$(rd{ip.resolve})") to mean variable $(rd{ip.resolve}) instead of string "$(rd{ip.resolve})"

Thank you for your help.

User Location

1

1 Answers

0
votes

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;

...
}