<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.5346.5" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">> Why not just use
numbers?</SPAN><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">I may have to, but I
read that Asterisk would support alphanumeric SIP/IAX extensions and got all
inspired. This started from a desire to run multiple SIP clients, but
using different logins to get around issues with "last registration wins"
ringing behavior and the like. Think of it as seperating the concepts of
"users" from "devices". The other thing contributing to the design is
the need to have a multi-tenant PBX (with some of the users existing in
more than one of the tenants) and have numeric extension lists be local to each
tenant. That is, company A could have extension 1000 be Dave, while
company B's extension 1000 goes to Bill. Similarly, user "dave" might be
extension 1000 at one company and 1011 at another.</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma"></SPAN><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"><o:p><FONT face=Arial color=#000000
size=2></FONT></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">I have three SIP
devices: dave, dave-laptop, and dave-cisco. Each one has a "mailbox=dave"
entry, so I don't end up with three voicemail boxes, and I use that mailbox
setting elsewhere to determine what the "main" SIP device is for a particular
user. The convention I established was that I'd use the person's Active
Directory user id as the first one, and add a hyphen and a descriptor for any
add'l devices.</SPAN><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">The company in
this example is "deskoptional", so there is a context in my dialplan like
this:</SPAN><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">; Extension
map for deskoptional<BR>[deskoptional]<BR>exten =>
1000,1,Goto(switchboard,dave,1)<BR>exten =>
1001,1,Goto(switchboard,andrea,1)<BR>; and so on...</SPAN><SPAN
style="COLOR: black; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">The switchboard
context is used by all tenants to direct traffic to the approprate SIP/IAX
device(s). Note the "dave" one rings all my devices.</SPAN><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">[switchboard]<BR>exten
=>
dave,1,Macro(stdexten,${EXTEN},SIP/dave&SIP/dave-laptop&SIP/dave-cisco)<BR>exten
=> andrea,1,Macro(stdexten,${EXTEN},SIP/andrea)</SPAN><SPAN
style="COLOR: black; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">I decided to make
the voicemail extension be 1, so there's an entry in the appropriate place to
extract the SIP name and truncate it at the first hyphen, so that dave,
dave-laptop, and dave-cisco all get passed as "dave". That's not strictly
necesary, I guess, since all three of them point to the same mailbox
anyway. But it illustrates the technique well.</SPAN><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">exten =>
1,1,Set(target=${CHANNEL:4}-)<BR>exten =>
1,n,Set(target=${CUT(target,,1)})<BR>exten =>
1,n,VoiceMailMain(${target}) </SPAN><SPAN
style="COLOR: black; FONT-FAMILY: 'Courier New'"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">Similarly, I wanted
to handle alphanumeric dialing from softphones. I got around Asterisk's
lack of alphabetic extension matching by using an included subcontext.
This takes a dialed extension like "dave-laptop" and gets the mailbox id from
sip.conf, then calls switchboard with that. Since it's "dave" in all three
cases, this prevents the scenario of me calling somebody from my laptop and
having them try to call me back after I've finished my Americano and gone back
to my desk. A call to any one of my SIP devices will always go to all of
them.</SPAN><SPAN
style="COLOR: maroon; FONT-FAMILY: Tahoma"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"> <o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">[local-sub]<BR>;
This has to be in a sub-context to prevent the wildcard from matching when we
don't want<BR>; it to. This is because Asterisk doesn't handle alphabetic
characters in extension matching,<BR>; but we need a way to handle calls dialed
as alpha.<BR>exten => _., 1,Set(target=${SIPPEER(${EXTEN}:mailbox)})<BR>exten
=> _., 2,NoOp(Target is ${target})<BR>exten => _.,
3,Goto(switchboard,${target},1)</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">All this works
surprisingly well, but for the wee little problem of the VoiceMail
application getting mixed up by alphanumeric extensions that start
with the same letter as one of its flags (s/u/b). It occurs to me that I
could sidestep this and perhaps future problems with alphanumeric by using the
same overall structure, but come up with a numeric representation for the
userids. It'd certainly be a lot easier to just use the names, though, and
since Asterisk at least purportedly supports alphaumeric extensions I'm hoping
this problem is solvable. </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma"></SPAN></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"><SPAN
style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: Tahoma">All I need is a way
to uppercase a string, which from everything I've read so far isn't in the
code. Then again, I could just use all uppercase for my SIP/IAX device
names even if it *does* look ugly. ;)</SPAN></SPAN></P></BODY></HTML>