Asterisk - The Open Source Telephony Project GIT-master-a358458
res_curl.c
Go to the documentation of this file.
1/*
2 * Asterisk -- An open source telephony toolkit.
3 *
4 * Copyright (c) 2008, Digium, Inc.
5 *
6 * Tilghman Lesher <res_curl_v1@the-tilghman.com>
7 *
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
13 *
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
17 */
18
19/*! \file
20 *
21 * \brief curl resource engine
22 *
23 * \author Tilghman Lesher <res_curl_v1@the-tilghman.com>
24 *
25 * Depends on the CURL library - http://curl.haxx.se/
26 *
27 */
28
29/*! \li \ref res_curl.c uses the configuration file \ref res_curl.conf
30 * \addtogroup configuration_file Configuration Files
31 */
32
33/*!
34 * \page res_curl.conf res_curl.conf
35 * \verbinclude res_curl.conf.sample
36 */
37
38/*** MODULEINFO
39 <depend>curl</depend>
40 <support_level>core</support_level>
41 ***/
42
43#include "asterisk.h"
44
45#include <curl/curl.h>
46
47#include "asterisk/module.h"
48
49static int unload_module(void)
50{
51 curl_global_cleanup();
52
53 return 0;
54}
55
56static int load_module(void)
57{
59
60 if (curl_global_init(CURL_GLOBAL_ALL)) {
61 ast_log(LOG_ERROR, "Unable to initialize the cURL library. Cannot load res_curl.so\n");
63 }
64
65 return res;
66}
67
69 .support_level = AST_MODULE_SUPPORT_CORE,
70 .load = load_module,
71 .unload = unload_module,
73);
Asterisk main include file. File version handling, generic pbx functions.
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Asterisk module definitions.
@ AST_MODFLAG_LOAD_ORDER
Definition: module.h:317
#define AST_MODULE_INFO(keystr, flags_to_set, desc, fields...)
Definition: module.h:543
@ AST_MODPRI_REALTIME_DEPEND
Definition: module.h:321
@ AST_MODULE_SUPPORT_CORE
Definition: module.h:121
#define ASTERISK_GPL_KEY
The text the key() function should return.
Definition: module.h:46
@ AST_MODULE_LOAD_SUCCESS
Definition: module.h:70
@ AST_MODULE_LOAD_DECLINE
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78
static int load_module(void)
Definition: res_curl.c:56
static int unload_module(void)
Definition: res_curl.c:49