Saturday, July 28, 2007

Adding SIP aliases to Trixbox/Asterisk Extensions

One nice feature of SIP is the ability to have an easy-to-remember URI rather than a long phone number to contact someone with.

By default Trixbox doesn't give you an option to assign an alias, and you are stuck with receiving calls only to your extension numbers. If someone from outside your organization wants to call you, they have to call something like sip:123@mysipdomain.com.

The good news is that we can manually add these aliases into the Asterisk configuration files.

From the Trixbox admin web interface, select Asterisk, then Config Edit. Select extensions_custom.conf, and add the following to the end of the file.

[ext-local-custom]
exten => ryan,1,Goto(400,1)
exten => support,1,Goto(400,1)
exten => mark,1,Goto(401,1)
exten => jason,1,Goto(402,1)

This example will forward any calls to ryan@mysipdomain.com or support@mysipdomain.com to extension 400, calls for mark@mysipdomain.com to extension 401, and calls for jason@mysipdomain.com to extension 402.

4 comments:

Hugh said...

Thats a great tip, thanks Ryan.

I've set up some aliases for information calls such as weather and time on my domain.

How secure are sip uri's though ?
I've set up my asterisk phonebook, and if someone dials 411@mydomain.com they'll be presented with the phone directory. I dont want an anonymous caller to be able to initiate calls to my contacts.

I've got a pin set on the outbound route, but having to type in extra digits before every phone call is a bit of an annoyance.

Ryan Newington said...

Hi Hugh,

I would put something like

exten => 411,n,Hangup

in [from-sip-external]

Which will disconnect anyone who tried to call your directory service from outside your organisation.

Cheers

Ryan

Hugh said...

Hi Ryan,

Thanks for the suggestion.

I'll do that for all my feature codes as I'd like to only allow outside access to the extensions and applications that I've specified with aliases and deny access to all others.

Seems like a glaring insecurity if the feature codes are accessible straight out of the box, as anyone could sip:555@mydomain.com and listen in on your phone conversations!

Cheers
John.
(Hugh is just a posting name)

Ryan Newington said...

Hi John,

You are right, it doesn't seem too wise. There might be an easier way to do this, it might be worth asking the question on one of the Asterisk forums.

Ryan