Forums Read-only archive

Using aliases - RESOLVED

5 posts · Brekeke SIP Server Forum

dstu Original post
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
llucy
It is not clear to me. What do you have in the alias database?
The mapping of an IP address and a phone number?

Lucy
dstu
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.
ambrosio
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 = (.+)

=========================
dstu
ambrosio wrote:Push the [Save] button and restart the SIP Server.
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.

I can't restart the server that's running hundreds of sessions (at least)