#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include "asterisk.h"
#include "asterisk/channel.h"
#include "asterisk/pbx.h"
#include "asterisk/logger.h"
#include "asterisk/utils.h"
#include "asterisk/app.h"
#include "asterisk/module.h"
Go to the source code of this file.
Functions | |
char * | builtin_function_uridecode (struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) |
builtin_function_uridecode: Decode URI according to RFC 2396 | |
char * | builtin_function_uriencode (struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) |
builtin_function_uriencode: Encode URL according to RFC 2396 | |
char * | description (void) |
Provides a description of the module. | |
char * | key () |
Returns the ASTERISK_GPL_KEY. | |
int | load_module (void) |
Initialize the module. | |
int | unload_module (void) |
Cleanup all module structures, sockets, etc. | |
int | usecount (void) |
Provides a usecount. | |
Variables | |
char * | tdesc = "URI encode/decode functions" |
ast_custom_function | urldecode_function |
ast_custom_function | urlencode_function |
Definition in file func_uri.c.
|
builtin_function_uridecode: Decode URI according to RFC 2396
Definition at line 61 of file func_uri.c. References ast_log(), ast_strlen_zero(), ast_uri_decode(), and LOG_WARNING. 00062 { 00063 if (ast_strlen_zero(data)) { 00064 ast_log(LOG_WARNING, "Syntax: URIDECODE(<data>) - missing argument!\n"); 00065 return NULL; 00066 } 00067 00068 00069 ast_copy_string(buf, data, len); 00070 ast_uri_decode(buf); 00071 return buf; 00072 }
|
|
builtin_function_uriencode: Encode URL according to RFC 2396
Definition at line 45 of file func_uri.c. References ast_log(), ast_strlen_zero(), ast_uri_encode(), and LOG_WARNING. 00046 { 00047 char uri[BUFSIZ]; 00048 00049 if (ast_strlen_zero(data)) { 00050 ast_log(LOG_WARNING, "Syntax: URIENCODE(<data>) - missing argument!\n"); 00051 return NULL; 00052 } 00053 00054 ast_uri_encode(data, uri, sizeof(uri), 1); 00055 ast_copy_string(buf, uri, len); 00056 00057 return buf; 00058 }
|
|
Provides a description of the module.
Definition at line 107 of file func_uri.c. 00108 {
00109 return tdesc;
00110 }
|
|
Returns the ASTERISK_GPL_KEY. This returns the ASTERISK_GPL_KEY, signifiying that you agree to the terms of the GPL stated in the ASTERISK_GPL_KEY. Your module will not load if it does not return the EXACT message:
char *key(void) { return ASTERISK_GPL_KEY; }
Definition at line 117 of file func_uri.c. 00118 {
00119 return ASTERISK_GPL_KEY;
00120 }
|
|
Initialize the module. Initialize the Agents module. This function is being called by Asterisk when loading the module. Among other thing it registers applications, cli commands and reads the cofiguration file.
Definition at line 102 of file func_uri.c. References ast_custom_function_register(), urldecode_function, and urlencode_function. 00103 { 00104 return ast_custom_function_register(&urldecode_function) || ast_custom_function_register(&urlencode_function); 00105 }
|
|
Cleanup all module structures, sockets, etc. This is called at exit. Any registrations and memory allocations need to be unregistered and free'd here. Nothing else will do these for you (until exit).
Definition at line 97 of file func_uri.c. References ast_custom_function_unregister(), urldecode_function, and urlencode_function. 00098 { 00099 return ast_custom_function_unregister(&urldecode_function) || ast_custom_function_unregister(&urlencode_function); 00100 }
|
|
Provides a usecount. This function will be called by various parts of asterisk. Basically, all it has to do is to return a usecount when called. You will need to maintain your usecount within the module somewhere. The usecount should be how many channels provided by this module are in use.
Definition at line 112 of file func_uri.c. 00113 {
00114 return 0;
00115 }
|
|
Definition at line 95 of file func_uri.c. |
|
Definition at line 77 of file func_uri.c. Referenced by load_module(), and unload_module(). |
|
Definition at line 87 of file func_uri.c. Referenced by load_module(), and unload_module(). |