App to set callerid presentation. More...
#include "asterisk.h"#include "asterisk/lock.h"#include "asterisk/file.h"#include "asterisk/channel.h"#include "asterisk/pbx.h"#include "asterisk/module.h"#include "asterisk/translate.h"#include "asterisk/image.h"#include "asterisk/callerid.h"
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 | setcallerid_pres_exec (struct ast_channel *chan, void *data) |
| static int | unload_module (void) |
Variables | |
| static struct ast_module_info __MODULE_INFO_SECTION | __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Set CallerID Presentation Application" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } |
| static char * | app2 = "SetCallerPres" |
| static struct ast_module_info * | ast_module_info = &__mod_info |
App to set callerid presentation.
Definition in file app_setcallerid.c.
| static void __reg_module | ( | void | ) | [static] |
Definition at line 122 of file app_setcallerid.c.
| static void __unreg_module | ( | void | ) | [static] |
Definition at line 122 of file app_setcallerid.c.
| static int load_module | ( | void | ) | [static] |
Definition at line 117 of file app_setcallerid.c.
References ast_register_application_xml, and setcallerid_pres_exec().
{
return ast_register_application_xml(app2, setcallerid_pres_exec);
}
| static int setcallerid_pres_exec | ( | struct ast_channel * | chan, |
| void * | data | ||
| ) | [static] |
Definition at line 87 of file app_setcallerid.c.
References ast_log(), ast_parse_caller_presentation(), ast_channel::cid, ast_callerid::cid_pres, and LOG_WARNING.
Referenced by load_module().
{
int pres = -1;
static int deprecated = 0;
if (!deprecated) {
deprecated = 1;
ast_log(LOG_WARNING, "SetCallerPres is deprecated. Please use Set(CALLERPRES()=%s) instead.\n", (char *)data);
}
/* For interface consistency, permit the argument to be specified as a number */
if (sscanf(data, "%30d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) {
pres = ast_parse_caller_presentation(data);
}
if (pres < 0) {
ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n",
(char *) data);
return 0;
}
chan->cid.cid_pres = pres;
return 0;
}
| static int unload_module | ( | void | ) | [static] |
Definition at line 112 of file app_setcallerid.c.
References ast_unregister_application().
{
return ast_unregister_application(app2);
}
struct ast_module_info __MODULE_INFO_SECTION __mod_info = { __MODULE_INFO_GLOBALS .name = AST_MODULE, .flags = AST_MODFLAG_DEFAULT , .description = "Set CallerID Presentation Application" , .key = ASTERISK_GPL_KEY , .buildopt_sum = AST_BUILDOPT_SUM, .load = load_module, .unload = unload_module, } [static] |
Definition at line 122 of file app_setcallerid.c.
char* app2 = "SetCallerPres" [static] |
Definition at line 85 of file app_setcallerid.c.
struct ast_module_info* ast_module_info = &__mod_info [static] |
Definition at line 122 of file app_setcallerid.c.