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 | |
| AST_MODULE_INFO_STANDARD (ASTERISK_GPL_KEY,"Set CallerID Presentation Application") | |
| static int | load_module (void) |
| static int | setcallerid_pres_exec (struct ast_channel *chan, void *data) |
| static int | unload_module (void) |
Variables | |
| static char * | app2 = "SetCallerPres" |
App to set callerid presentation.
Definition in file app_setcallerid.c.
| AST_MODULE_INFO_STANDARD | ( | ASTERISK_GPL_KEY | , | |
| "Set CallerID Presentation Application" | ||||
| ) |
| static int load_module | ( | void | ) | [static] |
Definition at line 117 of file app_setcallerid.c.
References ast_register_application_xml, and setcallerid_pres_exec().
00118 { 00119 return ast_register_application_xml(app2, setcallerid_pres_exec); 00120 }
| 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().
00088 { 00089 int pres = -1; 00090 static int deprecated = 0; 00091 00092 if (!deprecated) { 00093 deprecated = 1; 00094 ast_log(LOG_WARNING, "SetCallerPres is deprecated. Please use Set(CALLERPRES()=%s) instead.\n", (char *)data); 00095 } 00096 00097 /* For interface consistency, permit the argument to be specified as a number */ 00098 if (sscanf(data, "%30d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) { 00099 pres = ast_parse_caller_presentation(data); 00100 } 00101 00102 if (pres < 0) { 00103 ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n", 00104 (char *) data); 00105 return 0; 00106 } 00107 00108 chan->cid.cid_pres = pres; 00109 return 0; 00110 }
| static int unload_module | ( | void | ) | [static] |
Definition at line 112 of file app_setcallerid.c.
References ast_unregister_application().
00113 { 00114 return ast_unregister_application(app2); 00115 }
char* app2 = "SetCallerPres" [static] |
Definition at line 85 of file app_setcallerid.c.
1.6.1