Dear Daniel,
Thank you for your help.
It works. Thank you for your kind.
Best regards,
Charles
2007/5/23, Daniel-Constantin Mierla <daniel@voice-system.ro>:
Hello,
On 05/23/07 15:02, Charles Wang wrote:
> Dear Daniel,
>
> Nice to meet you.
> Yes, my pdt table is:
> sdomain: caller.openser.ip.address ( the openser's ip address of caller)
> prefix: 444
> domain: callee.openser.ip.address ( the openser's ip address of callee)
>
> But I got "PDT:prefix2domain: no prefix found in [444111]" when
> caller( 222@caller.openser.ip.address
> <mailto:
222@caller.openser.ip.address> ) try to make a call 444111 to
> callee ( 111@callee.openser.ip.address
> <mailto:
111@callee.openser.ip.address> ) using prefix2domain("0", "0")
> in route[0] of openser.cfg.
>
> Would you please give me some tips how to debug it?
try prefix2domain("0", "1"), in this case, because you have sdomain set.
Cheers,
Daniel
>
> Thank you very much.
>
> Best regards,
> Charles
>
>
> 2007/5/23, Daniel-Constantin Mierla <daniel@voice-system.ro
> <mailto:daniel@voice-system.ro>>:
>
> Hello,
>
> sdomain is the source domain -- it is taken from From URI, if you call
> from xyz@aaa.com <mailto:xyz@aaa.com> to 444111@aaa.com
> <mailto:
444111@aaa.com> and want to
> become 111@bbb.com <mailto:111@bbb.com> ,then entry in pdt table
> should be:
>
> sdomain:
aaa.com <http://aaa.com>
> prefix: 444
> domain: bbb.com <http://bbb.com>
>
> Cheers,
> Daniel
>
>
> On 05/23/07 11:57, Charles Wang wrote:
> > Hi all,
> >
> > I try to rewrite
444111@aaa.com <mailto:444111@aaa.com>
> <mailto:444111@aaa.com <mailto:444111@aaa.com>> to
111@bbb.com
> <mailto:111@bbb.com>
> > <mailto:111@bbb.com <mailto:
111@bbb.com>> with pdt module.
> >
> >
> > ############# pdt table in DB ##################
> > mysql> select * from pdt;
> > +----+----------------------+----------+--------------+
> > | id | sdomain | prefix | domain |
> > +----+----------------------+----------+--------------+
> > | 1 | bbb.com <
http://bbb.com> <http://bbb.com> |
> 444 | bbb.com <http://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@aaa.com <mailto:sip:
444111@aaa.com> <mailto: sip
> <mailto:sip>:444111@aaa.com <mailto:444111@aaa.com>>
> F=
sip:222@aaa.com <mailto:sip:222@aaa.com>
> > <mailto:sip <mailto:
sip>:222@aaa.com <mailto:222@aaa.com>> T=
> sip:444111@aaa.com <mailto:
sip:444111@aaa.com>
> > <mailto:sip <mailto:sip>:444111@aaa.com <mailto:
444111@aaa.com>>
> IP=60.244.xxx.xxx
> > ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185
> <mailto:88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185>
> > <mailto:
ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185
> <mailto:ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185>>
> > May 23 15:55:12 localhost openser[22172]: Prefix To Domain I -
> > M=INVITE RURI= sip:444111@aaa.com <mailto:sip:444111@aaa.com>
> <mailto:
sip <mailto:sip>:444111@aaa.com <mailto:444111@aaa.com>>
> > F=
sip:222@aaa.com <mailto:sip:222@aaa.com> <mailto:sip
> <mailto:sip>:
222@aaa.com <mailto:222@aaa.com>>
> T=sip:444111@aaa.com <mailto:sip:
444111@aaa.com>
> > <mailto:sip <mailto:sip>: 444111@aaa.com
> <mailto:
444111@aaa.com>> IP=60.244.xxx.xxx
> > ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185
> <mailto:
88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185>
> > <mailto: ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185
> <mailto:
ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@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 <mailto:
sip:444111@aaa.com>
> <mailto:sip <mailto:sip>:444111@aaa.com <mailto:
444111@aaa.com>>
> > F= sip:222@aaa.com <mailto:sip:222@aaa.com> <mailto:
sip
> <mailto:sip>:222@aaa.com <mailto:222@aaa.com>>
> T=
sip:444111@aaa.com <mailto:sip:444111@aaa.com>
> > <mailto:sip <mailto:sip>:
444111@aaa.com
> <mailto:444111@aaa.com>> IP=60.244.xxx.xxx
> > ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185
> <mailto:88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185>
> > <mailto: ID=
88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185
> <mailto:ID=88BEB1DB-B447-4DAF-A3D6-212DBA3EC628@10.6.1.185>>
> > --
> >
> > Best Regards
> > Charles
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Users mailing list
> > Users@openser.org <mailto:Users@openser.org>
> >
http://openser.org/cgi-bin/mailman/listinfo/users
> >
>
>
>
>
> --
>
> Best Regards
> Charles
--
Best Regards
Charles