|
|
|
@ -697,28 +697,33 @@ static void channel_hangup_request_cb(void *data,
|
|
|
|
|
struct stasis_message *message)
|
|
|
|
|
{
|
|
|
|
|
struct ast_channel_blob *obj = stasis_message_data(message);
|
|
|
|
|
RAII_VAR(struct ast_str *, extra, NULL, ast_free);
|
|
|
|
|
RAII_VAR(struct ast_str *, channel_event_string, NULL, ast_free);
|
|
|
|
|
struct ast_str *extra;
|
|
|
|
|
struct ast_str *channel_event_string;
|
|
|
|
|
struct ast_json *cause;
|
|
|
|
|
int is_soft;
|
|
|
|
|
char *manager_event = "HangupRequest";
|
|
|
|
|
|
|
|
|
|
if (!obj->snapshot) {
|
|
|
|
|
/* No snapshot? Likely an earlier allocation failure creating it. */
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extra = ast_str_create(20);
|
|
|
|
|
if (!extra) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
channel_event_string = ast_manager_build_channel_state_string(obj->snapshot);
|
|
|
|
|
|
|
|
|
|
if (!channel_event_string) {
|
|
|
|
|
ast_free(extra);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cause = ast_json_object_get(obj->blob, "cause");
|
|
|
|
|
if (cause) {
|
|
|
|
|
ast_str_append(&extra, 0,
|
|
|
|
|
"Cause: %jd\r\n",
|
|
|
|
|
ast_json_integer_get(cause));
|
|
|
|
|
"Cause: %jd\r\n",
|
|
|
|
|
ast_json_integer_get(cause));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
is_soft = ast_json_is_true(ast_json_object_get(obj->blob, "soft"));
|
|
|
|
@ -727,9 +732,12 @@ static void channel_hangup_request_cb(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
manager_event(EVENT_FLAG_CALL, manager_event,
|
|
|
|
|
"%s%s",
|
|
|
|
|
ast_str_buffer(channel_event_string),
|
|
|
|
|
ast_str_buffer(extra));
|
|
|
|
|
"%s%s",
|
|
|
|
|
ast_str_buffer(channel_event_string),
|
|
|
|
|
ast_str_buffer(extra));
|
|
|
|
|
|
|
|
|
|
ast_free(channel_event_string);
|
|
|
|
|
ast_free(extra);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void channel_chanspy_stop_cb(void *data, struct stasis_subscription *sub,
|
|
|
|
|