[Users] How to use pdt module correctly?

Daniel-Constantin Mierla daniel at voice-system.ro
Wed May 23 11:18:27 CEST 2007


Hello,

sdomain is the source domain -- it is taken from From URI, if you call 
from xyz at aaa.com to 444111 at aaa.com <mailto:444111 at aaa.com> and want to 
become 111 at bbb.com <mailto:111 at bbb.com>, then entry in pdt table should be:

sdomain: aaa.com
prefix: 444
domain: bbb.com

Cheers,
Daniel


On 05/23/07 11:57, Charles Wang wrote:
> Hi all,
>  
> I try to rewrite 444111 at aaa.com <mailto:444111 at aaa.com> to 111 at bbb.com 
> <mailto:111 at bbb.com> with pdt module. 
>  
>  
> ############# pdt table in DB ##################
> mysql> select * from pdt;
> +----+----------------------+----------+--------------+
> | id | sdomain           | prefix   | domain    |
> +----+----------------------+----------+--------------+
> |  1 |  bbb.com <http://bbb.com>          | 444      | bbb.com 
> <http://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 at aaa.com <mailto:sip:444111 at aaa.com> F=sip:222 at aaa.com 
> <mailto:sip:222 at aaa.com> T= sip:444111 at aaa.com 
> <mailto:sip:444111 at aaa.com> IP=60.244.xxx.xxx 
> ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628 at 10.6.1.185 
> <mailto:ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628 at 10.6.1.185>
> May 23 15:55:12 localhost openser[22172]: Prefix To Domain I - 
> M=INVITE RURI= sip:444111 at aaa.com <mailto:sip:444111 at aaa.com> 
> F=sip:222 at aaa.com <mailto:sip:222 at aaa.com> T=sip:444111 at aaa.com 
> <mailto:sip:444111 at aaa.com> IP=60.244.xxx.xxx 
> ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628 at 10.6.1.185 
> <mailto:ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628 at 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 at aaa.com <mailto:sip:444111 at aaa.com> 
> F=sip:222 at aaa.com <mailto:sip:222 at aaa.com> T=sip:444111 at aaa.com 
> <mailto:sip:444111 at aaa.com> IP=60.244.xxx.xxx 
> ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628 at 10.6.1.185 
> <mailto:ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628 at 10.6.1.185>
> -- 
>
> Best Regards
> Charles
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>   




More information about the sr-users mailing list