System information

Column name Column type
secret Varchar 128
context Varchar 128
host Varchar 128
ipaddr Varchar 128
port Varchar 5
regseconds Bigint
defaultuser Varchar 128
fullcontact Varchar 128
regserver Varchar 128
useragent Varchar 128
lastms Integer
For each peer you want to register, you need to insert data in the columns type, name,
secret, context, host, and defaultuser. The rest of the columns will be populated au-
tomatically when the peer registers.
The port, regseconds, and ipaddr fields are required to let Asterisk store the registration
information for the peer so it can determine where to send the calls. (Note that if the
peer is static, you will have to populate the ipaddr field yourself.) The port field is
optional and defaults to the standard port defined in the [general] section, and the
regseconds will remain blank. Table 16-4 lists some sample values that we’ll use to
populate our ast_sipfriends table.
Table 16-4. Example information used to populate the ast_sipfriends table
Column name Value
type friend
name 0000FFFF0008
defaultuser 0000FFFF0008
host dynamic
secret welcome
context LocalSets
Prior to registering your peer, though, you need to enable realtime caching in
sip.conf. Otherwise, the peer will not be loaded into memory, and the registration will
not be remembered. If your peers only place calls and don’t need to register to your
system, you don’t need to enable realtime caching because the peers will be checked
against the database each time they place a call. However, if you load your peers into
memory, the database will only need to be contacted on initial registration, and after
the registration expires.
Using Realtime | 373