Page 300 - Asterisk™: The Future of Telephony
P. 300

; extconfig.conf
                   sippeers => odbc,asterisk,ast_sipfriends
               To also load our SIP users from the database, define it like so:
                   sipusers => odbc,asterisk,ast_sipfriends
               You may have noticed we used the same table for both the sippeers and sipusers. This
               is because there will be a type field (just as if you had defined the type in the sip.conf
               file) that will let us define a type of user, peer, or friend. When defining the table for
               SIP users and peers, we need at least the following:
                   +------+--------+-------+--------+-----+------------+----------+
                   |name  |host    |secret | ipaddr | port| regseconds | username |
                   +------+--------+-------+--------+-----+------------+----------+
                   |100   |dynamic |welcome|        |     |1096954152  |   1000   |
                   +------+--------+-------+--------+-----+------------+----------+
               The port, regseconds, and ipaddr fields are required to let Asterisk store the registration
               information for the peer in order to know where to send the call. This is assuming the
               host is dynamic; however, if the peer is static, we would have to populate the ipaddr
               field ourselves. The port field is optional and would use the default standard port de-
               fined in the [general] section, and the regseconds would remain blank.) There are many
               more options for a SIP friend that we can define, such as the caller ID, and adding that
               information  is  as  simple  as  adding  the  callerid  column  to  the  table.  See  the
               sip.conf.sample file for more options that can be defined for SIP friends.


               Storing Call Detail Records

               Call Detail Records (CDR) contain information about calls that have passed through
               your Asterisk system. They are discussed further in Chapter 13. This is a popular use
               of databases in Asterisk because CDR can be easier to manage if you store the records
               in a database (for example, you could keep track of many Asterisk systems in a single
               table).



                             Setting the systemname for Globally Unique IDs
                  CDRs consist of a unique identifier and several fields of information about the call
                  (including source and destination channel, length of call, last application executed and
                  so forth). In a clustered set of Asterisk boxes, it is theoretically possible to have dupli-
                  cation among unique identifiers since each Asterisk system considers only itself. To
                  address this, we can automatically append a system identifier to the front of the unique
                  ID by adding an option to /etc/asterisk/asterisk.conf. For each of your boxes, set an
                  identifier by adding something like:
                   [options]
                   systemname=toronto




               272 | Chapter 12: Relational Database Integration
   295   296   297   298   299   300   301   302   303   304   305