System information

This would return the value located in the database within the status column where
the extension column equals 1101. The status and 1101 we pass to the
HOTDESK_INFO() function are then placed into the SQL statement we assigned to the
readsql attribute, available as ${ARG1} and ${ARG2}, respectively. If we had passed a
third option, this would have been available as ${ARG3}.
Multirow Functionality with func_odbc
As of Asterisk branch 1.6.0, a mode exists that allows Asterisk to handle multiple rows
of data returned from the database. For example, if we were to create a dialplan function
in func_odbc.conf that returned all available extensions, we would need to enable mul-
tirow mode for the function. This would cause the function to work a little differently,
returning an ID number that could then be passed to the ODBC_FETCH() function to
return each row in turn.
Prior to the 1.6.0 branch, we needed to use the SQL functions LIMIT and OFFSET in order
to control data being returned to Asterisk for iteration. This was resource-intensive (at
least in relation to multirow mode), as it required multiple queries to the database for
each row.
Figure 16-1. Relationships between func_odbc.conf, res_odbc.conf, /etc/odbc.ini (unixODBC), and
the database connection
360 | Chapter 16:Relational Database Integration