res_pjsip_send_to_voicemail: transferring to voicemail for digium phones

Added the ability for transferring directly to voicemail on digium phones.
Added a new module that checks for the presence of a custom header and/or
diversion header within a sip REFER.  If either is found and they specify
a sending to voicemail action then variables are added to the channel
allowing the user access to them in the dialplan.  Dialplan can then be
written that branches based upon these values allowing, for instace, for
a single number to be used for dialing and/or accessing voicemail directly.

Also fixed a problem where the PJSIP_HEADER function was allowing non pjsip
channels through (checked to make sure it has the correct channel type before
proceeding).

Review: https://reviewboard.asterisk.org/r/3245/
........

Merged revisions 408880 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408881 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin Harwell
2014-02-25 17:47:06 +00:00
parent 23b142d5c8
commit eee4313fe8
2 changed files with 230 additions and 2 deletions

View File

@@ -452,7 +452,7 @@ static int func_read_header(struct ast_channel *chan, const char *function, char
AST_APP_ARG(header_name); AST_APP_ARG(header_number););
AST_STANDARD_APP_ARGS(args, data);
if (!channel) {
if (!channel || strncmp(ast_channel_name(chan), "PJSIP/", 6)) {
ast_log(LOG_ERROR, "This function requires a PJSIP channel.\n");
return -1;
}
@@ -511,7 +511,7 @@ static int func_write_header(struct ast_channel *chan, const char *cmd, char *da
AST_APP_ARG(header_name); AST_APP_ARG(header_number););
AST_STANDARD_APP_ARGS(args, data);
if (!channel) {
if (!channel || strncmp(ast_channel_name(chan), "PJSIP/", 6)) {
ast_log(LOG_ERROR, "This function requires a PJSIP channel.\n");
return -1;
}