mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 15:29:05 +00:00
Add AMI event for presence state.
Review: https://reviewboard.asterisk.org/r/3039/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@404275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -5775,20 +5775,47 @@ static int manager_state_cb(char *context, char *exten, struct ast_state_cb_info
|
|||||||
{
|
{
|
||||||
/* Notify managers of change */
|
/* Notify managers of change */
|
||||||
char hint[512];
|
char hint[512];
|
||||||
int state = info->exten_state;
|
|
||||||
|
|
||||||
/* only interested in device state for this right now */
|
|
||||||
if (info->reason != AST_HINT_UPDATE_DEVICE) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, context, exten);
|
ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, context, exten);
|
||||||
/*** DOCUMENTATION
|
|
||||||
<managerEventInstance>
|
switch(info->reason) {
|
||||||
<synopsis>Raised when an extension state has changed.</synopsis>
|
case AST_HINT_UPDATE_DEVICE:
|
||||||
</managerEventInstance>
|
/*** DOCUMENTATION
|
||||||
***/
|
<managerEventInstance>
|
||||||
manager_event(EVENT_FLAG_CALL, "ExtensionStatus", "Exten: %s\r\nContext: %s\r\nHint: %s\r\nStatus: %d\r\n", exten, context, hint, state);
|
<synopsis>Raised when an extension state has changed.</synopsis>
|
||||||
|
</managerEventInstance>
|
||||||
|
***/
|
||||||
|
manager_event(EVENT_FLAG_CALL, "ExtensionStatus",
|
||||||
|
"Exten: %s\r\n"
|
||||||
|
"Context: %s\r\n"
|
||||||
|
"Hint: %s\r\n"
|
||||||
|
"Status: %d\r\n",
|
||||||
|
exten,
|
||||||
|
context,
|
||||||
|
hint,
|
||||||
|
info->exten_state);
|
||||||
|
break;
|
||||||
|
case AST_HINT_UPDATE_PRESENCE:
|
||||||
|
/*** DOCUMENTATION
|
||||||
|
<managerEventInstance>
|
||||||
|
<synopsis>Raised when a presence state has changed.</synopsis>
|
||||||
|
</managerEventInstance>
|
||||||
|
***/
|
||||||
|
manager_event(EVENT_FLAG_CALL, "PresenceStatus",
|
||||||
|
"Exten: %s\r\n"
|
||||||
|
"Context: %s\r\n"
|
||||||
|
"Hint: %s\r\n"
|
||||||
|
"Status: %s\r\n"
|
||||||
|
"Subtype: %s\r\n"
|
||||||
|
"Message: %s\r\n",
|
||||||
|
exten,
|
||||||
|
context,
|
||||||
|
hint,
|
||||||
|
ast_presence_state2str(info->presence_state),
|
||||||
|
info->presence_subtype,
|
||||||
|
info->presence_message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user