loadmodule "prefix_route.so"
modparam("prefix_route", "db_url", "mysql://xxxxx:xxxxx@localhost/kamailioDB")
modparam("prefix_route", "db_table", "new_prefix_route")
#PSTN Routing table contains
if (!prefix_route("+44")) {
xlog("L_INFO", "+44 prefix didnt match with prefix_route DB\n");
}
########## DB####
MariaDB [kamailio]> select * from new_prefix_route;
Empty set (0.00 sec)
MariaDB [kamailio]> exit;
##########
Kamailio looks good untill here, no errors..
# Now i have added a prefix into sql DB
INSERT INTO new_prefix_route VALUES ("+44", "10.10.1.1:5060", "route for this prefix");
###########
Error log after adding a prefix into new_prefix_route table & restart of kamailio
0(5802) CRITICAL: prefix_route [prefix_route.c:72]: add_route(): route name '10.10.1.1:5060' is not defined
0(5802) NOTICE: prefix_route [prefix_route.c:170]: pr_db_load(): Total prefix routes loaded: 1
0(5802) ERROR: prefix_route [prefix_route.c:174]: pr_db_load(): error flushing tree
0(5802) CRITICAL: prefix_route [prefix_route.c:212]: mod_init(): db load failed
I have tried a "name" instead of IP (though i dont know how to convert that "name" into a IP:Port), But i am still getting same error using "name" instead of IP:port @ route field in DB.