<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13662">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail: Remove MessageExists and MESSAGE_EXISTS()<br><br>* The MailboxExists dialplan application was deprecated on 2006-09-26<br> in Asterisk 1.6.0 (commit ec83b111831fe865753f5b1c382ab73750685e50)<br><br>* The MAILBOX_EXISTS dialplan function was deprecated on 2011-12-06 in<br> Asterisk 11.0.0 (commit fd64bb66f94f1a7bb47e17319512b14e522353ec)<br><br>Change-Id: I71cfc9d7b9217a37b802f4cc6ef2d57900b7398f<br>---<br>M apps/app_voicemail.c<br>A doc/UPGRADE-staging/vm_deprecated_removals.txt<br>2 files changed, 16 insertions(+), 141 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/13662/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index cf944fd..1b607e4 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -246,38 +246,6 @@</span><br><span> <ref type="application">VoiceMail</ref></span><br><span> </see-also></span><br><span> </application></span><br><span style="color: hsl(0, 100%, 40%);">- <application name="MailboxExists" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- Check to see if Voicemail mailbox exists.</span><br><span style="color: hsl(0, 100%, 40%);">- </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- <syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="mailbox" required="true" argsep="@"></span><br><span style="color: hsl(0, 100%, 40%);">- <argument name="mailbox" required="true" /></span><br><span style="color: hsl(0, 100%, 40%);">- <argument name="context" /></span><br><span style="color: hsl(0, 100%, 40%);">- </parameter></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="options"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>None options.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </parameter></span><br><span style="color: hsl(0, 100%, 40%);">- </syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <description></span><br><span style="color: hsl(0, 100%, 40%);">- <note><para>DEPRECATED. Use VM_INFO(mailbox[@context],exists) instead.</para></note></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Check to see if the specified <replaceable>mailbox</replaceable> exists. If no voicemail</span><br><span style="color: hsl(0, 100%, 40%);">- <replaceable>context</replaceable> is specified, the <literal>default</literal> context</span><br><span style="color: hsl(0, 100%, 40%);">- will be used.</para></span><br><span style="color: hsl(0, 100%, 40%);">- <para>This application will set the following channel variable upon completion:</para></span><br><span style="color: hsl(0, 100%, 40%);">- <variablelist></span><br><span style="color: hsl(0, 100%, 40%);">- <variable name="VMBOXEXISTSSTATUS"></span><br><span style="color: hsl(0, 100%, 40%);">- <para>This will contain the status of the execution of the MailboxExists application.</span><br><span style="color: hsl(0, 100%, 40%);">- Possible values include:</para></span><br><span style="color: hsl(0, 100%, 40%);">- <value name="SUCCESS" /></span><br><span style="color: hsl(0, 100%, 40%);">- <value name="FAILED" /></span><br><span style="color: hsl(0, 100%, 40%);">- </variable></span><br><span style="color: hsl(0, 100%, 40%);">- </variablelist></span><br><span style="color: hsl(0, 100%, 40%);">- </description></span><br><span style="color: hsl(0, 100%, 40%);">- <see-also></span><br><span style="color: hsl(0, 100%, 40%);">- <ref type="function">VM_INFO</ref></span><br><span style="color: hsl(0, 100%, 40%);">- </see-also></span><br><span style="color: hsl(0, 100%, 40%);">- </application></span><br><span> <application name="VMAuthenticate" language="en_US"></span><br><span> <synopsis></span><br><span> Authenticate with Voicemail passwords.</span><br><span>@@ -349,24 +317,6 @@</span><br><span> argument to this application. If no context is provided, <literal>default</literal> is assumed.</para></span><br><span> </description></span><br><span> </application></span><br><span style="color: hsl(0, 100%, 40%);">- <function name="MAILBOX_EXISTS" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- Tell if a mailbox is configured.</span><br><span style="color: hsl(0, 100%, 40%);">- </synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- <syntax argsep="@"></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="mailbox" required="true" /></span><br><span style="color: hsl(0, 100%, 40%);">- <parameter name="context" /></span><br><span style="color: hsl(0, 100%, 40%);">- </syntax></span><br><span style="color: hsl(0, 100%, 40%);">- <description></span><br><span style="color: hsl(0, 100%, 40%);">- <note><para>DEPRECATED. Use VM_INFO(mailbox[@context],exists) instead.</para></note></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Returns a boolean of whether the corresponding <replaceable>mailbox</replaceable> exists.</span><br><span style="color: hsl(0, 100%, 40%);">- If <replaceable>context</replaceable> is not specified, defaults to the <literal>default</literal></span><br><span style="color: hsl(0, 100%, 40%);">- context.</para></span><br><span style="color: hsl(0, 100%, 40%);">- </description></span><br><span style="color: hsl(0, 100%, 40%);">- <see-also></span><br><span style="color: hsl(0, 100%, 40%);">- <ref type="function">VM_INFO</ref></span><br><span style="color: hsl(0, 100%, 40%);">- </see-also></span><br><span style="color: hsl(0, 100%, 40%);">- </function></span><br><span> <function name="VM_INFO" language="en_US"></span><br><span> <synopsis></span><br><span> Returns the selected attribute from a mailbox.</span><br><span>@@ -934,13 +884,12 @@</span><br><span> static char *addesc = "Comedian Mail";</span><br><span> </span><br><span> /* Leave a message */</span><br><span style="color: hsl(0, 100%, 40%);">-static char *app = "VoiceMail";</span><br><span style="color: hsl(120, 100%, 40%);">+static char *voicemail_app = "VoiceMail";</span><br><span> </span><br><span> /* Check mail, control, etc */</span><br><span style="color: hsl(0, 100%, 40%);">-static char *app2 = "VoiceMailMain";</span><br><span style="color: hsl(120, 100%, 40%);">+static char *voicemailmain_app = "VoiceMailMain";</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static char *app3 = "MailboxExists";</span><br><span style="color: hsl(0, 100%, 40%);">-static char *app4 = "VMAuthenticate";</span><br><span style="color: hsl(120, 100%, 40%);">+static char *vmauthenticate_app = "VMAuthenticate";</span><br><span> </span><br><span> static char *playmsg_app = "VoiceMailPlayMsg";</span><br><span> </span><br><span>@@ -12691,78 +12640,6 @@</span><br><span> }</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int vm_box_exists(struct ast_channel *chan, const char *data)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_vm_user svm, *vmu;</span><br><span style="color: hsl(0, 100%, 40%);">- char *context, *box;</span><br><span style="color: hsl(0, 100%, 40%);">- AST_DECLARE_APP_ARGS(args,</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(mbox);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(options);</span><br><span style="color: hsl(0, 100%, 40%);">- );</span><br><span style="color: hsl(0, 100%, 40%);">- static int dep_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_strlen_zero(data)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(AST_LOG_ERROR, "MailboxExists requires an argument: (vmbox[@context][|options])\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (!dep_warning) {</span><br><span style="color: hsl(0, 100%, 40%);">- dep_warning = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(AST_LOG_WARNING, "MailboxExists is deprecated. Please use ${VM_INFO(%s,exists)} instead.\n", data);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- box = ast_strdupa(data);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- AST_STANDARD_APP_ARGS(args, box);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (args.options) {</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if ((context = strchr(args.mbox, '@'))) {</span><br><span style="color: hsl(0, 100%, 40%);">- *context = '\0';</span><br><span style="color: hsl(0, 100%, 40%);">- context++;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- memset(&svm, 0, sizeof(svm));</span><br><span style="color: hsl(0, 100%, 40%);">- vmu = find_user(&svm, context, args.mbox);</span><br><span style="color: hsl(0, 100%, 40%);">- if (vmu) {</span><br><span style="color: hsl(0, 100%, 40%);">- pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS", "SUCCESS");</span><br><span style="color: hsl(0, 100%, 40%);">- free_user(vmu);</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- pbx_builtin_setvar_helper(chan, "VMBOXEXISTSSTATUS", "FAILED");</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-static int acf_mailbox_exists(struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- struct ast_vm_user svm, *vmu;</span><br><span style="color: hsl(0, 100%, 40%);">- AST_DECLARE_APP_ARGS(arg,</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(mbox);</span><br><span style="color: hsl(0, 100%, 40%);">- AST_APP_ARG(context);</span><br><span style="color: hsl(0, 100%, 40%);">- );</span><br><span style="color: hsl(0, 100%, 40%);">- static int dep_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- AST_NONSTANDARD_APP_ARGS(arg, args, '@');</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (ast_strlen_zero(arg.mbox)) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_ERROR, "MAILBOX_EXISTS requires an argument (<mailbox>[@<context>])\n");</span><br><span style="color: hsl(0, 100%, 40%);">- return -1;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (!dep_warning) {</span><br><span style="color: hsl(0, 100%, 40%);">- dep_warning = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(AST_LOG_WARNING, "MAILBOX_EXISTS is deprecated. Please use ${VM_INFO(%s,exists)} instead.\n", args);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- memset(&svm, 0, sizeof(svm));</span><br><span style="color: hsl(0, 100%, 40%);">- vmu = find_user(&svm, ast_strlen_zero(arg.context) ? "default" : arg.context, arg.mbox);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(buf, vmu ? "1" : "0", len);</span><br><span style="color: hsl(0, 100%, 40%);">- free_user(vmu);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len)</span><br><span> {</span><br><span> struct ast_vm_user svm;</span><br><span>@@ -12844,11 +12721,6 @@</span><br><span> return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static struct ast_custom_function mailbox_exists_acf = {</span><br><span style="color: hsl(0, 100%, 40%);">- .name = "MAILBOX_EXISTS",</span><br><span style="color: hsl(0, 100%, 40%);">- .read = acf_mailbox_exists,</span><br><span style="color: hsl(0, 100%, 40%);">-};</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> static struct ast_custom_function vm_info_acf = {</span><br><span> .name = "VM_INFO",</span><br><span> .read = acf_vm_info,</span><br><span>@@ -15140,13 +15012,11 @@</span><br><span> {</span><br><span> int res;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_unregister_application(app);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_application(app2);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_application(app3);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_unregister_application(app4);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_unregister_application(voicemail_app);</span><br><span style="color: hsl(120, 100%, 40%);">+ res |= ast_unregister_application(voicemailmain_app);</span><br><span style="color: hsl(120, 100%, 40%);">+ res |= ast_unregister_application(vmauthenticate_app);</span><br><span> res |= ast_unregister_application(playmsg_app);</span><br><span> res |= ast_unregister_application(sayname_app);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_custom_function_unregister(&mailbox_exists_acf);</span><br><span> res |= ast_custom_function_unregister(&vm_info_acf);</span><br><span> res |= ast_manager_unregister("VoicemailUsersList");</span><br><span> res |= ast_manager_unregister("VoicemailUserStatus");</span><br><span>@@ -15269,13 +15139,11 @@</span><br><span> return AST_MODULE_LOAD_DECLINE;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_register_application_xml(app, vm_exec);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_register_application_xml(app2, vm_execmain);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_register_application_xml(app3, vm_box_exists);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_register_application_xml(app4, vmauthenticate);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_register_application_xml(voicemail_app, vm_exec);</span><br><span style="color: hsl(120, 100%, 40%);">+ res |= ast_register_application_xml(voicemailmain_app, vm_execmain);</span><br><span style="color: hsl(120, 100%, 40%);">+ res |= ast_register_application_xml(vmauthenticate_app, vmauthenticate);</span><br><span> res |= ast_register_application_xml(playmsg_app, vm_playmsgexec);</span><br><span> res |= ast_register_application_xml(sayname_app, vmsayname_exec);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_custom_function_register(&mailbox_exists_acf);</span><br><span> res |= ast_custom_function_register(&vm_info_acf);</span><br><span> res |= ast_manager_register_xml("VoicemailUsersList", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_list_voicemail_users);</span><br><span> res |= ast_manager_register_xml("VoicemailUserStatus", EVENT_FLAG_CALL | EVENT_FLAG_REPORTING, manager_status_voicemail_user);</span><br><span>diff --git a/doc/UPGRADE-staging/vm_deprecated_removals.txt b/doc/UPGRADE-staging/vm_deprecated_removals.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..684a012</span><br><span>--- /dev/null</span><br><span>+++ b/doc/UPGRADE-staging/vm_deprecated_removals.txt</span><br><span>@@ -0,0 +1,7 @@</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: app_voicemail</span><br><span style="color: hsl(120, 100%, 40%);">+Master-Only: True</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The MessageExists dialplan application and the MESSAGE_EXISTS dialplan</span><br><span style="color: hsl(120, 100%, 40%);">+function were removed. The were deprecated in Asterisk 1.6.0 and</span><br><span style="color: hsl(120, 100%, 40%);">+Asterisk 11.0.0 respectively. The VM_INFO() dialplan function is the</span><br><span style="color: hsl(120, 100%, 40%);">+supported mechanism to query the status of a given mailbox.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13662">change 13662</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13662"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I71cfc9d7b9217a37b802f4cc6ef2d57900b7398f </div>
<div style="display:none"> Gerrit-Change-Number: 13662 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>