[Asterisk-doc] docs chapter06.xml,1.2,1.3
blitzrage
asterisk-doc@lists.digium.com
Sun, 21 Dec 2003 00:29:42 +0000
Comments:
Update of /cvsroot/asterisk/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv18934/docs
Modified Files:
chapter06.xml
Log Message:
blitzrage
- add in Peter Grace's ENUM documentation to chapter 6
(NOTE: The ENUM DNS entry is too long to fit on one line, but not
too sure exactly how to correct that, someone please inform me how
this should be done)
Index: chapter06.xml
===================================================================
RCS file: /cvsroot/asterisk/docs/chapter06.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** chapter06.xml 15 Dec 2003 18:51:25 -0000 1.2
--- chapter06.xml 21 Dec 2003 00:29:37 -0000 1.3
***************
*** 222,227 ****
<listitem><para>Second is the driver dependent address (REMOTE nic MAC address)</para></listitem>
<listitem><para>Third is the number of channels to be configured</para></listitem>
! <listitem><para>And, lastly, what sort of timing to provide
! </para></listitem>
</itemizedlist>
</para>
--- 222,226 ----
<listitem><para>Second is the driver dependent address (REMOTE nic MAC address)</para></listitem>
<listitem><para>Third is the number of channels to be configured</para></listitem>
! <listitem><para>And, lastly, what sort of timing to provide</para></listitem>
</itemizedlist>
</para>
***************
*** 358,363 ****
</sect1>
<sect1>
<title>ENUM/E164 Call Routing (LCR)</title>
! <para/>
</sect1>
<sect1>
--- 357,625 ----
</sect1>
<sect1>
+ <!-- OK, Olle sent to the list that apparently we can't call ENUM like
+ structures ENUM because the developer doesn't really like it. I personally
+ disagree with this, as I think ENUM should be a generic term, but hey, I
+ didn't develop it. Perhaps someone should look at this and double check
+ some stuff for the sake of politics. -->
+
<title>ENUM/E164 Call Routing (LCR)</title>
! <sect2>
! <title>Introduction</title>
! <para>
! ENUM is a telephony technology that may single-handedly create the greatest changes
! in both internet telephony as well as regular telephone service. In a nutshell, ENUM
! is a technology which allows users of disparate networks and technologies to call each
! other through the use of a common routing database. This database is stored in DNS
! records on a centralized server.
! </para>
!
! <!-- NOTE: This entry is too long to go on one line, but not totally sure how it should be changed! -->
! <figure id="enum-fig1"><title>A sample ENUM entry in a DNS record</title>
! <programlisting>
! 5.4.3.2.1.enum.fierymoon.com. NAPTR 100 10 "u" "E2U+IAX2" "!^\\+(.*)$!iax2:guest@127.0.0.1/\\1@local!" .
! </programlisting>
! </figure>
!
! <para>
! In the above figure, the record would be parsed by an ENUM compatible system to read
! "Phone number 12345 is to be redirected to iax2:guest@127.0.0.1/12345@local" All of
! the weird mumbo jumbo in the lines is important - they're called Regular Expressions
! and it's a topic too big to be covered in this documentation.
! </para>
! </sect2>
! <sect2>
! <title>Making ENUM Work for You</title>
!
! <para>
! Imagine you're the phone company, and you want to offer a new service that allows a
! single phone number (say, your home number) to ring multiple phones at once.
! With ENUM, this is painfully simple. You would simply create multiple enum entries
! for the same number, and increment the priority in the NAPTR line (For hints on how
! NAPTR's work, check the BIND/DNS documentation.)
! </para>
!
! <para>
! For most users, though, ENUM has an even more useful implication: Free long distance
! calling over the internet. Take
! <ulink url="http://enum.fierymoon.com">http://enum.fierymoon.com</ulink> , a production
! ENUM registry and database. By simply adding what exchanges your system can call
! locally, suddenly people from all over the world can utilize your Asterisk system to
! make calls that would otherwise cost an arm and a leg.
! </para>
!
! <para>
! As an example, let's take John Q. Public, who's recently moved to India to follow a tech
! job. He has family back in Seattle that he wishes he could talk to on a daily basis.
! Before, he would have to have either an expensive calling card, or some other homebrew
! solution for point-to-point internet dialing. Now, with the beauty of ENUM, John can use
! enum.fierymoon.com with his hobby asterisk box to see if there is an ENUM entry in Seattle.
! Let's say that Mike Hunt has a T1 in Seattle and seldom uses it after hours - he can set up
! his ENUM records to let everyone who uses the ENUM database utilize his local calling area.
! Suddenly John Q. is making his calls to family and friends for only the cost of his internet
! connection.
! </para>
! </sect2>
!
! <sect2>
! <title>Setting up ENUM Routing on your Asterisk System</title>
!
! <para>
! ENUM is a relatively easy item to setup on your asterisk system. If you're looking to dial
! out, it's as simple as using the EnumLookup application with a properly configured
! enum.conf (examples below.) If you're looking to be an endpoint of ENUM (i.e., if you'd like
! to donate some of your phone service to someone in need) then there is just a bit more work
! to be done.
! </para>
!
! <sect3>
! <title>enum.conf</title>
!
! <para>
! This configuration file is blindingly simple. It has but one directive type, "search".
! Let's say you've got five separate ENUM sources you'd like to look up from, you'd simply
! list them in individual search lines:
! </para>
!
! <figure id="enum-fig2"><title>enum.conf</title>
! <programlisting>
! <lineannotation>
! ; ENUM Configuration for resolving phone numbers over DNS
! ;
! </lineannotation>
! [general]
! <lineannotation>
! ;
! ; The search list for domains may be customized. Domains are searched
! ; in the order they are listed here.
! ;
! </lineannotation>
! search => enum.fierymoon.com
! search => e164.arpa
! </programlisting>
! </figure>
!
! <para>
! Remember to restart when you change this file, or else the changes
! will not be immediately accepted.
! </para>
! </sect3>
!
! <sect3>
! <title>extensions.conf</title>
!
! <para>
! Once you've changed your enum.conf file, it is just a matter of adding
! some extensions to allow you to dial on ENUM:
! </para>
!
! <figure id="enum-fig3"><title>extensions.conf (snippet)</title>
! <programlisting>
! [enumcheck]
! exten => _41NXXNXXXXXX,1,EnumLookup(<replaceable>${EXTEN:1}</replaceable>)
! exten => _41NXXNXXXXXX,2,Dial(<replaceable>${ENUM}</replaceable>)
! exten => _41NXXNXXXXXX,3,Hangup
! exten => _41NXXNXXXXXX,102,Hangup
! </programlisting>
! </figure>
!
! <para>
! In this example, the user would dial 4 followed by the number they were
! attempting to call (This extension example utilizes NANPA numbers, i.e.,
! North America, only.) The EnumLookup application stores the correct URL
! to dial in the ${ENUM} variable if the lookup succeeds.
! </para>
! </sect3>
! </sect2>
!
! <sect2>
! <title>Configuring your System to Allow ENUM Calls through your PSTN Interface</title>
!
! <para>
! Allowing users to dial out of your PSTN interface is quite a noble thing to do!
! However, you'll want to protect yourself to make sure your nobility is not exploited
! for someone else's gains! Hopefully in this section you will understand the necessity
! of protecting your phone bill.
! </para>
!
! <para>
! There are a few steps involved in setting up your dial-out ENUM configuration:
! </para>
!
! <orderedlist>
! <listitem>
! <para>Decide which technology you will use for allowing phone calls,
! be it IAX2, SIP, H323, or any other technology that can be formed into a
! URI.</para>
! </listitem>
! <listitem>
! <para>Find a list of local exchanges that you can call and keep it handy
! - you will need it later.</para>
! </listitem>
! <listitem>
! <para>Configure your iax.conf, sip.conf, h323.conf, or any other
! configuration files that will require modifications for the particular
! protocol you are intending to interface.</para>
! </listitem>
! <listitem>
! <para>Configure your extensions.conf to have a context specifically for
! allowing ENUM dialout.</para>
! </listitem>
! <listitem>
! <para>Add the local exchanges that you found into your astdb so that you
! can look them up with your extension.</para>
! </listitem>
! </orderedlist>
!
! <para>
! (As a note, I believe that Asterisk only supports IAX2 and SIP as well as PSTN
! for the URI's enum will return - I cannot be 100% sure of this so anyone in-the-know
! is free to correct me) In our examples, we will be using an iax2 user for
! receiving our calls.
! </para>
!
! <sect3>
! <title>iax.conf</title>
! <figure id="enum-fig4"><title>Sample iax.conf configuration for an enum user</title>
! <programlisting>
! [enumuser]
! type=user
! context=enumloc
! callerid="Enum Lookup" <000>
! disallow=all
! allow=ilbc
! accountcode=enumuser
! </programlisting>
! </figure>
!
! <para>
! Our IAX user setup is pretty simple. All this user needs to do is allow
! calls into our ENUM outbound context. In this example, I have limited
! the only available codec to iLBC, so I can cut down on bandwidth consumed
! in the process. I've also assigned an account code of enumuser, so that
! when I pull my CDR records I can see who's using the ENUM.
! </para>
! </sect3>
!
! <sect3>
! <title>extensions.conf</title>
! <figure id="enum-fig5"><title>Sample extensions.conf logic for inbound calls</title>
! <programlisting>
! [enumloc]
! exten => _1NXXNXXXXXX,1,SetVar(enumok=0)
! exten => _1NXXNXXXXXX,2,ODBCget(enumok=${EXTEN:1:3}/${EXTEN:4:3})
! exten => _1NXXNXXXXXX,3,GotoIf(${enumok}?4:900)
! exten => _1NXXNXXXXXX,4,ChanIsAvail(Zap/1)
! exten => _1NXXNXXXXXX,5,Dial(Zap/1/${EXTEN})
! exten => _1NXXNXXXXXX,6,Hangup
! exten => _1NXXNXXXXXX,105,Playback(enum-inuse)
! exten => _1NXXNXXXXXX,106,Hangup
! exten => _1NXXNXXXXXX,900,Congestion
! </programlisting>
! </figure>
!
! <para>
! This extension takes a little bit of explanation (There's a lot going on
! here, so pay attention!) First of all, we initialize a local variable,
! ${enumok} to 0. This allows us to have a default variable in case our
! astdb lookup returns nothing. Priority two does the actual astdb lookup.
! It's pretty simple, it asks whether the area code and prefix are in the
! astdb database - if they are, great, priority three makes processing
! continue at step four. If they are not, then they are played a congestion
! tone at priority 900. At step 4, we ask whether our only FXO device,
! Zap/1, is in use. If it isn't, we do the dialing required to complete
! the call. If our Zapata device is in use, we playback the file "enum-inuse"
! and then hangup.
! </para>
! <para>
! Now, some of you must be wondering - "How do I get my extensions into the astdb?"
! Well, that's a hard question to answer, unless you are using ODBCget as opposed to DBGet.
! I'll give you a bit of a hint here:
! </para>
!
! <figure id="enum-fig6"><title>How to create SQL insert queries from a standard
! NANPA CO/CLEC list</title>
! <programlisting>
! <?
! $fp=fopen("./lpref","r");
! while (!feof($fp))
! {
! $line=fgets($fp);
! list($npa,$nxx,$desc,$zone) = split(";", $line, 4);
! echo "INSERT INTO \"astdb\"
! (\"astfamily\",\"astkey\",\"astvalue\")
! VALUES('".$npa."','".$nxx."','1');\n";
! }
! fclose($fp);
! ?>
! </programlisting>
! </figure>
!
! <para>
! After a reload of asterisk, your box should be ready to receive calls via
! IAX2 with username "enumuser", with calls bound to context "enumloc" - your
! lookups should make sure the call is local to you, and then pass it along.
! </para>
! </sect3>
! </sect2>
</sect1>
<sect1>