[Asterisk-code-review] add asterisk_id to message generated with channel_blob_to_json (asterisk[master])

Sylvain Afchain asteriskteam at digium.com
Wed Feb 5 02:43:29 CST 2020


Sylvain Afchain has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13726 )


Change subject: add asterisk_id to message generated with channel_blob_to_json
......................................................................

add asterisk_id to message generated with channel_blob_to_json

Currently messages generated by channel_blob_to_json don't contains
asterisk_id while other stasis messages do.

Change-Id: I85fd92c21e7c3465059acda34adf6cfe1777147d
---
M main/stasis_channels.c
1 file changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/26/13726/1

diff --git a/main/stasis_channels.c b/main/stasis_channels.c
index 12c8f44..e29e208 100644
--- a/main/stasis_channels.c
+++ b/main/stasis_channels.c
@@ -1345,6 +1345,7 @@
 	struct ast_json *blob = channel_blob->blob;
 	struct ast_channel_snapshot *snapshot = channel_blob->snapshot;
 	const struct timeval *tv = stasis_message_timestamp(message);
+	char eid[20];
 	int res = 0;
 
 	if (blob == NULL || ast_json_is_null(blob)) {
@@ -1357,6 +1358,8 @@
 		return NULL;
 	}
 
+	res |= ast_json_object_set(to_json, "asterisk_id", ast_json_string_create(
+		ast_eid_to_str(eid, sizeof(eid), &ast_eid_default)));
 	res |= ast_json_object_set(to_json, "type", ast_json_string_create(type));
 	res |= ast_json_object_set(to_json, "timestamp",
 		ast_json_timeval(*tv, NULL));

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13726
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: I85fd92c21e7c3465059acda34adf6cfe1777147d
Gerrit-Change-Number: 13726
Gerrit-PatchSet: 1
Gerrit-Owner: Sylvain Afchain <safchain at wazo.io>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200205/a0bcccc2/attachment-0001.html>


More information about the asterisk-code-review mailing list