diff options
Diffstat (limited to 'main/callerid.c')
-rw-r--r-- | main/callerid.c | 20 |
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"; +} |