[asterisk-commits] mmichelson: branch mmichelson/authenticate r380732 - /team/mmichelson/authent...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 31 14:50:08 CST 2013
Author: mmichelson
Date: Thu Jan 31 14:50:04 2013
New Revision: 380732
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=380732
Log:
Stubbed out authenticator added.
Added:
team/mmichelson/authenticate/res/res_sip_authenticator.c (with props)
Added: team/mmichelson/authenticate/res/res_sip_authenticator.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/authenticate/res/res_sip_authenticator.c?view=auto&rev=380732
==============================================================================
--- team/mmichelson/authenticate/res/res_sip_authenticator.c (added)
+++ team/mmichelson/authenticate/res/res_sip_authenticator.c Thu Jan 31 14:50:04 2013
@@ -1,0 +1,75 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2013, Digium, Inc.
+ *
+ * Mark Michelson <mmichelson at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+#include "asterisk.h"
+#undef bzero
+#define bzero bzero
+#include "pjsip.h"
+
+#include "asterisk/res_sip.h"
+#include "asterisk/logger.h"
+#include "asterisk/module.h"
+
+/*** MODULEINFO
+ <depend>res_sip</depend>
+ <support_level>core</support_level>
+ ***/
+
+static int default_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
+{
+ /* STUB */
+ return 0;
+}
+
+static int default_authenticate_request(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
+{
+ /* STUB */
+ return 0;
+}
+
+static int default_get_authentication_credentials(struct ast_sip_endpoint *endpoint, struct ast_sip_digest_challenge_data *challenge)
+{
+ /* STUB */
+ return -1;
+}
+
+static struct ast_sip_authenticator default_authenticator = {
+ .requires_authentication = default_requires_authentication,
+ .authenticate_request = default_authenticate_request,
+ .get_authentication_credentials = default_get_authentication_credentials,
+};
+
+static int load_module(void)
+{
+ if (ast_sip_register_authenticator(&default_authenticator)) {
+ return AST_MODULE_LOAD_DECLINE;
+ }
+ return AST_MODULE_LOAD_SUCCESS;
+}
+
+static int unload_module(void)
+{
+ ast_sip_unregister_authenticator(&default_authenticator);
+ return 0;
+}
+
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "SIP authentication resource",
+ .load = load_module,
+ .unload = unload_module,
+ .load_pri = AST_MODPRI_CHANNEL_DEPEND,
+);
Propchange: team/mmichelson/authenticate/res/res_sip_authenticator.c
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/mmichelson/authenticate/res/res_sip_authenticator.c
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/mmichelson/authenticate/res/res_sip_authenticator.c
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the asterisk-commits
mailing list