System information
Details on how to handle all of this in your dialplan are beyond the scope of this book.
Suffice it to say that in your dialplan you will still need to handle the values that your
subroutine creates or assigns.
Dialing SIP URIs from Asterisk
Asterisk can dial a SIP URI as easily as any other sort of destination, but it is the endpoint
(namely, your telephone) that is ultimately going to shoulder the burden of composing
the address, and there lies the difficulty.
Most SIP telephones will allow you to compose a SIP URI using the dialpad. This sounds
like a great idea at first, but since there are no typewriter keys on a phone set, in order
to dial something like jim.vanmeggelen@shifteight.org what you would need to ac-
tually input into the phone would be something along the lines of:
5-444-6-*-888-2-66(pause)-6-33-4(pause)-4-33-555-33-66-#-7777-44(pause)-444-333-8-33-
444-(pause)-4(pause)-44-8-*-666-777-4
To support this in your dialplan, you would need something similar to this
†
:
exten => _[0-9a-zA-Z].,1,Verbose()
same => n,Set(FilteredExtension=${FILTER(0-9a-zA-Z@-_.,${EXTEN})})
same => n,Dial(SIP/${FilteredExtension})
It’s simple, it’s fun, and it works! … ?
The reality is that until all phones support complex and flexible address books, as well
as a QWERTY-style keyboard (perhaps via touchscreen), SIP URI dialing is not going
to take off.
If you have a SIP URI that you want to dial on a regular basis (for example, during the
writing of this book there were many calls made between Jim and Leif), you could add
something like this to your dialplan:
exten => 5343,1,Dial(SIP/leif.madsen@shifteight.org)
With this in your dialplan, you could dial 5343 (LEIF) on your phone and the Asterisk
dialplan would translate it into the appropriate SIP URI. It’s not practical for a large
number of URIs, but for a few here and there it can be a helpful shortcut.
Nevertheless, keep reading, because there are some very useful components of DNS
that simplify the process of dialing directly between systems without the use of the
PSTN.
† Technically, the characters ! # $ % & ' * + / = ? ^ ` { | } ~ are also valid as part of the local-part of an
email address; however, they are uncommon, and we have elected not to allow them in our dialplan examples.
246 | Chapter 12: Internet Call Routing