Thu Oct 11 06:49:38 2012

Asterisk developer's documentation


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)
static int load_module (void)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .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 = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, }
static struct ast_module_infoast_module_info = &__mod_info


Detailed Description

curl resource engine

Author:
Tilghman Lesher <res_curl_v1@the-tilghman.com>
ExtRef:
Depends on the CURL library - http://curl.haxx.se/

Definition in file res_curl.c.


Function Documentation

static void __reg_module ( void   )  [static]

Definition at line 73 of file res_curl.c.

static void __unreg_module ( void   )  [static]

Definition at line 73 of file res_curl.c.

static int load_module ( void   )  [static]

Definition at line 61 of file res_curl.c.

References ast_log(), AST_MODULE_LOAD_DECLINE, and LOG_ERROR.

00062 {
00063    int res = 0;
00064 
00065    if (curl_global_init(CURL_GLOBAL_ALL)) {
00066       ast_log(LOG_ERROR, "Unable to initialize the CURL library. Cannot load res_curl\n");
00067       return AST_MODULE_LOAD_DECLINE;
00068    }  
00069 
00070    return res;
00071 }

static int unload_module ( void   )  [static]

Definition at line 41 of file res_curl.c.

References ast_log(), ast_module_check(), and LOG_ERROR.

00042 {
00043    int res = 0;
00044 
00045    /* If the dependent modules are still in memory, forbid unload */
00046    if (ast_module_check("func_curl.so")) {
00047       ast_log(LOG_ERROR, "func_curl.so (dependent module) is still loaded.  Cannot unload res_curl.so\n");
00048       return -1;
00049    }
00050 
00051    if (ast_module_check("res_config_curl.so")) {
00052       ast_log(LOG_ERROR, "res_config_curl.so (dependent module) is still loaded.  Cannot unload res_curl.so\n");
00053       return -1;
00054    }
00055 
00056    curl_global_cleanup();
00057 
00058    return res;
00059 }


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .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 = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static]

Definition at line 73 of file res_curl.c.

Definition at line 73 of file res_curl.c.


Generated on Thu Oct 11 06:49:38 2012 for Asterisk - the Open Source PBX by  doxygen 1.5.6