System information
Still, when they do get into the office, they’d like the system to know which desks they
are sitting at, so that their calls can be directed there. Also, the boss wants to be able
to track when they are in the office and control calling privileges from those phones
when no one is there.
This need is typically solved by what is called a hot-desking feature, so we have built
one for you in order to show you the power of func_odbc.
Lets start with the easy stuff, and create two desktop phones in the sip.conf file:
; sip.conf
; HOT DESK USERS
[0000FFFF0001]
type=friend
host=dynamic
secret=my_special_secret
context=hotdesk
qualify=yes
[0000FFFF0002]
type=friend
host=dynamic
secret=my_special_secret
context=hotdesk
qualify=yes
; END HOT DESK USERS
These two desk phones both enter the dialplan at the hotdesk context in exten-
sions.conf. If you want to have these devices actually work, you will of course need to
set the appropriate parameters in the devices themselves, but we covered all that in
Chapter 5.
That’s all for sip.conf. We’ve got two slices of bread, which is hardly a sandwich yet.
Now let’s get the database part of it set up (we are assuming that you have an ODBC
database created and working, as outlined in the earlier parts of this chapter). First,
connect to the database console.
For PostgreSQL:
$ sudo su - postgres
$ psql -U asterisk -h localhost asterisk
Password:
Then create the table with the following bit of SQL:
CREATE TABLE ast_hotdesk
(
id serial NOT NULL,
extension int8,
first_name text,
last_name text,
cid_name text,
cid_number varchar(10),
356 | Chapter 16: Relational Database Integration