[asterisk-commits] dlee: branch dlee/endpoints r386398 - in /team/dlee/endpoints: include/asteri...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Apr 23 17:14:45 CDT 2013
Author: dlee
Date: Tue Apr 23 17:14:42 2013
New Revision: 386398
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386398
Log:
Initialize
Modified:
team/dlee/endpoints/include/asterisk/stasis_endpoints.h
team/dlee/endpoints/main/asterisk.c
team/dlee/endpoints/main/stasis_endpoints.c
Modified: team/dlee/endpoints/include/asterisk/stasis_endpoints.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/endpoints/include/asterisk/stasis_endpoints.h?view=diff&rev=386398&r1=386397&r2=386398
==============================================================================
--- team/dlee/endpoints/include/asterisk/stasis_endpoints.h (original)
+++ team/dlee/endpoints/include/asterisk/stasis_endpoints.h Tue Apr 23 17:14:42 2013
@@ -125,7 +125,8 @@
*
* \return 0 on success.
* \return non-zero on error.
+ * \since 12
*/
-int ast_endpoints_stasis_init(void);
+int ast_endpoint_stasis_init(void);
#endif /* _ASTERISK_STASIS_ENDPOINTS_H */
Modified: team/dlee/endpoints/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/endpoints/main/asterisk.c?view=diff&rev=386398&r1=386397&r2=386398
==============================================================================
--- team/dlee/endpoints/main/asterisk.c (original)
+++ team/dlee/endpoints/main/asterisk.c Tue Apr 23 17:14:42 2013
@@ -242,6 +242,7 @@
#include "asterisk/sorcery.h"
#include "asterisk/stasis.h"
#include "asterisk/json.h"
+#include "asterisk/stasis_endpoints.h"
#include "../defaults.h"
@@ -4128,6 +4129,11 @@
exit(1);
}
+ if (ast_endpoint_stasis_init()) {
+ printf("Endpoint initialization failed.\n%s", term_quit());
+ exit(1);
+ }
+
ast_makesocket();
sigemptyset(&sigs);
sigaddset(&sigs, SIGHUP);
Modified: team/dlee/endpoints/main/stasis_endpoints.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/endpoints/main/stasis_endpoints.c?view=diff&rev=386398&r1=386397&r2=386398
==============================================================================
--- team/dlee/endpoints/main/stasis_endpoints.c (original)
+++ team/dlee/endpoints/main/stasis_endpoints.c Tue Apr 23 17:14:42 2013
@@ -35,9 +35,16 @@
#include "asterisk/stasis.h"
#include "asterisk/stasis_endpoints.h"
+static struct stasis_message_type *endpoint_snapshot_type;
+
static struct stasis_topic *endpoint_topic_all;
static struct stasis_caching_topic *endpoint_topic_all_cached;
+
+struct stasis_message_type *ast_endpoint_snapshot_type(void)
+{
+ return endpoint_snapshot_type;
+}
struct stasis_topic *ast_endpoint_topic_all(void)
{
@@ -90,7 +97,7 @@
endpoint_topic_all_cached = NULL;
}
-int ast_endpoints_stasis_init(void)
+int ast_endpoint_stasis_init(void)
{
ast_register_atexit(endpoints_stasis_shutdown);
@@ -103,13 +110,23 @@
}
if (!endpoint_topic_all_cached) {
- stasis_caching_topic_create(
- endpoint_topic_all, endpoint_snapshot_get_id);
+ endpoint_topic_all_cached =
+ stasis_caching_topic_create(
+ endpoint_topic_all, endpoint_snapshot_get_id);
}
if (!endpoint_topic_all_cached) {
return -1;
}
+ if (!endpoint_snapshot_type) {
+ endpoint_snapshot_type = stasis_message_type_create(
+ "ast_endpoint_snapshot_type");
+ }
+
+ if (!endpoint_snapshot_type) {
+ return -1;
+ }
+
return 0;
}
More information about the asterisk-commits
mailing list