An alias is a telephone number that can bound to a specific SER user account or any SIP URI for that matter, even if the SIP URI is not served by your SIP proxy. A common use of an alias is toll free numbers. Many times a toll free number simply "points" to a real DID (ie a real telephone number).
When you dial the toll free number, the DID actually receives the call.
An important thing to understand about aliases is that you cannot register against the SIP proxy using the alias. Instead, you must register with a regular user account. Then when somebody dials the alias the SIP URI that is bound to the alias will ring.
To use aliases you simply need to include this code snippet in your ser.cfg:
route {
# sanity checks
if (method!="REGISTER") record_route();
if (loose_route()) {
# perform record-routing logic
break;
};
lookup("aliases");
if (uri!=myself) {
t_relay();
break;
};
if (!lookup("location")) {
# normal processing
};
# other processing
}
The line lookup("aliases") is all that is needed in order to use aliases. After you call lookup("aliases") you should make sure the destination is still your own SER proxy because an alias can point to ANY sip uri.
So now that ser.cfg is "alias aware", how do you create an alias?
Well assuming you have a regular SER user account called sip:1000@mycompany.com and wanted to create an alias called sip:9995551212@mycompany.com you can issue this command from a terminal window:
serctl alias add 9995551212 sip:1000@mycompany.com
Now anytime somebody dials 9995551212 the extension at 1000 will receive the call.
If you receive the following error when you issue the "serctl alias add" command then you probably omitted the lookup("aliases") command in your ser.cfg.
error: 400; check if you use aliases in SER