[asterisk-commits] file: branch file/stasis_peerevent r390425 - /team/file/stasis_peerevent/res/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 4 12:26:03 CDT 2013
Author: file
Date: Tue Jun 4 12:26:02 2013
New Revision: 390425
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390425
Log:
Sprinkle two PeerStatus blobs.
Modified:
team/file/stasis_peerevent/res/res_sip/sip_configuration.c
Modified: team/file/stasis_peerevent/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/file/stasis_peerevent/res/res_sip/sip_configuration.c?view=diff&rev=390425&r1=390424&r2=390425
==============================================================================
--- team/file/stasis_peerevent/res/res_sip/sip_configuration.c (original)
+++ team/file/stasis_peerevent/res/res_sip/sip_configuration.c Tue Jun 4 12:26:02 2013
@@ -60,6 +60,7 @@
struct sip_persistent_endpoint *persistent = obj;
char *aor = arg;
RAII_VAR(struct ast_sip_contact *, contact, NULL, ao2_cleanup);
+ RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
if (!ast_strlen_zero(aor) && !strstr(persistent->aors, aor)) {
return 0;
@@ -67,9 +68,13 @@
if ((contact = ast_sip_location_retrieve_contact_from_aor_list(persistent->aors))) {
ast_endpoint_set_state(persistent->endpoint, AST_ENDPOINT_ONLINE);
+ blob = ast_json_pack("{s: s}", "PeerStatus", "Reachable");
} else {
ast_endpoint_set_state(persistent->endpoint, AST_ENDPOINT_OFFLINE);
- }
+ blob = ast_json_pack("{s: s}", "PeerStatus", "Unreachable");
+ }
+
+ ast_endpoint_blob_publish(persistent->endpoint, ast_endpoint_state_type(), blob);
return 0;
}
More information about the asterisk-commits
mailing list