register Statements



A  register statement is a way of telling a remote  peer where your Asterisk box is in
relation to the Internet. Asterisk uses register statements to authenticate to remote
providers when you are employing a dynamic IP address, or when the provider does
not have your IP address on record. There are situations when a register statement is
not required, but to demonstrate when a register statement is required, let’s look at
an example.
Say you have a remote peer that is providing DID services to you. When someone calls
the number +1-800-555-1212, the call goes over the physical PSTN network to your
service provider and into its Asterisk server, possibly over its T1 connection. This call
is then routed to your Asterisk server via the Internet

Your service provider will have a definition in either its sip.conf or iax.conf configuration
file (depending on whether you are connecting with the SIP or IAX protocol, respec-
tively) for your Asterisk server. If you receive calls only from this provider, you would
define  them  as a user (if it  was another Asterisk system, you might be defined in  its
system as a peer).
Now let’s say that your box is on your home Internet connection, with a dynamic IP
address. Your service provider has a static IP address (or perhaps a fully qualified do-
main name), which  you place  in  your  configuration file.  Since you  have  a dynamic
address, your service provider specifies host=dynamic in its configuration file. In order
to know where to route your +1-800-555-1212 call, your service provider needs to know
where you are located in relation to the Internet. This is where the register statement
comes into use.
The register statement is a way of authenticating and telling your peer where you are.
In the [general] section of your configuration file, you place a statement similar to this