System information

involved for text-to-speech to really make a lot of sense—otherwise, why not use pre-
recorded prompts instead? However, an idea finally came to us, based on the fact that
having to assign extension numbers to each Skype user we wanted to call was not only
cumbersome, but was a mental exercise we weren’t willing to take on.
The following dialplan makes use of the SKYPE_BUDDIES() and SKYPE_BUDDY_FETCH()
dialplan functions to retrieve all the Skype buddies in memory on the server, and to
read those buddies’ names back to you along with their statuses. After each buddy
name is read, a prompt asking if this is who you wish to call is presented, with the
option of asking for another buddy from the list. We’ve utilized the Festival() appli-
cation for this example (the configuration and setup of which can be found in “Festi-
val” on page 440) to read back the users’ names. Once a buddy has been marked as
selected, it is then dialed using the Dial() application.
Our implementation is as follows:
[LocalSets]
exten => 75973,1,Verbose(2,Read off list of Skype accounts)
same => n,Answer()
same => n,Set(ID=${SKYPE_BUDDIES(pbx.shifteight.org)})
same => n(new_buddy),Set(ARRAY(buddy,status)=${SKYPE_BUDDY_FETCH(${ID})})
same => n,GotoIf($[${ISNULL(${buddy})}]?no_more_buddies)
same => n,Festival(${buddy} is ${status})
same => n,Read(Answer,if-correct-press&digits/1&otherwise-press&digits/2,1)
same => n,GotoIf($[${Answer} = 2]?new_buddy)
same => n,Dial(Skype/${buddy},30)
same => n,Playback(user&is-curntly-unavail)
same => n,Hangup()
exten => no_more_buddies,1,Verbose(2,No more buddies to find)
same => n,Playback(dir-nomore)
same => n,Hangup()
LDAP Integration
Asterisk supports the ability to connect to an existing Lightweight Directory Access
Protocol (LDAP) server to load information into your Asterisk server using the Asterisk
Realtime Architecture (ARA). The advantage of integrating Asterisk and LDAP will
become immediately obvious when you start centralizing your authentication mecha-
nisms to the LDAP server and utilizing it for several applications: you significantly cut
down the administrative overhead of managing your users by placing all their infor-
mation into a central location.
There are both commercial and open source LDAP servers available, the most popular
commercial solution likely being that implemented by Microsoft Windows servers. A
popular open source LDAP server is OpenLDAP (http://www.openldap.org). We will
not delve into the configuration of the LDAP server here, but we will show you the
schema required to connect Asterisk to your server and to use it to provide SIP con-
nections and voicemail service to your existing user base.
434 | Chapter 18:External Services