diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-28 22:38:07 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-28 22:38:07 +0000 |
commit | fc66a4458006a5dff981f2bf4fb5d4a75408c582 (patch) | |
tree | 0c9168973e2722b93eff8fad00605d6701b66c07 /main/app.c | |
parent | 0e7d4a984df30865da8b65612bfef9a3cbb945ba (diff) |
Adding a new option 'n' to app_chanspy. This option allows for the name of the spied-on
party to be spoken instead of the channel name or number.
This was accomplished by adding a new function pointer to point to a function in app_voicemail
which retrieves the name file and plays it. This makes for an easy way that applications may play
a user's name should it be necessary. app_directory, in particular, can be simplified greatly by
this change.
This change comes as a suggestion from Switchvox, which already has this feature. AST-23
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114813 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r-- | main/app.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/main/app.c b/main/app.c index 60856ae17..e5c712948 100644 --- a/main/app.c +++ b/main/app.c @@ -177,15 +177,18 @@ int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxle static int (*ast_has_voicemail_func)(const char *mailbox, const char *folder) = NULL; static int (*ast_inboxcount_func)(const char *mailbox, int *newmsgs, int *oldmsgs) = NULL; +static int (*ast_sayname_func)(struct ast_channel *chan, const char *mailbox, const char *context) = NULL; static int (*ast_messagecount_func)(const char *context, const char *mailbox, const char *folder) = NULL; void ast_install_vm_functions(int (*has_voicemail_func)(const char *mailbox, const char *folder), int (*inboxcount_func)(const char *mailbox, int *newmsgs, int *oldmsgs), - int (*messagecount_func)(const char *context, const char *mailbox, const char *folder)) + int (*messagecount_func)(const char *context, const char *mailbox, const char *folder), + int (*sayname_func)(struct ast_channel *chan, const char *mailbox, const char *context)) { ast_has_voicemail_func = has_voicemail_func; ast_inboxcount_func = inboxcount_func; ast_messagecount_func = messagecount_func; + ast_sayname_func = sayname_func; } void ast_uninstall_vm_functions(void) @@ -193,6 +196,7 @@ void ast_uninstall_vm_functions(void) ast_has_voicemail_func = NULL; ast_inboxcount_func = NULL; ast_messagecount_func = NULL; + ast_sayname_func = NULL; } int ast_app_has_voicemail(const char *mailbox, const char *folder) @@ -227,6 +231,13 @@ int ast_app_inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs) return 0; } +int ast_app_sayname(struct ast_channel *chan, const char *mailbox, const char *context) +{ + if (ast_sayname_func) + return ast_sayname_func(chan, mailbox, context); + return -1; +} + int ast_app_messagecount(const char *context, const char *mailbox, const char *folder) { static int warned = 0; |