Valid Options
e: Both subtype and message fields are base64 encoded. This is necessary for complex strings
containing commas and newline characters. When this option is used, the PRESENCE_STATE function knows
it must first base64 decode the subtype and message fields before setting them on the CustomPresence
provider.
Read Syntax
STATE_VALUE = ${PRESENCE_STATE(<presence state provider>,field[,options])}
Valid read fields arguments
value
subtype
message
Valid read options
e: Base64 encode the return value when the field argument is subtype or message.
Dialplan Examples
Dialplan Write Examples
Example1: Set Batman's state to "Away" with the subtype "In the batcave" with the message, "Making a new batch of batarangs".
Set((PRESENCE_STATE(CustomPresence:Batman)=away,In the batcave, Making a new batch of batarangs)
Example2: Building on example1, now set Batman's state to "extended away" with no subtype while maintaining the message "Making a new
batch of batarangs"
Set(PRESENCE_STATE(CustomPresence:Batman)=extended away,,Making a new batch of batarangs)
Example3: Setting the state as available without providing a subtype or message string. This will clear any previous message strings.
Set(PRESENCE_STATE(CustomPresence:Batman)=avaliable)
Example4: Set complex subtype and message strings using base64 encoding.
Set(PRESENCE_STATE(CustomPresence:Blah)=away,${BASE64_ENCODE(business)},${BASE64_ENCODE(I will
visiting clients in the San Diego area.\nI will be returning on Oct 11th.\nCall Josh for
emergencies)})
Dialplan Read Examples
Read Examples
SUBTYPE = ${PRESENCE_STATE(<presence state provider>,subtype)}
MESSAGE = ${PRESENCE_STATE(<presence state provider>,message)}
BASE64_SUBTYPE = ${PRESENCE_STATE(<presence state provider>,subtype,e)}
BASE64_MESSAGE = ${PRESENCE_STATE(<presence state provider>,message,e)}
AMI Examples