Mon Mar 12 2012 21:25:15

Asterisk developer's documentation


app_setcallerid.c File Reference

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"
Include dependency graph for app_setcallerid.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 setcallerid_pres_exec (struct ast_channel *chan, const char *data)
static int unload_module (void)

Variables

static struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Set CallerID Presentation Application" , .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, .load_pri = AST_MODPRI_DEFAULT, }
static char * app2 = "SetCallerPres"
static struct ast_module_infoast_module_info = &__mod_info

Detailed Description

App to set callerid presentation.

Author:
Mark Spencer <markster@digium.com>

Definition in file app_setcallerid.c.


Function Documentation

static void __reg_module ( void  ) [static]

Definition at line 129 of file app_setcallerid.c.

static void __unreg_module ( void  ) [static]

Definition at line 129 of file app_setcallerid.c.

static int load_module ( void  ) [static]
static int setcallerid_pres_exec ( struct ast_channel chan,
const char *  data 
) [static]

Definition at line 92 of file app_setcallerid.c.

References ast_log(), ast_parse_caller_presentation(), ast_channel::caller, ast_party_caller::id, LOG_WARNING, ast_party_id::name, ast_party_id::number, ast_party_name::presentation, and ast_party_number::presentation.

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;
   }
   
   /* Set the combined caller id presentation. */
   chan->caller.id.name.presentation = pres;
   chan->caller.id.number.presentation = pres;
   return 0;
}
static int unload_module ( void  ) [static]

Definition at line 119 of file app_setcallerid.c.

References ast_unregister_application().


Variable Documentation

struct ast_module_info __mod_info = { .name = AST_MODULE, .flags = AST_MODFLAG_LOAD_ORDER , .description = "Set CallerID Presentation Application" , .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, .load_pri = AST_MODPRI_DEFAULT, } [static]

Definition at line 129 of file app_setcallerid.c.

char* app2 = "SetCallerPres" [static]

Definition at line 90 of file app_setcallerid.c.

Definition at line 129 of file app_setcallerid.c.