Handset Variable

Handset Variable

The $Handset variable provides information regarding how the handset is configured the following properties are available:

MethodResultDescription
getHandsetProperty(key)HandsetPropertyReturns the Handset Property associated with the give key.
getHandsetProperties()HashMap<String, HandsetProperty>Returns a hashmap of all handset properties associated with this handset.
getIteratorForPrefix(String keyPrefix)Iterator<String>Returns an iterator containing all of the keys which match the given prefix.
existsProperty(key)booleanReturns true if the given handset property exists.

HandsetProperty

The HandsetProperty object provides details of a property which has been associated with the handset via the Handset UI.

A HandsetProperty contains the following methods

String getKey() - the key to the property

String getValue() - the value associated with the key

String getValue2() - the value associated with the key

String getValue3() - the value associated with the key

String getValue4() - the value associated with the key

String getValue5() - the value associated with the key

String getType() - the type of the key. The supported types are 'Dial and Status' and 'Other'.

Using the property Iterator

This example shows how to program the yealink memory keys using properties.

 
#set($propIter = $Handset.getIteratorForPrefix("Button"))
#foreach ($key in $propIter)
    #set($handsetProperty = $Handset.getHandsetProperty($key))
    #set($button = $handsetProperty.getValue())
    #set($extension = $handsetProperty.getValue2())
    memorykey.${button}.line = 1
    memorykey.${button}.type = 16
    memorykey.${button}.pickup_value = $extension
    memorykey.${button}.value = $extension
#end

Available Keys

KeyValue
OperatingContextThe context the handset will be placed in.
DTMFMode
NAT
Allow
DisAllow
Permit
Deny
PickupGroup
CallGroup
Voicemail.Context
Voicemail.deleteVoicemail
Voicemail.attachVoicemailSoundFile
Voicemail.voicemailNotification
Voicemail.hideFromDirectory