1. Brekeke Product Name and Version:
Brekeke SIP Server , Version 3.2.4.3 Advanced
5. Your problem:
I need help in defining/using aliases.
I have several rules that I move up and down, depending on the destination application server. I understand that an alias can make my life easier by reducing the number of rules in the dial-plan, but I don't know how.
These are the examples of rules I currently have:
Rule1:
--------------------------
[Matching Patterns:]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
[Deploy Patterns:]
To = sip:%1@server01.mynet.lan
$session = failover sip:%1@server02.mynet.lan
--------------------------
Rule2:
--------------------------
[Matching Patterns:]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
[Deploy Patterns:]
To = sip:%1@server02.mynet.lan
$session = failover sip:%1@server03.mynet.lan
--------------------------
Rule3:
[Matching Patterns:]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
[Deploy Patterns:]
To = sip:%1@server03.mynet.lan
$session = failover sip:%1@server01.mynet.lan
--------------------------
How can I use aliases to reduce the number of rules and once done, how do I use the aliases to change the routing quickly?
Thank you in advance,
David
Using aliases - RESOLVED
Moderator: Brekeke Support Team
Using aliases - RESOLVED
Last edited by dstu on Thu Dec 25, 2014 6:39 am, edited 1 time in total.
I figured it out.
I do the following:
--------------------------
[Matching Patterns:]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
$alias.lookup("server1") = (.+)
$alias.lookup("server2") = (.+)
[Deploy Patterns:]
To = sip:%1@%2
$session = failover sip:%1@%3
--------------------------
In the aliases table, I have these entries:
--------------------------
server1, servers, server01.mynet.lan
server2, servers, server02.mynet.lan
--------------------------
I can change manually the servers entries in the aliases table and the changes are applied immediately.
I do the following:
--------------------------
[Matching Patterns:]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
$alias.lookup("server1") = (.+)
$alias.lookup("server2") = (.+)
[Deploy Patterns:]
To = sip:%1@%2
$session = failover sip:%1@%3
--------------------------
In the aliases table, I have these entries:
--------------------------
server1, servers, server01.mynet.lan
server2, servers, server02.mynet.lan
--------------------------
I can change manually the servers entries in the aliases table and the changes are applied immediately.
dstu,
Your DialPlan works but it has two "$alias.lookup" lines.
It means there will be two database calls.
How many "serverX" definitions do you have? (or are you planning?)
If there are few, I don't recommend you use the Alias.
Here is another solution. This solution doesn't require any database accesses.
=========================
1. Go to the [Configuration]->[Advanced] page.
2. Add the lines like the following.
--------------------------------------
my.server1=server01.mynet.lan
my.server2=server02.mynet.lan
--------------------------------------
3. Push the [Save] button and restart the SIP Server.
4. Use this Matching Patterns.
[Matching Patterns]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
&my.server1 = (.+)
&my.server2 = (.+)
=========================
Your DialPlan works but it has two "$alias.lookup" lines.
It means there will be two database calls.
How many "serverX" definitions do you have? (or are you planning?)
If there are few, I don't recommend you use the Alias.
Here is another solution. This solution doesn't require any database accesses.
=========================
1. Go to the [Configuration]->[Advanced] page.
2. Add the lines like the following.
--------------------------------------
my.server1=server01.mynet.lan
my.server2=server02.mynet.lan
--------------------------------------
3. Push the [Save] button and restart the SIP Server.
4. Use this Matching Patterns.
[Matching Patterns]
$request = ^INVITE
$addr = x.x.x.x
To = sip:(123456)@
&my.server1 = (.+)
&my.server2 = (.+)
=========================
The whole point of using the aliases mechanism is that I can manually reroute the traffic by changing the entity server name from 01 to 02 or 03 or 04... and I don't even have to "Apply" the change.ambrosio wrote:Push the [Save] button and restart the SIP Server.
I can't restart the server that's running hundreds of sessions (at least)