Asterisk - The Open Source Telephony Project  18.5.0
Functions | Variables
res_curl.c File Reference

curl resource engine More...

#include "asterisk.h"
#include <curl/curl.h>
#include "asterisk/module.h"
Include dependency graph for res_curl.c:

Go to the source code of this file.

Functions

static void __reg_module (void)
 
static void __unreg_module (void)
 
struct ast_moduleAST_MODULE_SELF_SYM (void)
 
static int load_module (void)
 
static int unload_module (void)
 

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "cURL Resource Module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_REALTIME_DEPEND, }
 
static const struct ast_module_infoast_module_info = &__mod_info
 

Detailed Description

curl resource engine

Author
Tilghman Lesher res_c.nosp@m.url_.nosp@m.v1@th.nosp@m.e-ti.nosp@m.lghma.nosp@m.n.co.nosp@m.m

Depends on the CURL library - http://curl.haxx.se/

Definition in file res_curl.c.

Function Documentation

◆ __reg_module()

static void __reg_module ( void  )
static

Definition at line 73 of file res_curl.c.

◆ __unreg_module()

static void __unreg_module ( void  )
static

Definition at line 73 of file res_curl.c.

◆ AST_MODULE_SELF_SYM()

struct ast_module* AST_MODULE_SELF_SYM ( void  )

Definition at line 73 of file res_curl.c.

◆ load_module()

static int load_module ( void  )
static

Definition at line 56 of file res_curl.c.

References ast_log, AST_MODFLAG_LOAD_ORDER, AST_MODPRI_REALTIME_DEPEND, AST_MODULE_INFO(), AST_MODULE_LOAD_DECLINE, AST_MODULE_LOAD_SUCCESS, AST_MODULE_SUPPORT_CORE, ASTERISK_GPL_KEY, LOG_ERROR, and unload_module().

57 {
58  int res = AST_MODULE_LOAD_SUCCESS;
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 }
#define ast_log
Definition: astobj2.c:42
#define LOG_ERROR
Definition: logger.h:285
Module has failed to load, may be in an inconsistent state.
Definition: module.h:78

◆ unload_module()

static int unload_module ( void  )
static

Definition at line 49 of file res_curl.c.

Referenced by load_module().

50 {
51  curl_global_cleanup();
52 
53  return 0;
54 }

Variable Documentation

◆ __mod_info

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "cURL Resource Module" , .key = "This paragraph is copyright (c) 2006 by Digium, Inc. \In order for your module to load, it must return this \key via a function called \"key\". Any code which \includes this paragraph must be licensed under the GNU \General Public License version 2 or later (at your \option). In addition to Digium's general reservations \of rights, Digium expressly reserves the right to \allow other parties to license this paragraph under \different terms. Any use of Digium, Inc. trademarks or \logos (including \"Asterisk\" or \"Digium\") without \express written permission of Digium, Inc. is prohibited.\n" , .buildopt_sum = "30ef0c93b36035ec78c9cfd712d36d9b" , .support_level = AST_MODULE_SUPPORT_CORE, .load = load_module, .unload = unload_module, .load_pri = AST_MODPRI_REALTIME_DEPEND, }
static

Definition at line 73 of file res_curl.c.

◆ ast_module_info

const struct ast_module_info* ast_module_info = &__mod_info
static

Definition at line 73 of file res_curl.c.