summaryrefslogtreecommitdiff
path: root/main/callerid.c
diff options
context:
space:
mode:
authorPaul Cadach <paul@odt.east.telecom.kz>2006-10-07 14:45:49 +0000
committerPaul Cadach <paul@odt.east.telecom.kz>2006-10-07 14:45:49 +0000
commit500353e0953ad3366b5c988ef21e78f6b802b99d (patch)
treeedf636fb3b4a73b2530dc5c6d62ceb0427adb945 /main/callerid.c
parent901a66c40106872b6ee10c851070a90947518de0 (diff)
Extend CALLERID() function for "pres" and "ton" values
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/callerid.c')
-rw-r--r--main/callerid.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/main/callerid.c b/main/callerid.c
index 98cb7d081..6bb916bf4 100644
--- a/main/callerid.c
+++ b/main/callerid.c
@@ -1048,8 +1048,8 @@ int ast_callerid_split(const char *buf, char *name, int namelen, char *num, int
/*! \brief Translation table for Caller ID Presentation settings */
static struct {
int val;
- char *name;
- char *description;
+ const char *name;
+ const char *description;
} pres_types[] = {
{ AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED, "allowed_not_screened", "Presentation Allowed, Not Screened"},
{ AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, "allowed_passed_screen", "Presentation Allowed, Passed Screen"},
@@ -1094,3 +1094,19 @@ const char *ast_describe_caller_presentation(int data)
return "unknown";
}
+
+/*! \brief Convert caller ID pres value to text code
+ \param data text string
+ \return string for config file
+*/
+const char *ast_named_caller_presentation(int data)
+{
+ int i;
+
+ for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
+ if (pres_types[i].val == data)
+ return pres_types[i].name;
+ }
+
+ return "unknown";
+}