mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
ami: Add AMI event for Wink
Adds an AMI event for a wink frame. ASTERISK-29830 #close Change-Id: I83e426de5e37baed79a4dbcc91e9e8d030ef1b56
This commit is contained in:
committed by
Joshua Colp
parent
1c2f311ba3
commit
f133ae6ca2
@@ -1000,6 +1000,34 @@ static void channel_flash_cb(void *data, struct stasis_subscription *sub,
|
||||
ast_free(channel_event_string);
|
||||
}
|
||||
|
||||
static void channel_wink_cb(void *data, struct stasis_subscription *sub,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
struct ast_channel_blob *obj = stasis_message_data(message);
|
||||
struct ast_str *channel_event_string;
|
||||
|
||||
channel_event_string = ast_manager_build_channel_state_string(obj->snapshot);
|
||||
if (!channel_event_string) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*** DOCUMENTATION
|
||||
<managerEvent language="en_US" name="Wink">
|
||||
<managerEventInstance class="EVENT_FLAG_CALL">
|
||||
<synopsis>Raised when a wink occurs on a channel.</synopsis>
|
||||
<syntax>
|
||||
<channel_snapshot/>
|
||||
</syntax>
|
||||
</managerEventInstance>
|
||||
</managerEvent>
|
||||
***/
|
||||
manager_event(EVENT_FLAG_CALL, "Wink",
|
||||
"%s",
|
||||
ast_str_buffer(channel_event_string));
|
||||
|
||||
ast_free(channel_event_string);
|
||||
}
|
||||
|
||||
static void channel_hangup_handler_cb(void *data, struct stasis_subscription *sub,
|
||||
struct stasis_message *message)
|
||||
{
|
||||
@@ -1362,6 +1390,9 @@ int manager_channels_init(void)
|
||||
ret |= stasis_message_router_add(message_router,
|
||||
ast_channel_flash_type(), channel_flash_cb, NULL);
|
||||
|
||||
ret |= stasis_message_router_add(message_router,
|
||||
ast_channel_wink_type(), channel_wink_cb, NULL);
|
||||
|
||||
ret |= stasis_message_router_add(message_router,
|
||||
ast_channel_hangup_request_type(), channel_hangup_request_cb,
|
||||
NULL);
|
||||
|
Reference in New Issue
Block a user