Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
Using aliases - RESOLVED
Author Message
dstu
Brekeke Talented


Joined: 06 Feb 2006
Posts: 72

PostPosted: Tue Dec 23, 2014 7:40 am    Post subject: Using aliases - RESOLVED Reply with quote

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


Last edited by dstu on Thu Dec 25, 2014 6:39 am; edited 1 time in total
Back to top
View user's profile
llucy
Brekeke Talented


Joined: 31 Jan 2014
Posts: 52

PostPosted: Wed Dec 24, 2014 12:38 pm    Post subject: Reply with quote

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
Back to top
View user's profile
dstu
Brekeke Talented


Joined: 06 Feb 2006
Posts: 72

PostPosted: Thu Dec 25, 2014 6:38 am    Post subject: Reply with quote

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.
Back to top
View user's profile
ambrosio
Brekeke Master Guru


Joined: 27 Mar 2008
Posts: 215

PostPosted: Fri Dec 26, 2014 11:50 am    Post subject: Reply with quote

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

=========================
Back to top
View user's profile
dstu
Brekeke Talented


Joined: 06 Feb 2006
Posts: 72

PostPosted: Sat Dec 27, 2014 1:05 am    Post subject: Reply with quote

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)
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1