-
Notifications
You must be signed in to change notification settings - Fork 929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
app_voicemail - add manager actions to display and manipulate messages #182
app_voicemail - add manager actions to display and manipulate messages #182
Conversation
REMINDER: If this PR applies to other branches, please add a comment with the appropriate "cherry-pick-to" headers as per the Create a Pull Request process. If you don't want it cherry-picked, please add a comment stating "No cherry-picks required" so we don't keep asking. If, after adding "cherry-pick-to" comments, you change your mind, please edit the comment to DELETE the header lines and add "No cherry-picks required". |
cherry-pick-to: 20 |
Example commands and output:
Move a message from 'Urgent' to 'Inbox'
|
ae37f6d
to
790c3e6
Compare
apps/app_voicemail.c
Outdated
struct ast_vm_msg_snapshot *msg; | ||
int n = 0; | ||
|
||
if((s == NULL) || (vmu == NULL) || (event_name == NULL) || (actionid == NULL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't conform to our coding guidelines
apps/app_voicemail.c
Outdated
int n = 0; | ||
|
||
if((s == NULL) || (vmu == NULL) || (event_name == NULL) || (actionid == NULL)) { | ||
ast_log(LOG_ERROR, "Wrong input parameter."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not useful as an error message within the content of this work
apps/app_voicemail.c
Outdated
} | ||
|
||
/* Take a snapshot of the mailbox and walk through each folder's contents */ | ||
if ((mailbox_snapshot = ast_vm_mailbox_snapshot_create(vmu->mailbox, vmu->context, NULL, 0, AST_VM_SNAPSHOT_SORT_BY_ID, 0))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reduce indentation by returning -1 early if no mailbox snapshot
790c3e6
to
8163e8b
Compare
apps/app_voicemail.c
Outdated
/* walk through user's mailbox and append info for each message */ | ||
nummessages = append_vmbox_info_astman(s, vmu, "VoicemailBoxDetail", actionid); | ||
if(nummessages < 0) { | ||
ast_log(LOG_ERROR, "Could not append voicemail box info."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't contain enough information to be useful, such as the mailbox and context
apps/app_voicemail.c
Outdated
|
||
/* walk through user's mailbox and append info for each message */ | ||
nummessages = append_vmbox_info_astman(s, vmu, "VoicemailBoxDetail", actionid); | ||
if(nummessages < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (nummessages < 0) {
apps/app_voicemail.c
Outdated
nummessages = append_vmbox_info_astman(s, vmu, "VoicemailBoxDetail", actionid); | ||
if(nummessages < 0) { | ||
ast_log(LOG_ERROR, "Could not append voicemail box info."); | ||
nummessages = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this fails part way through, what will the result be? Some details sent, but a total messages count of 0?
in a particular mailbox folder. The forward command can be used to copy a message within a mailbox or to another mailbox. Also adds a VoicemailBoxSummarry, required to retrieve message ID's. Resolves: asterisk#181 UserNote: The following manager actions have been added VoicemailBoxSummary - Generate message list for a given mailbox VoicemailRemove - Remove a message from a mailbox folder VoicemailMove - Move a message from one folder to another within a mailbox VoicemailForward - Copy a message from one folder in one mailbox to another folder in another or the same mailbox.
8163e8b
to
89ff4c5
Compare
eef5a0b
into
asterisk:master
Successfully merged to branch master and cherry-picked to ["20","18","certified/18.9"] |
Adds manager actions to allow move/remove/forward individual messages in a particular mailbox folder. The forward command can be used to copy a message within a mailbox or to another mailbox. Also adds a VoicemailBoxSummarry, required to retrieve message ID's.
Resolves: #181
UserNote: The following manager actions have been added
VoicemailBoxSummary - Generate message list for a given mailbox
VoicemailRemove - Remove a message from a mailbox folder
VoicemailMove - Move a message from one folder to another within a mailbox
VoicemailForward - Copy a message from one folder in one mailbox
to another folder in another or the same mailbox.