Hello Ben
dialplan module should help you: http://kamailio.org/docs/modules/3.2.x/modules/dialplan.html
Regards
Javi
Message: 5 Date: Fri, 17 Feb 2012 12:49:04 +1300 From: Ben WIlliams benwilliams@joobworld.com Subject: Re: [SR-Users] How to do request URI rewrites using database tables? To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List" sr-users@lists.sip-router.org Message-ID: <CANfYGQkeK3i=vBbdox+ekGeeKmjWhhgarUJcAo3oV=rrO=Wwig@mail.gmail.com
Content-Type: text/plain; charset=ISO-8859-1
I've managed to get dbaliases and lcr to do most of this. But the lcr prefix does not allow regular expressions. Is there any other module that allows you to store in the database a regular expression rewrite rule?
On Thu, Feb 16, 2012 at 1:21 PM, Ben WIlliams benwilliams@joobworld.com wrote:
Hi, can someone please recommend the most appropriate modules to rewrite R-URIs based on a database lookup table? I've read the documentation for lcr and carrierroute but not sure if they can do this.
In most cases it will be a simple R-URI rewrite but I also need to rewrite based on From user.
ie
R-URI match ? ? ? ? ? ? From match ? ? ? ? ? ? ? ? ?new R-URI =========== ? ? ? ? ? ? ========== ? ? ? ? ? ? ? ? ?========= *97@example.com ? ? ? ? 6[0-9]@example.com ? ? ? ? ?*97@10.0.0.1 *97@example.com ? ? ? ? 7[0-9]@example.com ? ? ? ? ?*97@10.0.0.2 6[0-9]@example.com ? ? ?match any ? ? ? ? ? ? ? ? ? rewrite domain to
10.0.0.1
abc@example.com ? ? ? ? match any ? ? ? ? ? ? ? ? ? def@example.com
Thanks Ben
Thanks Javi,
I'm trying to debug my dialplan but this command does not work : sercmd dp_translate 1 "abcdxyz" It is kamailio 3.2.2 Also, are there any resources that explain how dialplan works other than the supplied documentation?
Thanks Ben
On Fri, Feb 17, 2012 at 7:36 PM, Javier Gallart jgallartm@gmail.com wrote:
Hello Ben
dialplan module should help you: http://kamailio.org/docs/modules/3.2.x/modules/dialplan.html
Regards
Javi
Message: 5 Date: Fri, 17 Feb 2012 12:49:04 +1300 From: Ben WIlliams benwilliams@joobworld.com Subject: Re: [SR-Users] How to do request URI rewrites using database tables? To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List" sr-users@lists.sip-router.org Message-ID:
CANfYGQkeK3i=vBbdox+ekGeeKmjWhhgarUJcAo3oV=rrO=Wwig@mail.gmail.com Content-Type: text/plain; charset=ISO-8859-1
I've managed to get dbaliases and lcr to do most of this. But the lcr prefix does not allow regular expressions. Is there any other module that allows you to store in the database a regular expression rewrite rule?
On Thu, Feb 16, 2012 at 1:21 PM, Ben WIlliams benwilliams@joobworld.com wrote:
Hi, can someone please recommend the most appropriate modules to rewrite R-URIs based on a database lookup table? I've read the documentation for lcr and carrierroute but not sure if they can do this.
In most cases it will be a simple R-URI rewrite but I also need to rewrite based on From user.
ie
R-URI match ? ? ? ? ? ? From match ? ? ? ? ? ? ? ? ?new R-URI =========== ? ? ? ? ? ? ========== ? ? ? ? ? ? ? ? ?========= *97@example.com ? ? ? ? 6[0-9]@example.com ? ? ? ? ?*97@10.0.0.1 *97@example.com ? ? ? ? 7[0-9]@example.com ? ? ? ? ?*97@10.0.0.2 6[0-9]@example.com ? ? ?match any ? ? ? ? ? ? ? ? ? rewrite domain to 10.0.0.1 abc@example.com ? ? ? ? match any ? ? ? ? ? ? ? ? ? def@example.com
Thanks Ben