int ast_stasis_channels_init(void) { int res = 0; ast_register_cleanup(stasis_channels_cleanup); channel_cache_all = stasis_cp_all_create("ast_channel_topic_all", channel_snapshot_get_id); if (!channel_cache_all) { return -1; } res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_agent_login_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_agent_logoff_type); channel_cache_by_name = stasis_cache_create(channel_snapshot_get_name); if (!channel_cache_by_name) { return -1; } /* This should be initialized before the caching topic */ res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_snapshot_type); channel_by_name_topic = stasis_caching_topic_create( stasis_cp_all_topic(channel_cache_all), channel_cache_by_name); if (!channel_by_name_topic) { return -1; } res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_dial_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_varset_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_user_event_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_hangup_request_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_dtmf_begin_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_dtmf_end_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_hold_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_unhold_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_chanspy_start_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_chanspy_stop_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_fax_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_hangup_handler_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_moh_start_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_moh_stop_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_monitor_start_type); res |= STASIS_MESSAGE_TYPE_INIT(ast_channel_monitor_stop_type); return res; }
struct stasis_topic *ast_endpoint_topic_all(void) { return stasis_cp_all_topic(endpoint_cache_all); }
struct stasis_topic *ast_channel_topic_all(void) { return stasis_cp_all_topic(channel_cache_all); }