<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10510">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, approved
Joshua Colp: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">func_callerid: Remove deprecated CALLERPRES() function.<br><br>Change-Id: Ia1b2b386505b3102136dab02c45eaaf09f0f89c5<br>---<br>M UPGRADE.txt<br>M funcs/func_callerid.c<br>2 files changed, 51 insertions(+), 101 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/UPGRADE.txt b/UPGRADE.txt</span><br><span>index 7e17b10..a7bf14c 100644</span><br><span>--- a/UPGRADE.txt</span><br><span>+++ b/UPGRADE.txt</span><br><span>@@ -25,6 +25,9 @@</span><br><span> === UPGRADE-16.txt -- Upgrade info for 15 to 16</span><br><span> ===========================================================</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-From 16 to 17:</span><br><span style="color: hsl(120, 100%, 40%);">+New in 17.0.0:</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+* The CALLERPRES() dialplan function, deprecated in Asterisk 1.8, has been</span><br><span style="color: hsl(120, 100%, 40%);">+ removed.</span><br><span> </span><br><span> * The JabberStatus application, deprecated in Asterisk 12, has been removed.</span><br><span>diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c</span><br><span>index 0b6ab51..033366a 100644</span><br><span>--- a/funcs/func_callerid.c</span><br><span>+++ b/funcs/func_callerid.c</span><br><span>@@ -150,19 +150,9 @@</span><br><span> <enum name = "bmp"><para>ISO10646 Bmp String</para></enum></span><br><span> <enum name = "utf8"><para>ISO10646 UTF-8 String</para></enum></span><br><span> </enumlist></span><br><span style="color: hsl(0, 100%, 40%);">- </description></span><br><span style="color: hsl(0, 100%, 40%);">- </function></span><br><span style="color: hsl(0, 100%, 40%);">- <function name="CALLERPRES" language="en_US"></span><br><span style="color: hsl(0, 100%, 40%);">- <synopsis></span><br><span style="color: hsl(0, 100%, 40%);">- Gets or sets Caller*ID presentation on the channel.</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%);">- <description></span><br><span style="color: hsl(0, 100%, 40%);">- <para>Gets or sets Caller*ID presentation on the channel.</span><br><span style="color: hsl(0, 100%, 40%);">- This function is deprecated in favor of CALLERID(num-pres)</span><br><span style="color: hsl(0, 100%, 40%);">- and CALLERID(name-pres) or CALLERID(pres) to get/set both</span><br><span style="color: hsl(0, 100%, 40%);">- at once.</span><br><span style="color: hsl(0, 100%, 40%);">- The following values are valid:</para></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>The allowable values for the <replaceable>num-pres</replaceable>,</span><br><span style="color: hsl(120, 100%, 40%);">+ <replaceable>name-pres</replaceable>, and <replaceable>pres</replaceable></span><br><span style="color: hsl(120, 100%, 40%);">+ fields are the following:</para></span><br><span> <enumlist></span><br><span> <enum name="allowed_not_screened"></span><br><span> <para>Presentation Allowed, Not Screened.</para></span><br><span>@@ -257,6 +247,38 @@</span><br><span> <enum name = "bmp"><para>ISO10646 Bmp String</para></enum></span><br><span> <enum name = "utf8"><para>ISO10646 UTF-8 String</para></enum></span><br><span> </enumlist></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>The allowable values for the <replaceable>num-pres</replaceable>,</span><br><span style="color: hsl(120, 100%, 40%);">+ <replaceable>name-pres</replaceable>, and <replaceable>pres</replaceable></span><br><span style="color: hsl(120, 100%, 40%);">+ fields are the following:</para></span><br><span style="color: hsl(120, 100%, 40%);">+ <enumlist></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="allowed_not_screened"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Allowed, Not Screened.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="allowed_passed_screen"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Allowed, Passed Screen.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="allowed_failed_screen"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Allowed, Failed Screen.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="allowed"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Allowed, Network Number.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="prohib_not_screened"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Prohibited, Not Screened.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="prohib_passed_screen"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Prohibited, Passed Screen.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="prohib_failed_screen"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Prohibited, Failed Screen.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="prohib"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Presentation Prohibited, Network Number.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ <enum name="unavailable"></span><br><span style="color: hsl(120, 100%, 40%);">+ <para>Number Unavailable.</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </enum></span><br><span style="color: hsl(120, 100%, 40%);">+ </enumlist></span><br><span> </description></span><br><span> </function></span><br><span> <function name="REDIRECTING" language="en_US"></span><br><span>@@ -892,76 +914,6 @@</span><br><span> return status;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*! TRUE if we have already notified about CALLERPRES being deprecated. */</span><br><span style="color: hsl(0, 100%, 40%);">-static int callerpres_deprecate_notify;</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%);">- * \internal</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Read values from the caller-id presentation information struct.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param chan Asterisk channel to read</span><br><span style="color: hsl(0, 100%, 40%);">- * \param cmd Not used</span><br><span style="color: hsl(0, 100%, 40%);">- * \param data Caller-id presentation function datatype string</span><br><span style="color: hsl(0, 100%, 40%);">- * \param buf Buffer to fill with read value.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param len Length of the buffer</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 on success.</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 on error.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-static int callerpres_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- if (!chan) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);</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 (!callerpres_deprecate_notify) {</span><br><span style="color: hsl(0, 100%, 40%);">- callerpres_deprecate_notify = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "CALLERPRES is deprecated."</span><br><span style="color: hsl(0, 100%, 40%);">- " Use CALLERID(name-pres) or CALLERID(num-pres) instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(buf,</span><br><span style="color: hsl(0, 100%, 40%);">- ast_named_caller_presentation(ast_party_id_presentation(&ast_channel_caller(chan)->id)), len);</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%);">-/*!</span><br><span style="color: hsl(0, 100%, 40%);">- * \internal</span><br><span style="color: hsl(0, 100%, 40%);">- * \brief Write new values to the caller-id presentation information struct.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \param chan Asterisk channel to update</span><br><span style="color: hsl(0, 100%, 40%);">- * \param cmd Not used</span><br><span style="color: hsl(0, 100%, 40%);">- * \param data Caller-id presentation function datatype string</span><br><span style="color: hsl(0, 100%, 40%);">- * \param value Value to assign to the caller-id presentation information struct.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval 0 on success.</span><br><span style="color: hsl(0, 100%, 40%);">- * \retval -1 on error.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">-static int callerpres_write(struct ast_channel *chan, const char *cmd, char *data, const char *value)</span><br><span style="color: hsl(0, 100%, 40%);">-{</span><br><span style="color: hsl(0, 100%, 40%);">- int pres;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (!chan) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "No channel was provided to %s function.\n", cmd);</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 (!callerpres_deprecate_notify) {</span><br><span style="color: hsl(0, 100%, 40%);">- callerpres_deprecate_notify = 1;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "CALLERPRES is deprecated."</span><br><span style="color: hsl(0, 100%, 40%);">- " Use CALLERID(name-pres) or CALLERID(num-pres) instead.\n");</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%);">- pres = ast_parse_caller_presentation(value);</span><br><span style="color: hsl(0, 100%, 40%);">- if (pres < 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show function CALLERPRES')\n", value);</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_channel_caller(chan)->id.name.presentation = pres;</span><br><span style="color: hsl(0, 100%, 40%);">- ast_channel_caller(chan)->id.number.presentation = pres;</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> /*!</span><br><span> * \internal</span><br><span> * \brief Read values from the caller-id information struct.</span><br><span>@@ -1825,13 +1777,6 @@</span><br><span> .write = callerid_write,</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static struct ast_custom_function callerpres_function = {</span><br><span style="color: hsl(0, 100%, 40%);">- .name = "CALLERPRES",</span><br><span style="color: hsl(0, 100%, 40%);">- .read = callerpres_read,</span><br><span style="color: hsl(0, 100%, 40%);">- .read_max = 50,</span><br><span style="color: hsl(0, 100%, 40%);">- .write = callerpres_write,</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 connectedline_function = {</span><br><span> .name = "CONNECTEDLINE",</span><br><span> .read = connectedline_read,</span><br><span>@@ -1853,13 +1798,10 @@</span><br><span> */</span><br><span> static int unload_module(void)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- int res;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_custom_function_unregister(&callerpres_function);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_custom_function_unregister(&callerid_function);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_custom_function_unregister(&connectedline_function);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_custom_function_unregister(&redirecting_function);</span><br><span style="color: hsl(0, 100%, 40%);">- return res;</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_custom_function_unregister(&callerid_function);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_custom_function_unregister(&connectedline_function);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_custom_function_unregister(&redirecting_function);</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span> }</span><br><span> </span><br><span> /*!</span><br><span>@@ -1873,11 +1815,16 @@</span><br><span> {</span><br><span> int res;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- res = ast_custom_function_register(&callerpres_function);</span><br><span style="color: hsl(0, 100%, 40%);">- res |= ast_custom_function_register(&callerid_function);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = ast_custom_function_register(&callerid_function);</span><br><span> res |= ast_custom_function_register(&connectedline_function);</span><br><span> res |= ast_custom_function_register(&redirecting_function);</span><br><span style="color: hsl(0, 100%, 40%);">- return res ? AST_MODULE_LOAD_DECLINE : AST_MODULE_LOAD_SUCCESS;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (res) {</span><br><span style="color: hsl(120, 100%, 40%);">+ unload_module();</span><br><span style="color: hsl(120, 100%, 40%);">+ return AST_MODULE_LOAD_DECLINE;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return AST_MODULE_LOAD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span> /* Do not wrap the following line. */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10510">change 10510</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/10510"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia1b2b386505b3102136dab02c45eaaf09f0f89c5 </div>
<div style="display:none"> Gerrit-Change-Number: 10510 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>