[asterisk-commits] dlee: branch dlee/ASTERISK-22451-ari-subscribe r398804 - in /team/dlee/ASTERI...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed Sep 11 08:31:45 CDT 2013
Author: dlee
Date: Wed Sep 11 08:31:42 2013
New Revision: 398804
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398804
Log:
Passes validation
Modified:
team/dlee/ASTERISK-22451-ari-subscribe/main/json.c
team/dlee/ASTERISK-22451-ari-subscribe/res/res_stasis.c
team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.c
team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.h
Modified: team/dlee/ASTERISK-22451-ari-subscribe/main/json.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22451-ari-subscribe/main/json.c?view=diff&rev=398804&r1=398803&r2=398804
==============================================================================
--- team/dlee/ASTERISK-22451-ari-subscribe/main/json.c (original)
+++ team/dlee/ASTERISK-22451-ari-subscribe/main/json.c Wed Sep 11 08:31:42 2013
@@ -684,9 +684,14 @@
}
struct ast_json *ast_json_vpack(char const *format, va_list ap)
{
+ json_error_t error;
struct ast_json *r = NULL;
if (format) {
- r = (struct ast_json *)json_vpack_ex(NULL, 0, format, ap);
+ r = (struct ast_json *)json_vpack_ex(&error, 0, format, ap);
+ if (!r) {
+ ast_log(LOG_ERROR, "Error building JSON: %s.\n",
+ error.text);
+ }
}
return r;
}
Modified: team/dlee/ASTERISK-22451-ari-subscribe/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22451-ari-subscribe/res/res_stasis.c?view=diff&rev=398804&r1=398803&r2=398804
==============================================================================
--- team/dlee/ASTERISK-22451-ari-subscribe/res/res_stasis.c (original)
+++ team/dlee/ASTERISK-22451-ari-subscribe/res/res_stasis.c Wed Sep 11 08:31:42 2013
@@ -829,6 +829,10 @@
}
}
+ if (res == STASIS_ASR_OK && json) {
+ *json = app_to_json(app);
+ }
+
for (i = 0; i < event_sources_count; ++i) {
channels[i] = ast_channel_cleanup(channels[i]);
}
Modified: team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.c?view=diff&rev=398804&r1=398803&r2=398804
==============================================================================
--- team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.c (original)
+++ team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.c Wed Sep 11 08:31:42 2013
@@ -642,6 +642,16 @@
return app->name;
}
+struct ast_json *app_to_json(const struct app *app)
+{
+ RAII_VAR(struct ast_json *, json, NULL, ast_json_unref);
+
+ json = ast_json_pack("{s: [], s: [], s: []}",
+ "channel_ids", "bridge_ids", "endpoint_ids");
+
+ return ast_json_ref(json);
+}
+
int app_subscribe_channel(struct app *app, struct ast_channel *chan)
{
int res;
Modified: team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.h?view=diff&rev=398804&r1=398803&r2=398804
==============================================================================
--- team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.h (original)
+++ team/dlee/ASTERISK-22451-ari-subscribe/res/stasis/app.h Wed Sep 11 08:31:42 2013
@@ -114,6 +114,8 @@
struct app_forwards;
+struct ast_json *app_to_json(const struct app *app);
+
/*!
* \brief Subscribes an application to a channel.
*
More information about the asterisk-commits
mailing list