Hi all,
I try to rewrite 444111(a)aaa.com to 111(a)bbb.com with pdt module.
############# pdt table in DB ##################
mysql> select * from pdt;
+----+----------------------+----------+--------------+
| id | sdomain | prefix | domain |
+----+----------------------+----------+--------------+
| 1 |
bbb.com | 444 |
bbb.com |
+----+----------------------+----------+--------------+
############## parts of my openser.cfg ##################################3
loadmodule "pdt.so"
modparam("pdt", "db_url",
"mysql://openser:openserrw@localhost/openser")
modparam("pdt", "db_table", "pdt")
modparam("pdt", "domain_column", "sdomain")
modparam("pdt", "prefix_column", "prefix")
modparam("pdt", "prefix", "")
modparam("pdt", "hsize_2pow", 4)
modparam("pdt", "sync_time", 300)
modparam("pdt", "clean_time", 600)
route[0] {
........................(skip)
if (is_method("INVITE")) {
xlog("L_INFO", "Prefix To Domain I - M=$rm RURI=$ru F=$fu T=$tu IP=$si
ID=$ci\n");
prefix2domain("0","0");
xlog("L_INFO", "Prefix To Domain II - M=$rm RURI=$ru F=$fu T=$tu IP=$si
ID=$ci\n");
};
........................(skip)
}
#################### /var/log/message
#######################################
May 23 15:55:12 localhost openser[22172]: New request - M=INVITE RURI=
sip:444111@aaa.com F=sip:222@aaa.com T=sip:444111@aaa.com IP=60.244.xxx.xxx
ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628(a)10.6.1.185
May 23 15:55:12 localhost openser[22172]: Prefix To Domain I - M=INVITE
RURI=sip:444111@aaa.com F=sip:222@aaa.com T=sip:444111@aaa.com IP=
60.244.xxx.xxx ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628(a)10.6.1.185
May 23 15:55:12 localhost openser[22172]: PDT:prefix2domain: no prefix found
in [444111]
May 23 15:55:12 localhost openser[22172]: Prefix To Domain II - M=INVITE
RURI=sip:444111@aaa.com F=sip:222@aaa.com T=sip:444111@aaa.com IP=
60.244.xxx.xxx ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628(a)10.6.1.185
--
Best Regards
Charles