Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fix a couple of typos

...

Asterisk offers the following presence states:

  • not_set: No presence state has been set for this entity.
  • unavailable: This entity is present but currently not available for communications.
  • available: This entity is available for communication.
  • away: This entity is not present and is unable to communicate.
  • xa: This entity is not present and is not expected to return for a while.
  • chat: This entity is available to communicate but would rather use instant messaging than speak.
  • dnd: This entity does not wish to be disturbed.

...

Like with device state, presence state can be placed in hints. Presence state hints come after device state hints and are separated by a comma (,). As an example:

No Format

[default]
exten => 2000,hint,SIP/2000,CustomPresence:2000
exten => 2000,1,Dial(SIP/2000)
same => n,Hangup()

...

Note

The following dialplan is meant strictly for demonstration. It is not intended to be used as-is in a production environment.

No Format

[default]
exten => 2000,1,Answer()
same => n,Set(CURRENT_PRESENCE=${PRESENCE_STATE(CustomPresence:Bob,value)})
same => n,GotoIf($[${CURRENT_PRESENCE}=available]?set_unavailable:set_available)
same => n(set_available),Set(PRESENCE_STATE(CustomPresence:Bob)=available,,)
same => n,Goto(finished)
same => n(set_unavailable),Set(PRESENCE_STATE(CustomPresence:Bob)=unavailable,,)
same => n(finished),Playback(queue-thankyou)
same => n,Hangup

exten => 2001,1,GotoIf($[${PRESENCE_STATE(CustomPresence:Bob,value)}!=available]?voicemail)
same => n,Dial(SIP/Bob)
same => n(voicemail)VoiceMail(Bob@default)

...